example

package
v0.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 6, 2018 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package example is a generated protocol buffer package.

It is generated from these files:

example/feature_demo/demo_types.proto
example/feature_demo/demo_service.proto

It has these top-level messages:

TestTypes
TypeWithID
MultiaccountTypeWithID
MultiaccountTypeWithoutID
APIOnlyType
IntPoint
CreateIntPointRequest
CreateIntPointResponse
ReadIntPointRequest
ReadIntPointResponse
UpdateIntPointRequest
UpdateIntPointResponse
DeleteIntPointRequest
DeleteIntPointResponse
ListIntPointResponse
Something

Package example is a generated protocol buffer package.

It is generated from these files:

example/feature_demo/demo_types.proto
example/feature_demo/demo_service.proto

It has these top-level messages:

TestTypes
TypeWithID
MultiaccountTypeWithID
MultiaccountTypeWithoutID
APIOnlyType
IntPoint
CreateIntPointRequest
CreateIntPointResponse
ReadIntPointRequest
ReadIntPointResponse
UpdateIntPointRequest
UpdateIntPointResponse
DeleteIntPointRequest
DeleteIntPointResponse
ListIntPointResponse
Something

Index

Constants

This section is empty.

Variables

View Source
var TestTypesStatus_name = map[int32]string{
	0: "UNKNOWN",
	1: "GOOD",
	2: "BAD",
}
View Source
var TestTypesStatus_value = map[string]int32{
	"UNKNOWN": 0,
	"GOOD":    1,
	"BAD":     2,
}

Functions

func DefaultDeleteIntPoint

func DefaultDeleteIntPoint(ctx context.Context, in *IntPoint, db *gorm.DB) error

func DefaultDeleteMultiaccountTypeWithID added in v0.2.0

func DefaultDeleteMultiaccountTypeWithID(ctx context.Context, in *MultiaccountTypeWithID, db *gorm.DB) error

func DefaultDeleteTypeWithID

func DefaultDeleteTypeWithID(ctx context.Context, in *TypeWithID, db *gorm.DB) error

func RegisterIntPointServer added in v0.2.0

func RegisterIntPointServer(s *grpc.Server, srv IntPointServer)

Types

type APIOnlyType added in v0.2.0

type APIOnlyType struct {
	// 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
	Contents string `protobuf:"bytes,1,opt,name=contents" json:"contents,omitempty"`
}

func (*APIOnlyType) Descriptor added in v0.2.0

func (*APIOnlyType) Descriptor() ([]byte, []int)

func (*APIOnlyType) GetContents added in v0.2.0

func (m *APIOnlyType) GetContents() string

func (*APIOnlyType) ProtoMessage added in v0.2.0

func (*APIOnlyType) ProtoMessage()

func (*APIOnlyType) Reset added in v0.2.0

func (m *APIOnlyType) Reset()

func (*APIOnlyType) String added in v0.2.0

func (m *APIOnlyType) String() string

type CreateIntPointRequest added in v0.2.0

type CreateIntPointRequest struct {
	// Convention dictates that this field be of the given type, and be
	// named 'payload' in order to autogenerate the handler
	Payload *IntPoint `protobuf:"bytes,1,opt,name=payload" json:"payload,omitempty"`
}

func (*CreateIntPointRequest) Descriptor added in v0.2.0

func (*CreateIntPointRequest) Descriptor() ([]byte, []int)

func (*CreateIntPointRequest) GetPayload added in v0.2.0

func (m *CreateIntPointRequest) GetPayload() *IntPoint

func (*CreateIntPointRequest) ProtoMessage added in v0.2.0

func (*CreateIntPointRequest) ProtoMessage()

func (*CreateIntPointRequest) Reset added in v0.2.0

func (m *CreateIntPointRequest) Reset()

func (*CreateIntPointRequest) String added in v0.2.0

func (m *CreateIntPointRequest) String() string

type CreateIntPointResponse added in v0.2.0

type CreateIntPointResponse struct {
	// Convention also requires that the return type be the same and named 'result'
	Result *IntPoint `protobuf:"bytes,1,opt,name=result" json:"result,omitempty"`
}

func (*CreateIntPointResponse) Descriptor added in v0.2.0

func (*CreateIntPointResponse) Descriptor() ([]byte, []int)

func (*CreateIntPointResponse) GetResult added in v0.2.0

func (m *CreateIntPointResponse) GetResult() *IntPoint

func (*CreateIntPointResponse) ProtoMessage added in v0.2.0

func (*CreateIntPointResponse) ProtoMessage()

func (*CreateIntPointResponse) Reset added in v0.2.0

func (m *CreateIntPointResponse) Reset()

func (*CreateIntPointResponse) String added in v0.2.0

func (m *CreateIntPointResponse) String() string

type DeleteIntPointRequest added in v0.2.0

type DeleteIntPointRequest struct {
	// Only the id is needed for a delete request
	Id uint32 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"`
}

func (*DeleteIntPointRequest) Descriptor added in v0.2.0

func (*DeleteIntPointRequest) Descriptor() ([]byte, []int)

func (*DeleteIntPointRequest) GetId added in v0.2.0

func (m *DeleteIntPointRequest) GetId() uint32

func (*DeleteIntPointRequest) ProtoMessage added in v0.2.0

func (*DeleteIntPointRequest) ProtoMessage()

func (*DeleteIntPointRequest) Reset added in v0.2.0

func (m *DeleteIntPointRequest) Reset()

func (*DeleteIntPointRequest) String added in v0.2.0

func (m *DeleteIntPointRequest) String() string

type DeleteIntPointResponse added in v0.5.0

type DeleteIntPointResponse struct {
}

By convention, on DELETE no response data is given, so either a google.protobuf.empty, or an empty struct is sufficient

func (*DeleteIntPointResponse) Descriptor added in v0.5.0

func (*DeleteIntPointResponse) Descriptor() ([]byte, []int)

func (*DeleteIntPointResponse) ProtoMessage added in v0.5.0

func (*DeleteIntPointResponse) ProtoMessage()

func (*DeleteIntPointResponse) Reset added in v0.5.0

func (m *DeleteIntPointResponse) Reset()

func (*DeleteIntPointResponse) String added in v0.5.0

func (m *DeleteIntPointResponse) String() string

type IntPoint

type IntPoint struct {
	Id uint32 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"`
	X  int32  `protobuf:"varint,2,opt,name=x" json:"x,omitempty"`
	Y  int32  `protobuf:"varint,3,opt,name=y" json:"y,omitempty"`
}

int_point is a basic message type representing a single cartesian point that we want to store in a database

func DefaultCreateIntPoint

func DefaultCreateIntPoint(ctx context.Context, in *IntPoint, db *gorm.DB) (*IntPoint, error)

DefaultCreateIntPoint executes a basic gorm create call

func DefaultListIntPoint

func DefaultListIntPoint(ctx context.Context, db *gorm.DB) ([]*IntPoint, error)

DefaultListIntPoint executes a gorm list call

func DefaultReadIntPoint

func DefaultReadIntPoint(ctx context.Context, in *IntPoint, db *gorm.DB) (*IntPoint, error)

DefaultReadIntPoint executes a basic gorm read call

func DefaultStrictUpdateIntPoint

func DefaultStrictUpdateIntPoint(ctx context.Context, in *IntPoint, db *gorm.DB) (*IntPoint, error)

DefaultStrictUpdateIntPoint clears first level 1:many children and then executes a gorm update call

func DefaultUpdateIntPoint

func DefaultUpdateIntPoint(ctx context.Context, in *IntPoint, db *gorm.DB) (*IntPoint, error)

DefaultUpdateIntPoint executes a basic gorm update call

func (*IntPoint) Descriptor

func (*IntPoint) Descriptor() ([]byte, []int)

func (*IntPoint) GetId

func (m *IntPoint) GetId() uint32

func (*IntPoint) GetX

func (m *IntPoint) GetX() int32

func (*IntPoint) GetY

func (m *IntPoint) GetY() int32

func (*IntPoint) ProtoMessage

func (*IntPoint) ProtoMessage()

func (*IntPoint) Reset

func (m *IntPoint) Reset()

func (*IntPoint) String

func (m *IntPoint) String() string

func (*IntPoint) ToORM added in v0.2.1

func (m *IntPoint) ToORM(ctx context.Context) (IntPointORM, error)

ToORM runs the BeforeToORM hook if present, converts the fields of this object to ORM format, runs the AfterToORM hook, then returns the ORM object

type IntPointClient added in v0.2.0

type IntPointClient interface {
	// 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
	Create(ctx context.Context, in *CreateIntPointRequest, opts ...grpc.CallOption) (*CreateIntPointResponse, error)
	Read(ctx context.Context, in *ReadIntPointRequest, opts ...grpc.CallOption) (*ReadIntPointResponse, error)
	Update(ctx context.Context, in *UpdateIntPointRequest, opts ...grpc.CallOption) (*UpdateIntPointResponse, error)
	List(ctx context.Context, in *google_protobuf2.Empty, opts ...grpc.CallOption) (*ListIntPointResponse, error)
	Delete(ctx context.Context, in *DeleteIntPointRequest, opts ...grpc.CallOption) (*DeleteIntPointResponse, error)
	// CustomMethod can't be autogenerated as it matches no conventions, it will
	// become a stub
	CustomMethod(ctx context.Context, in *google_protobuf2.Empty, opts ...grpc.CallOption) (*google_protobuf2.Empty, error)
	// CreateSomething also doesn't match conventions and will become a stub
	CreateSomething(ctx context.Context, in *Something, opts ...grpc.CallOption) (*Something, error)
}

func NewIntPointClient added in v0.2.0

func NewIntPointClient(cc *grpc.ClientConn) IntPointClient

type IntPointCreateCustomHandler added in v0.5.0

type IntPointCreateCustomHandler interface {
	CustomCreate(context.Context, *CreateIntPointRequest) (*CreateIntPointResponse, error)
}

type IntPointCreateSomethingCustomHandler added in v0.5.0

type IntPointCreateSomethingCustomHandler interface {
	CustomCreateSomething(context.Context, *Something) (*Something, error)
}

type IntPointCustomMethodCustomHandler added in v0.5.0

type IntPointCustomMethodCustomHandler interface {
	CustomCustomMethod(context.Context, *google_protobuf2.Empty) (*google_protobuf2.Empty, error)
}

type IntPointDefaultServer added in v0.2.0

type IntPointDefaultServer struct {
	DB *gorm.DB
}

func (*IntPointDefaultServer) Create added in v0.2.0

Create ...

func (*IntPointDefaultServer) CreateSomething added in v0.2.0

func (m *IntPointDefaultServer) CreateSomething(ctx context.Context, in *Something) (*Something, error)

CreateSomething ...

func (*IntPointDefaultServer) CustomMethod added in v0.2.0

CustomMethod ...

func (*IntPointDefaultServer) Delete added in v0.2.0

Delete ...

func (*IntPointDefaultServer) List added in v0.2.0

List ...

func (*IntPointDefaultServer) Read added in v0.2.0

Read ...

func (*IntPointDefaultServer) Update added in v0.2.0

Update ...

type IntPointDeleteCustomHandler added in v0.5.0

type IntPointDeleteCustomHandler interface {
	CustomDelete(context.Context, *DeleteIntPointRequest) (*DeleteIntPointResponse, error)
}

type IntPointListCustomHandler added in v0.5.0

type IntPointListCustomHandler interface {
	CustomList(context.Context, *google_protobuf2.Empty) (*ListIntPointResponse, error)
}

type IntPointORM

type IntPointORM struct {
	Id uint32
	X  int32
	Y  int32
}

func (IntPointORM) TableName

func (IntPointORM) TableName() string

TableName overrides the default tablename generated by GORM

func (*IntPointORM) ToPB added in v0.2.1

func (m *IntPointORM) ToPB(ctx context.Context) (IntPoint, error)

ToPB runs the BeforeToPB hook if present, converts the fields of this object to PB format, runs the AfterToPB hook, then returns the PB object

type IntPointReadCustomHandler added in v0.5.0

type IntPointReadCustomHandler interface {
	CustomRead(context.Context, *ReadIntPointRequest) (*ReadIntPointResponse, error)
}

type IntPointServer added in v0.2.0

type IntPointServer interface {
	// 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
	Create(context.Context, *CreateIntPointRequest) (*CreateIntPointResponse, error)
	Read(context.Context, *ReadIntPointRequest) (*ReadIntPointResponse, error)
	Update(context.Context, *UpdateIntPointRequest) (*UpdateIntPointResponse, error)
	List(context.Context, *google_protobuf2.Empty) (*ListIntPointResponse, error)
	Delete(context.Context, *DeleteIntPointRequest) (*DeleteIntPointResponse, error)
	// CustomMethod can't be autogenerated as it matches no conventions, it will
	// become a stub
	CustomMethod(context.Context, *google_protobuf2.Empty) (*google_protobuf2.Empty, error)
	// CreateSomething also doesn't match conventions and will become a stub
	CreateSomething(context.Context, *Something) (*Something, error)
}

type IntPointUpdateCustomHandler added in v0.5.0

type IntPointUpdateCustomHandler interface {
	CustomUpdate(context.Context, *UpdateIntPointRequest) (*UpdateIntPointResponse, error)
}

type IntPointWithAfterToORM added in v0.2.1

type IntPointWithAfterToORM interface {
	AfterToORM(context.Context, *IntPointORM) error
}

IntPointAfterToORM called after default ToORM code

type IntPointWithAfterToPB added in v0.2.1

type IntPointWithAfterToPB interface {
	AfterToPB(context.Context, *IntPoint) error
}

IntPointAfterToPB called after default ToPB code

type IntPointWithBeforeToORM added in v0.2.1

type IntPointWithBeforeToORM interface {
	BeforeToORM(context.Context, *IntPointORM) error
}

IntPointBeforeToORM called before default ToORM code

type IntPointWithBeforeToPB added in v0.2.1

type IntPointWithBeforeToPB interface {
	BeforeToPB(context.Context, *IntPoint) error
}

IntPointBeforeToPB called before default ToPB code

type ListIntPointResponse added in v0.2.0

type ListIntPointResponse struct {
	// Note repeated field and plural name 'results'
	Results []*IntPoint `protobuf:"bytes,1,rep,name=results" json:"results,omitempty"`
}

func (*ListIntPointResponse) Descriptor added in v0.2.0

func (*ListIntPointResponse) Descriptor() ([]byte, []int)

func (*ListIntPointResponse) GetResults added in v0.2.0

func (m *ListIntPointResponse) GetResults() []*IntPoint

func (*ListIntPointResponse) ProtoMessage added in v0.2.0

func (*ListIntPointResponse) ProtoMessage()

func (*ListIntPointResponse) Reset added in v0.2.0

func (m *ListIntPointResponse) Reset()

func (*ListIntPointResponse) String added in v0.2.0

func (m *ListIntPointResponse) String() string

type MultiaccountTypeWithID added in v0.2.0

type MultiaccountTypeWithID struct {
	Id        uint64 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"`
	SomeField string `protobuf:"bytes,2,opt,name=some_field,json=someField" json:"some_field,omitempty"`
}

MultiaccountTypeWithID demonstrates the generated multi-account support

func DefaultCreateMultiaccountTypeWithID added in v0.2.0

func DefaultCreateMultiaccountTypeWithID(ctx context.Context, in *MultiaccountTypeWithID, db *gorm.DB) (*MultiaccountTypeWithID, error)

DefaultCreateMultiaccountTypeWithID executes a basic gorm create call

func DefaultListMultiaccountTypeWithID added in v0.2.0

func DefaultListMultiaccountTypeWithID(ctx context.Context, db *gorm.DB) ([]*MultiaccountTypeWithID, error)

DefaultListMultiaccountTypeWithID executes a gorm list call

func DefaultReadMultiaccountTypeWithID added in v0.2.0

func DefaultReadMultiaccountTypeWithID(ctx context.Context, in *MultiaccountTypeWithID, db *gorm.DB) (*MultiaccountTypeWithID, error)

DefaultReadMultiaccountTypeWithID executes a basic gorm read call

func DefaultStrictUpdateMultiaccountTypeWithID added in v0.2.0

func DefaultStrictUpdateMultiaccountTypeWithID(ctx context.Context, in *MultiaccountTypeWithID, db *gorm.DB) (*MultiaccountTypeWithID, error)

DefaultStrictUpdateMultiaccountTypeWithID clears first level 1:many children and then executes a gorm update call

func DefaultUpdateMultiaccountTypeWithID added in v0.2.0

func DefaultUpdateMultiaccountTypeWithID(ctx context.Context, in *MultiaccountTypeWithID, db *gorm.DB) (*MultiaccountTypeWithID, error)

DefaultUpdateMultiaccountTypeWithID executes a basic gorm update call

func (*MultiaccountTypeWithID) Descriptor added in v0.2.0

func (*MultiaccountTypeWithID) Descriptor() ([]byte, []int)

func (*MultiaccountTypeWithID) GetId added in v0.2.0

func (m *MultiaccountTypeWithID) GetId() uint64

func (*MultiaccountTypeWithID) GetSomeField added in v0.2.0

func (m *MultiaccountTypeWithID) GetSomeField() string

func (*MultiaccountTypeWithID) ProtoMessage added in v0.2.0

func (*MultiaccountTypeWithID) ProtoMessage()

func (*MultiaccountTypeWithID) Reset added in v0.2.0

func (m *MultiaccountTypeWithID) Reset()

func (*MultiaccountTypeWithID) String added in v0.2.0

func (m *MultiaccountTypeWithID) String() string

func (*MultiaccountTypeWithID) ToORM added in v0.2.1

ToORM runs the BeforeToORM hook if present, converts the fields of this object to ORM format, runs the AfterToORM hook, then returns the ORM object

type MultiaccountTypeWithIDORM added in v0.2.0

type MultiaccountTypeWithIDORM struct {
	AccountID string
	Id        uint64
	SomeField string
}

func (MultiaccountTypeWithIDORM) TableName added in v0.2.0

func (MultiaccountTypeWithIDORM) TableName() string

TableName overrides the default tablename generated by GORM

func (*MultiaccountTypeWithIDORM) ToPB added in v0.2.1

ToPB runs the BeforeToPB hook if present, converts the fields of this object to PB format, runs the AfterToPB hook, then returns the PB object

type MultiaccountTypeWithIDWithAfterToORM added in v0.2.1

type MultiaccountTypeWithIDWithAfterToORM interface {
	AfterToORM(context.Context, *MultiaccountTypeWithIDORM) error
}

MultiaccountTypeWithIDAfterToORM called after default ToORM code

type MultiaccountTypeWithIDWithAfterToPB added in v0.2.1

type MultiaccountTypeWithIDWithAfterToPB interface {
	AfterToPB(context.Context, *MultiaccountTypeWithID) error
}

MultiaccountTypeWithIDAfterToPB called after default ToPB code

type MultiaccountTypeWithIDWithBeforeToORM added in v0.2.1

type MultiaccountTypeWithIDWithBeforeToORM interface {
	BeforeToORM(context.Context, *MultiaccountTypeWithIDORM) error
}

MultiaccountTypeWithIDBeforeToORM called before default ToORM code

type MultiaccountTypeWithIDWithBeforeToPB added in v0.2.1

type MultiaccountTypeWithIDWithBeforeToPB interface {
	BeforeToPB(context.Context, *MultiaccountTypeWithID) error
}

MultiaccountTypeWithIDBeforeToPB called before default ToPB code

type MultiaccountTypeWithoutID added in v0.2.0

type MultiaccountTypeWithoutID struct {
	SomeField string `protobuf:"bytes,1,opt,name=some_field,json=someField" json:"some_field,omitempty"`
}

func DefaultCreateMultiaccountTypeWithoutID added in v0.2.0

func DefaultCreateMultiaccountTypeWithoutID(ctx context.Context, in *MultiaccountTypeWithoutID, db *gorm.DB) (*MultiaccountTypeWithoutID, error)

DefaultCreateMultiaccountTypeWithoutID executes a basic gorm create call

func DefaultListMultiaccountTypeWithoutID added in v0.2.0

func DefaultListMultiaccountTypeWithoutID(ctx context.Context, db *gorm.DB) ([]*MultiaccountTypeWithoutID, error)

DefaultListMultiaccountTypeWithoutID executes a gorm list call

func (*MultiaccountTypeWithoutID) Descriptor added in v0.2.0

func (*MultiaccountTypeWithoutID) Descriptor() ([]byte, []int)

func (*MultiaccountTypeWithoutID) GetSomeField added in v0.2.0

func (m *MultiaccountTypeWithoutID) GetSomeField() string

func (*MultiaccountTypeWithoutID) ProtoMessage added in v0.2.0

func (*MultiaccountTypeWithoutID) ProtoMessage()

func (*MultiaccountTypeWithoutID) Reset added in v0.2.0

func (m *MultiaccountTypeWithoutID) Reset()

func (*MultiaccountTypeWithoutID) String added in v0.2.0

func (m *MultiaccountTypeWithoutID) String() string

func (*MultiaccountTypeWithoutID) ToORM added in v0.2.1

ToORM runs the BeforeToORM hook if present, converts the fields of this object to ORM format, runs the AfterToORM hook, then returns the ORM object

type MultiaccountTypeWithoutIDORM added in v0.2.0

type MultiaccountTypeWithoutIDORM struct {
	AccountID string
	SomeField string
}

func (MultiaccountTypeWithoutIDORM) TableName added in v0.2.0

TableName overrides the default tablename generated by GORM

func (*MultiaccountTypeWithoutIDORM) ToPB added in v0.2.1

ToPB runs the BeforeToPB hook if present, converts the fields of this object to PB format, runs the AfterToPB hook, then returns the PB object

type MultiaccountTypeWithoutIDWithAfterToORM added in v0.2.1

type MultiaccountTypeWithoutIDWithAfterToORM interface {
	AfterToORM(context.Context, *MultiaccountTypeWithoutIDORM) error
}

MultiaccountTypeWithoutIDAfterToORM called after default ToORM code

type MultiaccountTypeWithoutIDWithAfterToPB added in v0.2.1

type MultiaccountTypeWithoutIDWithAfterToPB interface {
	AfterToPB(context.Context, *MultiaccountTypeWithoutID) error
}

MultiaccountTypeWithoutIDAfterToPB called after default ToPB code

type MultiaccountTypeWithoutIDWithBeforeToORM added in v0.2.1

type MultiaccountTypeWithoutIDWithBeforeToORM interface {
	BeforeToORM(context.Context, *MultiaccountTypeWithoutIDORM) error
}

MultiaccountTypeWithoutIDBeforeToORM called before default ToORM code

type MultiaccountTypeWithoutIDWithBeforeToPB added in v0.2.1

type MultiaccountTypeWithoutIDWithBeforeToPB interface {
	BeforeToPB(context.Context, *MultiaccountTypeWithoutID) error
}

MultiaccountTypeWithoutIDBeforeToPB called before default ToPB code

type ReadIntPointRequest added in v0.2.0

type ReadIntPointRequest struct {
	// For a read request, the id field is the only to be specified
	Id uint32 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"`
}

func (*ReadIntPointRequest) Descriptor added in v0.2.0

func (*ReadIntPointRequest) Descriptor() ([]byte, []int)

func (*ReadIntPointRequest) GetId added in v0.2.0

func (m *ReadIntPointRequest) GetId() uint32

func (*ReadIntPointRequest) ProtoMessage added in v0.2.0

func (*ReadIntPointRequest) ProtoMessage()

func (*ReadIntPointRequest) Reset added in v0.2.0

func (m *ReadIntPointRequest) Reset()

func (*ReadIntPointRequest) String added in v0.2.0

func (m *ReadIntPointRequest) String() string

type ReadIntPointResponse added in v0.2.0

type ReadIntPointResponse struct {
	// Again the type with 'result' name
	Result *IntPoint `protobuf:"bytes,1,opt,name=result" json:"result,omitempty"`
}

func (*ReadIntPointResponse) Descriptor added in v0.2.0

func (*ReadIntPointResponse) Descriptor() ([]byte, []int)

func (*ReadIntPointResponse) GetResult added in v0.2.0

func (m *ReadIntPointResponse) GetResult() *IntPoint

func (*ReadIntPointResponse) ProtoMessage added in v0.2.0

func (*ReadIntPointResponse) ProtoMessage()

func (*ReadIntPointResponse) Reset added in v0.2.0

func (m *ReadIntPointResponse) Reset()

func (*ReadIntPointResponse) String added in v0.2.0

func (m *ReadIntPointResponse) String() string

type Something added in v0.2.0

type Something struct {
}

A dummy type to demo an rpc that can't be autogenerated

func (*Something) Descriptor added in v0.2.0

func (*Something) Descriptor() ([]byte, []int)

func (*Something) ProtoMessage added in v0.2.0

func (*Something) ProtoMessage()

func (*Something) Reset added in v0.2.0

func (m *Something) Reset()

func (*Something) String added in v0.2.0

func (m *Something) String() string

type TestTypes

type TestTypes struct {
	// the (gorm.field).drop option allows for setting a field to be API only
	ApiOnlyString string `protobuf:"bytes,1,opt,name=api_only_string,json=apiOnlyString" json:"api_only_string,omitempty"`
	// repeated raw types are currently unsupported, so this field will be dropped
	// at the ORM level
	Numbers []int32 `protobuf:"varint,2,rep,packed,name=numbers" json:"numbers,omitempty"`
	// a StringValue represents a Nullable string
	OptionalString *google_protobuf1.StringValue `protobuf:"bytes,3,opt,name=optional_string,json=optionalString" json:"optional_string,omitempty"`
	BecomesInt     TestTypesStatus               `protobuf:"varint,4,opt,name=becomes_int,json=becomesInt,enum=example.TestTypesStatus" json:"becomes_int,omitempty"`
	// The Empty type serves no purpose outside of rpc calls and is dropped
	// automatically from objects
	Nothingness *google_protobuf2.Empty `protobuf:"bytes,5,opt,name=nothingness" json:"nothingness,omitempty"`
	// 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)
	Uuid *gorm_types.UUID `protobuf:"bytes,6,opt,name=uuid" json:"uuid,omitempty"`
	// Timestamps convert to golang's time.Time type, and created_at and
	// updated_at values are automatically filled by GORM
	CreatedAt *google_protobuf3.Timestamp `protobuf:"bytes,7,opt,name=created_at,json=createdAt" json:"created_at,omitempty"`
	// This represents a foreign key to the 'type_with_id' type for associations
	// This could be hidden from the API (or soon autogenerated).
	TypeWithIdId uint32 `protobuf:"varint,8,opt,name=type_with_id_id,json=typeWithIdId" json:"type_with_id_id,omitempty"`
	// This is an arbitrary JSON string that is marshalled and unmarshalled
	// specially in grpc-gateway as a JSON object
	JsonField *gorm_types.JSONValue `protobuf:"bytes,9,opt,name=json_field,json=jsonField" json:"json_field,omitempty"`
	// 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)
	NullableUuid *gorm_types.UUIDValue `protobuf:"bytes,10,opt,name=nullable_uuid,json=nullableUuid" json:"nullable_uuid,omitempty"`
}

test_types is a message that includes a representative sample of the available types

func DefaultCreateTestTypes

func DefaultCreateTestTypes(ctx context.Context, in *TestTypes, db *gorm.DB) (*TestTypes, error)

DefaultCreateTestTypes executes a basic gorm create call

func DefaultListTestTypes

func DefaultListTestTypes(ctx context.Context, db *gorm.DB) ([]*TestTypes, error)

DefaultListTestTypes executes a gorm list call

func (*TestTypes) Descriptor

func (*TestTypes) Descriptor() ([]byte, []int)

func (*TestTypes) GetApiOnlyString

func (m *TestTypes) GetApiOnlyString() string

func (*TestTypes) GetBecomesInt

func (m *TestTypes) GetBecomesInt() TestTypesStatus

func (*TestTypes) GetCreatedAt

func (m *TestTypes) GetCreatedAt() *google_protobuf3.Timestamp

func (*TestTypes) GetJsonField added in v0.5.0

func (m *TestTypes) GetJsonField() *gorm_types.JSONValue

func (*TestTypes) GetNothingness

func (m *TestTypes) GetNothingness() *google_protobuf2.Empty

func (*TestTypes) GetNullableUuid added in v0.5.1

func (m *TestTypes) GetNullableUuid() *gorm_types.UUIDValue

func (*TestTypes) GetNumbers

func (m *TestTypes) GetNumbers() []int32

func (*TestTypes) GetOptionalString

func (m *TestTypes) GetOptionalString() *google_protobuf1.StringValue

func (*TestTypes) GetTypeWithIdId added in v0.2.0

func (m *TestTypes) GetTypeWithIdId() uint32

func (*TestTypes) GetUuid

func (m *TestTypes) GetUuid() *gorm_types.UUID

func (*TestTypes) ProtoMessage

func (*TestTypes) ProtoMessage()

func (*TestTypes) Reset

func (m *TestTypes) Reset()

func (*TestTypes) String

func (m *TestTypes) String() string

func (*TestTypes) ToORM added in v0.2.1

func (m *TestTypes) ToORM(ctx context.Context) (TestTypesORM, error)

ToORM runs the BeforeToORM hook if present, converts the fields of this object to ORM format, runs the AfterToORM hook, then returns the ORM object

type TestTypesORM

type TestTypesORM struct {
	ANestedObjectTypeWithIDId uint32
	BecomesInt                int32
	CreatedAt                 time.Time
	JsonField                 *gormpq.Jsonb
	NullableUuid              *uuid.UUID
	OptionalString            *string
	ThingsTypeWithIDId        uint32
	TypeWithIdId              uint32
	Uuid                      uuid.UUID
}

func (TestTypesORM) TableName

func (TestTypesORM) TableName() string

TableName overrides the default tablename generated by GORM

func (*TestTypesORM) ToPB added in v0.2.1

func (m *TestTypesORM) ToPB(ctx context.Context) (TestTypes, error)

ToPB runs the BeforeToPB hook if present, converts the fields of this object to PB format, runs the AfterToPB hook, then returns the PB object

type TestTypesStatus

type TestTypesStatus int32

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

const (
	TestTypes_UNKNOWN TestTypesStatus = 0
	TestTypes_GOOD    TestTypesStatus = 1
	TestTypes_BAD     TestTypesStatus = 2
)

func (TestTypesStatus) EnumDescriptor

func (TestTypesStatus) EnumDescriptor() ([]byte, []int)

func (TestTypesStatus) String

func (x TestTypesStatus) String() string

type TestTypesWithAfterToORM added in v0.2.1

type TestTypesWithAfterToORM interface {
	AfterToORM(context.Context, *TestTypesORM) error
}

TestTypesAfterToORM called after default ToORM code

type TestTypesWithAfterToPB added in v0.2.1

type TestTypesWithAfterToPB interface {
	AfterToPB(context.Context, *TestTypes) error
}

TestTypesAfterToPB called after default ToPB code

type TestTypesWithBeforeToORM added in v0.2.1

type TestTypesWithBeforeToORM interface {
	BeforeToORM(context.Context, *TestTypesORM) error
}

TestTypesBeforeToORM called before default ToORM code

type TestTypesWithBeforeToPB added in v0.2.1

type TestTypesWithBeforeToPB interface {
	BeforeToPB(context.Context, *TestTypes) error
}

TestTypesBeforeToPB called before default ToPB code

type TypeWithID added in v0.2.0

type TypeWithID struct {
	// any field named 'id' is assumed by gorm to be the primary key for the
	// object.
	Id uint32 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"`
	// 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
	Ip string `protobuf:"bytes,2,opt,name=ip" json:"ip,omitempty"`
	// 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.
	Things []*TestTypes `protobuf:"bytes,3,rep,name=things" json:"things,omitempty"`
	// A default has-one relationship, will error as above
	ANestedObject *TestTypes `protobuf:"bytes,4,opt,name=a_nested_object,json=aNestedObject" json:"a_nested_object,omitempty"`
}

TypeWithID demonstrates some basic assocation behavior

func DefaultCreateTypeWithID

func DefaultCreateTypeWithID(ctx context.Context, in *TypeWithID, db *gorm.DB) (*TypeWithID, error)

DefaultCreateTypeWithID executes a basic gorm create call

func DefaultListTypeWithID added in v0.2.0

func DefaultListTypeWithID(ctx context.Context, db *gorm.DB) ([]*TypeWithID, error)

DefaultListTypeWithID executes a gorm list call

func DefaultReadTypeWithID

func DefaultReadTypeWithID(ctx context.Context, in *TypeWithID, db *gorm.DB) (*TypeWithID, error)

DefaultReadTypeWithID executes a basic gorm read call

func DefaultStrictUpdateTypeWithID

func DefaultStrictUpdateTypeWithID(ctx context.Context, in *TypeWithID, db *gorm.DB) (*TypeWithID, error)

DefaultStrictUpdateTypeWithID clears first level 1:many children and then executes a gorm update call

func DefaultUpdateTypeWithID

func DefaultUpdateTypeWithID(ctx context.Context, in *TypeWithID, db *gorm.DB) (*TypeWithID, error)

DefaultUpdateTypeWithID executes a basic gorm update call

func (*TypeWithID) Descriptor added in v0.2.0

func (*TypeWithID) Descriptor() ([]byte, []int)

func (*TypeWithID) GetANestedObject added in v0.2.0

func (m *TypeWithID) GetANestedObject() *TestTypes

func (*TypeWithID) GetId added in v0.2.0

func (m *TypeWithID) GetId() uint32

func (*TypeWithID) GetIp added in v0.2.0

func (m *TypeWithID) GetIp() string

func (*TypeWithID) GetThings added in v0.2.0

func (m *TypeWithID) GetThings() []*TestTypes

func (*TypeWithID) ProtoMessage added in v0.2.0

func (*TypeWithID) ProtoMessage()

func (*TypeWithID) Reset added in v0.2.0

func (m *TypeWithID) Reset()

func (*TypeWithID) String added in v0.2.0

func (m *TypeWithID) String() string

func (*TypeWithID) ToORM added in v0.2.1

func (m *TypeWithID) ToORM(ctx context.Context) (TypeWithIDORM, error)

ToORM runs the BeforeToORM hook if present, converts the fields of this object to ORM format, runs the AfterToORM hook, then returns the ORM object

type TypeWithIDORM

type TypeWithIDORM struct {
	ANestedObject *TestTypesORM `gorm:"foreignkey:ANestedObjectTypeWithIDId;association_foreignkey:Id"`
	Id            uint32
	Ip            string          `gorm:"column:ip_addr"`
	SecretInt     int32           `gorm:"-"`
	Things        []*TestTypesORM `gorm:"foreignkey:ThingsTypeWithIDId;association_foreignkey:Id"`
}

func (TypeWithIDORM) TableName

func (TypeWithIDORM) TableName() string

TableName overrides the default tablename generated by GORM

func (*TypeWithIDORM) ToPB added in v0.2.1

func (m *TypeWithIDORM) ToPB(ctx context.Context) (TypeWithID, error)

ToPB runs the BeforeToPB hook if present, converts the fields of this object to PB format, runs the AfterToPB hook, then returns the PB object

type TypeWithIDWithAfterToORM added in v0.2.1

type TypeWithIDWithAfterToORM interface {
	AfterToORM(context.Context, *TypeWithIDORM) error
}

TypeWithIDAfterToORM called after default ToORM code

type TypeWithIDWithAfterToPB added in v0.2.1

type TypeWithIDWithAfterToPB interface {
	AfterToPB(context.Context, *TypeWithID) error
}

TypeWithIDAfterToPB called after default ToPB code

type TypeWithIDWithBeforeToORM added in v0.2.1

type TypeWithIDWithBeforeToORM interface {
	BeforeToORM(context.Context, *TypeWithIDORM) error
}

TypeWithIDBeforeToORM called before default ToORM code

type TypeWithIDWithBeforeToPB added in v0.2.1

type TypeWithIDWithBeforeToPB interface {
	BeforeToPB(context.Context, *TypeWithID) error
}

TypeWithIDBeforeToPB called before default ToPB code

type UpdateIntPointRequest added in v0.2.0

type UpdateIntPointRequest struct {
	Payload *IntPoint `protobuf:"bytes,1,opt,name=payload" json:"payload,omitempty"`
}

func (*UpdateIntPointRequest) Descriptor added in v0.2.0

func (*UpdateIntPointRequest) Descriptor() ([]byte, []int)

func (*UpdateIntPointRequest) GetPayload added in v0.2.0

func (m *UpdateIntPointRequest) GetPayload() *IntPoint

func (*UpdateIntPointRequest) ProtoMessage added in v0.2.0

func (*UpdateIntPointRequest) ProtoMessage()

func (*UpdateIntPointRequest) Reset added in v0.2.0

func (m *UpdateIntPointRequest) Reset()

func (*UpdateIntPointRequest) String added in v0.2.0

func (m *UpdateIntPointRequest) String() string

type UpdateIntPointResponse added in v0.2.0

type UpdateIntPointResponse struct {
	Result *IntPoint `protobuf:"bytes,1,opt,name=result" json:"result,omitempty"`
}

func (*UpdateIntPointResponse) Descriptor added in v0.2.0

func (*UpdateIntPointResponse) Descriptor() ([]byte, []int)

func (*UpdateIntPointResponse) GetResult added in v0.2.0

func (m *UpdateIntPointResponse) GetResult() *IntPoint

func (*UpdateIntPointResponse) ProtoMessage added in v0.2.0

func (*UpdateIntPointResponse) ProtoMessage()

func (*UpdateIntPointResponse) Reset added in v0.2.0

func (m *UpdateIntPointResponse) Reset()

func (*UpdateIntPointResponse) String added in v0.2.0

func (m *UpdateIntPointResponse) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL