github.com/emcfarlane/larking@v0.0.0-20220605172417-1704b45ee6c3/starlib/encoding/starlarkproto/README.md (about)

     1  Module defines these types:
     2  - descriptor
     3  - message
     4  - enum
     5  - list
     6  - map
     7  
     8  ## file
     9  
    10  `file(name)` returns the descriptor of the proto file.
    11  
    12  | Parameter | Type | Description |
    13  | --------- | ---- | ----------- |
    14  | name | string | Name of the proto file. |
    15  
    16  ## new
    17  
    18  `new(name)` returns a protobuf descriptor for the given type.
    19  
    20  | Parameter | Type | Description |
    21  | --------- | ---- | ----------- |
    22  | name | string | Descriptor fullname of proto type. |
    23  
    24  ## marshal
    25  
    26  `marshal(msg)` message as a binary encoded string.
    27  
    28  | Parameter | Type | Description |
    29  | --------- | ---- | ----------- |
    30  | msg | message | Descriptor fullname of proto type. |
    31  
    32  ## unmarshal
    33  
    34  `unmarshal(b, msg)` protobuffer into the msg.
    35  
    36  ## marshal_json
    37  
    38  `marshal_json(msg)` message as JSON.
    39  
    40  ## unmarshal_json
    41  
    42  `unmarshal_json(b, msg)` json into the msg.
    43  
    44  ## marshal_text
    45  
    46  `marshal_text(msg)` message as text.
    47  
    48  ## unmarshal_text
    49  
    50  `unmarshal_text(b, msg)` text into the msg.
    51  
    52  ### messageĀ·field
    53  
    54  `m.<field>` returns the value of the field named by the proto name.