Get desktop application:
View/edit binary Protocol Buffers messages
For a read request, the id field is the only to be specified
fields
(message has no fields)
The convention requires the rpc names have Create/Read/Update/List/Delete as a prefix. The type is inferred from the response (except for delete), so multiple objects can have CURDL handlers in the same service, provided they are given unique suffixes
Note repeated field and plural name 'results'
CustomMethod can't be autogenerated as it matches no conventions, it will become a stub
CreateSomething also doesn't match conventions and will become a stub
(message has no fields)
Test cases that were previously broken
The convention requires the rpc names have Create/Read/Update/List/Delete as a prefix. The type is inferred from the response (except for delete), so multiple objects can have CURDL handlers in the same service, provided they are given unique suffixes
CustomMethod can't be autogenerated as it matches no conventions, it will become a stub
CreateSomething also doesn't match conventions and will become a stub
Used in:
here the ormable flag is not used, so nothing will be generated for this object at the ORM level, and when this type is used as a field or repeated field in another message that field will be dropped in the Orm model, and would have to be set by hook
Used in:
Used in:
Used as request type in: IntPointService.Create, IntPointTxn.Create, MultipleMethodsAutoGen.CreateA, MultipleMethodsAutoGen.CreateB
Convention dictates that this field be of the given type, and be named 'payload' in order to autogenerate the handler
Used as response type in: IntPointService.Create, IntPointTxn.Create, MultipleMethodsAutoGen.CreateA, MultipleMethodsAutoGen.CreateB
Convention also requires that the return type be the same and named 'result'
Used as request type in: IntPointService.Delete, IntPointTxn.Delete, MultipleMethodsAutoGen.DeleteA, MultipleMethodsAutoGen.DeleteB
Only the id is needed for a delete request
By convention, on DELETE no response data is given, so either a google.protobuf.empty, or an empty struct is sufficient
Used as response type in: IntPointService.Delete, IntPointTxn.Delete, IntPointTxn.DeleteSet, MultipleMethodsAutoGen.DeleteA, MultipleMethodsAutoGen.DeleteB, MultipleMethodsAutoGen.DeleteSetA, MultipleMethodsAutoGen.DeleteSetB
(message has no fields)
Used as request type in: IntPointTxn.DeleteSet, MultipleMethodsAutoGen.DeleteSetA, MultipleMethodsAutoGen.DeleteSetB
Only the id is needed for a delete request
Used in:
, ,IntPoint is a basic message type representing a single cartesian point that we want to store in a database
Used in:
, , , , , , , ,Used as request type in: IntPointService.List, IntPointTxn.List, MultipleMethodsAutoGen.ListA, MultipleMethodsAutoGen.ListB
Used as response type in: IntPointService.List, IntPointServiceB.Create, IntPointServiceB.List, IntPointTxn.List, MultipleMethodsAutoGen.ListA, MultipleMethodsAutoGen.ListB
Note repeated field and plural name 'results'
MultiaccountTypeWithID demonstrates the generated multi-account support
Used as request type in: IntPointService.Read, IntPointTxn.Read, MultipleMethodsAutoGen.ReadA, MultipleMethodsAutoGen.ReadB
For a read request, the id field is the only to be specified
Used as response type in: IntPointService.Read, IntPointTxn.Read, MultipleMethodsAutoGen.ReadA, MultipleMethodsAutoGen.ReadB
Again the type with 'result' name
A dummy type to demo an rpc that can't be autogenerated
Used as request type in: IntPointService.CreateSomething, IntPointTxn.CreateSomething
Used as response type in: IntPointService.CreateSomething, IntPointTxn.CreateSomething
Used as field type in:
replace by default
Used in:
, , , ,test_types is a message that includes a representative sample of the available types
Used in:
the (gorm.field).drop option allows for setting a field to be API only
repeated raw types are currently unsupported, so this field will be dropped at the ORM level
a StringValue represents a Nullable string
The Empty type serves no purpose outside of rpc calls and is dropped automatically from objects
The UUID custom type should act like a StringValue at the API level, but is automatically converted to and from a uuid.UUID (github.com/satori/go.uuid)
Timestamps convert to golang's time.Time type, and created_at and updated_at values are automatically filled by GORM
Duration convert to golang's time.Duration type.
This represents a foreign key to the 'type_with_id' type for associations This could be hidden from the API (or soon autogenerated).
This is an arbitrary JSON string that is marshalled and unmarshalled specially in grpc-gateway as a JSON object
The UUIDValue custom type should act like a StringValue at the API level, but is automatically converted to and from a *uuid.UUID (github.com/satori/go.uuid)
The TimeOnly should act as uint32 value at business layer, but is automatically converted to/from string at API and ORM level
Repeated non-ormable objects are currently treated as single entity for purposes of an object's field masking
enums are mapped to the their underlying numeric value in the db. This is practical from an API perspective, but tougher for debugging. Strings with validation constraints can be used instead if desired
Used in:
TypeWithID demonstrates some basic association behavior
any field named 'id' is assumed by gorm to be the primary key for the object.
The field option also allows arbitrary tag setting, such as informing gorm of a primary key, different column names or different types in the db
A default has-many relationship, will error on generation if no FK field, convention {typename}_id, is present. These FK fields will be automatically populated on create and update.
A default has-one relationship, will error as above
An in-package and cross-package imported type (in-package can use any association type, cross-package is limited to belongs_to and many_to_many)
Limited support for DB type 'time', implemented via strings (string -> DB && DB -> string)
Used as request type in: IntPointService.Update, IntPointTxn.Update, MultipleMethodsAutoGen.UpdateA, MultipleMethodsAutoGen.UpdateB
Used as response type in: IntPointService.Update, IntPointTxn.Update, MultipleMethodsAutoGen.UpdateA, MultipleMethodsAutoGen.UpdateB