github.com/ipld/go-ipld-prime@v0.21.0/schema/gen/go/README.md (about)

     1  gengo
     2  =====
     3  
     4  This package contains a codegenerator for emitting Golang source code
     5  for datastructures based on IPLD Schemas.
     6  
     7  It is reasonably complete.  See the [feature table](#completeness) below for details.
     8  
     9  There is a CLI tool which can be used to run this generator.
    10  See https://github.com/ipld/go-ipldtool !
    11  
    12  Some features may still requiring writing code to fully configure them.
    13  (PRs, here or in the go-ipldtool repo, welcome.)
    14  
    15  See [README_behaviors](README_behaviors.md) for notes about the behaviors of the code output by the generator.
    16  
    17  Check out the [HACKME](HACKME.md) document for more info about the internals,
    18  how they're organized, and how to hack on this package.
    19  
    20  
    21  aims
    22  ----
    23  
    24  `gengo` aims to:
    25  
    26  - generate native Golang code
    27  - that faithfully represents the data structuring specified by an IPLD Schema,
    28  - operating efficiently, both in speed (both creating and inspecting) and memory compactness;
    29  - producing a better type system for Golang (we've got unions and enums!)
    30  - that is both powerful and generic (when you need it)
    31  - and minimalist (when you don't),
    32  - with immutable data structures,
    33  - good validation primitives and type-supported safety systems,
    34  - and is friendly to embellishments of other hand-written Golang code.
    35  
    36  Some of these aims should be satisfied.
    37  
    38  Some are still a stretch ;)  (we definitely don't have "minimalist" outputs, yet.
    39  Making this reachable by tuning is a goal, however!)
    40  
    41  
    42  completeness
    43  ------------
    44  
    45  Legend:
    46  
    47  - `✔` - supported!
    48  - `✘` - not currently supported.
    49  - `⚠` - not currently supported -- and might not be obvious; be careful.
    50  - `-` - is not applicable
    51  - `?` - feature definition needed!  (applies to many of the "native extras" rows -- often there's partial features, but also room for more.)
    52  - ` ` - table is not finished, please refer to the code and help fix the table :)
    53  
    54  | feature                          | accessors | builders |
    55  |:---------------------------------|:---------:|:--------:|
    56  | structs                          |    ...    |    ...   |
    57  | ... type level                   |     ✔     |     ✔    |
    58  | ... native extras                |     ?     |     ?    |
    59  | ... map representation           |     ✔     |     ✔    |
    60  | ... ... including optional       |     ✔     |     ✔    |
    61  | ... ... including renames        |     ✔     |     ✔    |
    62  | ... ... including implicits      |     ⚠     |     ⚠    |
    63  | ... tuple representation         |     ✔     |     ✔    |
    64  | ... ... including optional       |     ✔     |     ✔    |
    65  | ... ... including renames        |     -     |     -    |
    66  | ... ... including implicits      |     ⚠     |     ⚠    |
    67  | ... stringjoin representation    |     ✔     |     ✔    |
    68  | ... ... including optional       |     -     |     -    |
    69  | ... ... including renames        |     -     |     -    |
    70  | ... ... including implicits      |     -     |     -    |
    71  | ... stringpairs representation   |     ✘     |     ✘    |
    72  | ... ... including optional       |           |          |
    73  | ... ... including renames        |           |          |
    74  | ... ... including implicits      |           |          |
    75  | ... listpairs representation     |     ✘     |     ✘    |
    76  | ... ... including optional       |           |          |
    77  | ... ... including renames        |           |          |
    78  | ... ... including implicits      |           |          |
    79  
    80  | feature                          | accessors | builders |
    81  |:---------------------------------|:---------:|:--------:|
    82  | lists                            |    ...    |    ...   |
    83  | ... type level                   |     ✔     |     ✔    |
    84  | ... native extras                |     ?     |     ?    |
    85  | ... list representation          |     ✔     |     ✔    |
    86  
    87  | feature                          | accessors | builders |
    88  |:---------------------------------|:---------:|:--------:|
    89  | maps                             |    ...    |    ...   |
    90  | ... type level                   |     ✔     |     ✔    |
    91  | ... native extras                |     ?     |     ?    |
    92  | ... map representation           |     ✔     |     ✔    |
    93  | ... stringpairs representation   |     ✘     |     ✘    |
    94  | ... listpairs representation     |     ✘     |     ✘    |
    95  
    96  | feature                          | accessors | builders |
    97  |:---------------------------------|:---------:|:--------:|
    98  | unions                           |    ...    |    ...   |
    99  | ... type level                   |     ✔     |     ✔    |
   100  | ... keyed representation         |     ✔     |     ✔    |
   101  | ... envelope representation      |     ✘     |     ✘    |
   102  | ... kinded representation        |     ✔     |     ✔    |
   103  | ... inline representation        |     ✘     |     ✘    |
   104  | ... stringprefix representation  |     ✔     |     ✔    |
   105  | ... byteprefix representation    |     ✘     |     ✘    |
   106   
   107  | feature                          | accessors | builders |
   108  |:---------------------------------|:---------:|:--------:|
   109  | strings                          |     ✔     |     ✔    |
   110  | bytes                            |     ✔     |     ✔    |
   111  | ints                             |     ✔     |     ✔    |
   112  | floats                           |     ✔     |     ✔    |
   113  | bools                            |     ✔     |     ✔    |
   114  | links                            |     ✔     |     ✔    |
   115  
   116  | feature                          | accessors | builders |
   117  |:---------------------------------|:---------:|:--------:|
   118  | enums                            |    ...    |    ...   |
   119  | ... type level                   |     ✘     |     ✘    |
   120  | ... string representation        |     ✘     |     ✘    |
   121  | ... int representation           |     ✘     |     ✘    |