example

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2018 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

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 DefaultDeleteMultitenantTypeWithID

func DefaultDeleteMultitenantTypeWithID(ctx context.Context, in *MultitenantTypeWithId, db *gorm.DB) error

func DefaultDeleteMultitenantTypeWithoutID

func DefaultDeleteMultitenantTypeWithoutID(ctx context.Context, in *MultitenantTypeWithoutId, db *gorm.DB) error

func DefaultDeleteTestTypes

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

func DefaultDeleteTypeBecomesEmpty

func DefaultDeleteTypeBecomesEmpty(ctx context.Context, in *TypeBecomesEmpty, db *gorm.DB) error

func DefaultDeleteTypeWithID

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

func RegisterPointServiceServer

func RegisterPointServiceServer(s *grpc.Server, srv PointServiceServer)

Types

type ApiOnlyType

type ApiOnlyType struct {
	Contents string `protobuf:"bytes,1,opt,name=contents" json:"contents,omitempty"`
}

func (*ApiOnlyType) Descriptor

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

func (*ApiOnlyType) GetContents

func (m *ApiOnlyType) GetContents() string

func (*ApiOnlyType) ProtoMessage

func (*ApiOnlyType) ProtoMessage()

func (*ApiOnlyType) Reset

func (m *ApiOnlyType) Reset()

func (*ApiOnlyType) String

func (m *ApiOnlyType) 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"`
}

func ConvertIntPointFromORM

func ConvertIntPointFromORM(from IntPointORM) (IntPoint, error)

ConvertIntPointFromORM takes an orm object and returns a pb object

func DefaultCreateIntPoint

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

//////////////////////// CURDL for objects 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

type IntPointORM

type IntPointORM struct {
	ID uint32
	X  int32
	Y  int32
}

IntPointORM no comment was provided for message type

func ConvertIntPointToORM

func ConvertIntPointToORM(from IntPoint) (IntPointORM, error)

ConvertIntPointToORM takes a pb object and returns an orm object

func (IntPointORM) TableName

func (IntPointORM) TableName() string

TableName overrides the default tablename generated by GORM

type MultitenantTypeWithIDORM

type MultitenantTypeWithIDORM struct {
	TenantID  string
	ID        uint64
	SomeField string
}

MultitenantTypeWithIDORM no comment was provided for message type

func ConvertMultitenantTypeWithIDToORM

func ConvertMultitenantTypeWithIDToORM(from MultitenantTypeWithId) (MultitenantTypeWithIDORM, error)

ConvertMultitenantTypeWithIDToORM takes a pb object and returns an orm object

func (MultitenantTypeWithIDORM) TableName

func (MultitenantTypeWithIDORM) TableName() string

TableName overrides the default tablename generated by GORM

type MultitenantTypeWithId

type MultitenantTypeWithId 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"`
}

func ConvertMultitenantTypeWithIDFromORM

func ConvertMultitenantTypeWithIDFromORM(from MultitenantTypeWithIDORM) (MultitenantTypeWithId, error)

ConvertMultitenantTypeWithIDFromORM takes an orm object and returns a pb object

func DefaultCreateMultitenantTypeWithID

func DefaultCreateMultitenantTypeWithID(ctx context.Context, in *MultitenantTypeWithId, db *gorm.DB) (*MultitenantTypeWithId, error)

DefaultCreateMultitenantTypeWithID executes a basic gorm create call

func DefaultReadMultitenantTypeWithID

func DefaultReadMultitenantTypeWithID(ctx context.Context, in *MultitenantTypeWithId, db *gorm.DB) (*MultitenantTypeWithId, error)

DefaultReadMultitenantTypeWithID executes a basic gorm read call

func DefaultStrictUpdateMultitenantTypeWithID

func DefaultStrictUpdateMultitenantTypeWithID(ctx context.Context, in *MultitenantTypeWithId, db *gorm.DB) (*MultitenantTypeWithId, error)

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

func DefaultUpdateMultitenantTypeWithID

func DefaultUpdateMultitenantTypeWithID(ctx context.Context, in *MultitenantTypeWithId, db *gorm.DB) (*MultitenantTypeWithId, error)

DefaultUpdateMultitenantTypeWithID executes a basic gorm update call

func (*MultitenantTypeWithId) Descriptor

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

func (*MultitenantTypeWithId) GetId

func (m *MultitenantTypeWithId) GetId() uint64

func (*MultitenantTypeWithId) GetSomeField

func (m *MultitenantTypeWithId) GetSomeField() string

func (*MultitenantTypeWithId) ProtoMessage

func (*MultitenantTypeWithId) ProtoMessage()

func (*MultitenantTypeWithId) Reset

func (m *MultitenantTypeWithId) Reset()

func (*MultitenantTypeWithId) String

func (m *MultitenantTypeWithId) String() string

type MultitenantTypeWithoutIDORM

type MultitenantTypeWithoutIDORM struct {
	TenantID  string
	SomeField string
}

MultitenantTypeWithoutIDORM no comment was provided for message type

func ConvertMultitenantTypeWithoutIDToORM

func ConvertMultitenantTypeWithoutIDToORM(from MultitenantTypeWithoutId) (MultitenantTypeWithoutIDORM, error)

ConvertMultitenantTypeWithoutIDToORM takes a pb object and returns an orm object

func (MultitenantTypeWithoutIDORM) TableName

func (MultitenantTypeWithoutIDORM) TableName() string

TableName overrides the default tablename generated by GORM

type MultitenantTypeWithoutId

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

func ConvertMultitenantTypeWithoutIDFromORM

func ConvertMultitenantTypeWithoutIDFromORM(from MultitenantTypeWithoutIDORM) (MultitenantTypeWithoutId, error)

ConvertMultitenantTypeWithoutIDFromORM takes an orm object and returns a pb object

func DefaultCreateMultitenantTypeWithoutID

func DefaultCreateMultitenantTypeWithoutID(ctx context.Context, in *MultitenantTypeWithoutId, db *gorm.DB) (*MultitenantTypeWithoutId, error)

DefaultCreateMultitenantTypeWithoutID executes a basic gorm create call

func DefaultReadMultitenantTypeWithoutID

func DefaultReadMultitenantTypeWithoutID(ctx context.Context, in *MultitenantTypeWithoutId, db *gorm.DB) (*MultitenantTypeWithoutId, error)

DefaultReadMultitenantTypeWithoutID executes a basic gorm read call

func DefaultStrictUpdateMultitenantTypeWithoutID

func DefaultStrictUpdateMultitenantTypeWithoutID(ctx context.Context, in *MultitenantTypeWithoutId, db *gorm.DB) (*MultitenantTypeWithoutId, error)

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

func (*MultitenantTypeWithoutId) Descriptor

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

func (*MultitenantTypeWithoutId) GetSomeField

func (m *MultitenantTypeWithoutId) GetSomeField() string

func (*MultitenantTypeWithoutId) ProtoMessage

func (*MultitenantTypeWithoutId) ProtoMessage()

func (*MultitenantTypeWithoutId) Reset

func (m *MultitenantTypeWithoutId) Reset()

func (*MultitenantTypeWithoutId) String

func (m *MultitenantTypeWithoutId) String() string

type PointServiceClient

type PointServiceClient interface {
	CreateIntPoint(ctx context.Context, in *IntPoint, opts ...grpc.CallOption) (*IntPoint, error)
	ReadIntPoint(ctx context.Context, in *IntPoint, opts ...grpc.CallOption) (*IntPoint, error)
	UpdateIntPoint(ctx context.Context, in *IntPoint, opts ...grpc.CallOption) (*IntPoint, error)
}

func NewPointServiceClient

func NewPointServiceClient(cc *grpc.ClientConn) PointServiceClient

type PointServiceServer

type PointServiceServer interface {
	CreateIntPoint(context.Context, *IntPoint) (*IntPoint, error)
	ReadIntPoint(context.Context, *IntPoint) (*IntPoint, error)
	UpdateIntPoint(context.Context, *IntPoint) (*IntPoint, error)
}

type TestTypes

type TestTypes struct {
	ApiOnlyString  string                        `protobuf:"bytes,1,opt,name=api_only_string,json=apiOnlyString" json:"api_only_string,omitempty"`
	Numbers        []int32                       `protobuf:"varint,2,rep,packed,name=numbers" json:"numbers,omitempty"`
	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"`
	Nothingness    *google_protobuf2.Empty       `protobuf:"bytes,5,opt,name=nothingness" json:"nothingness,omitempty"`
	Uuid           *gormable_types.UUIDValue     `protobuf:"bytes,6,opt,name=uuid" json:"uuid,omitempty"`
	CreatedAt      *google_protobuf3.Timestamp   `protobuf:"bytes,7,opt,name=created_at,json=createdAt" json:"created_at,omitempty"`
}

test_types is a message that serves as an example

func ConvertTestTypesFromORM

func ConvertTestTypesFromORM(from TestTypesORM) (TestTypes, error)

ConvertTestTypesFromORM takes an orm object and returns a pb object

func DefaultCreateTestTypes

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

//////////////////////// CURDL for objects 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 DefaultReadTestTypes

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

DefaultReadTestTypes executes a basic gorm read call

func DefaultStrictUpdateTestTypes

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

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

func DefaultUpdateTestTypes

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

DefaultUpdateTestTypes executes a basic gorm update 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) GetNothingness

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

func (*TestTypes) GetNumbers

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

func (*TestTypes) GetOptionalString

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

func (*TestTypes) GetUuid

func (m *TestTypes) GetUuid() *gormable_types.UUIDValue

func (*TestTypes) ProtoMessage

func (*TestTypes) ProtoMessage()

func (*TestTypes) Reset

func (m *TestTypes) Reset()

func (*TestTypes) String

func (m *TestTypes) String() string

type TestTypesORM

type TestTypesORM struct {
	// Skipping field from proto option: ApiOnlyString
	// The non-ORMable repeated field "Numbers" can't be included
	OptionalString *string
	BecomesInt     int32
	// Empty type has no ORM equivalency
	UUID      uuid.UUID `sql:"type:uuid"`
	CreatedAt time.Time
}

TestTypesORM is a message that serves as an example

func ConvertTestTypesToORM

func ConvertTestTypesToORM(from TestTypes) (TestTypesORM, error)

ConvertTestTypesToORM takes a pb object and returns an orm object

func (TestTypesORM) TableName

func (TestTypesORM) TableName() string

TableName overrides the default tablename generated by GORM

type TestTypesStatus

type TestTypesStatus int32
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 TypeBecomesEmpty

type TypeBecomesEmpty struct {
	AThing *ApiOnlyType `protobuf:"bytes,1,opt,name=a_thing,json=aThing" json:"a_thing,omitempty"`
}

func ConvertTypeBecomesEmptyFromORM

func ConvertTypeBecomesEmptyFromORM(from TypeBecomesEmptyORM) (TypeBecomesEmpty, error)

ConvertTypeBecomesEmptyFromORM takes an orm object and returns a pb object

func DefaultCreateTypeBecomesEmpty

func DefaultCreateTypeBecomesEmpty(ctx context.Context, in *TypeBecomesEmpty, db *gorm.DB) (*TypeBecomesEmpty, error)

DefaultCreateTypeBecomesEmpty executes a basic gorm create call

func DefaultListTypeBecomesEmpty

func DefaultListTypeBecomesEmpty(ctx context.Context, db *gorm.DB) ([]*TypeBecomesEmpty, error)

DefaultListTypeBecomesEmpty executes a gorm list call

func DefaultReadTypeBecomesEmpty

func DefaultReadTypeBecomesEmpty(ctx context.Context, in *TypeBecomesEmpty, db *gorm.DB) (*TypeBecomesEmpty, error)

DefaultReadTypeBecomesEmpty executes a basic gorm read call

func DefaultStrictUpdateTypeBecomesEmpty

func DefaultStrictUpdateTypeBecomesEmpty(ctx context.Context, in *TypeBecomesEmpty, db *gorm.DB) (*TypeBecomesEmpty, error)

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

func DefaultUpdateTypeBecomesEmpty

func DefaultUpdateTypeBecomesEmpty(ctx context.Context, in *TypeBecomesEmpty, db *gorm.DB) (*TypeBecomesEmpty, error)

DefaultUpdateTypeBecomesEmpty executes a basic gorm update call

func (*TypeBecomesEmpty) Descriptor

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

func (*TypeBecomesEmpty) GetAThing

func (m *TypeBecomesEmpty) GetAThing() *ApiOnlyType

func (*TypeBecomesEmpty) ProtoMessage

func (*TypeBecomesEmpty) ProtoMessage()

func (*TypeBecomesEmpty) Reset

func (m *TypeBecomesEmpty) Reset()

func (*TypeBecomesEmpty) String

func (m *TypeBecomesEmpty) String() string

type TypeBecomesEmptyORM

type TypeBecomesEmptyORM struct {
}

TypeBecomesEmptyORM no comment was provided for message type

func ConvertTypeBecomesEmptyToORM

func ConvertTypeBecomesEmptyToORM(from TypeBecomesEmpty) (TypeBecomesEmptyORM, error)

ConvertTypeBecomesEmptyToORM takes a pb object and returns an orm object

func (TypeBecomesEmptyORM) TableName

func (TypeBecomesEmptyORM) TableName() string

TableName overrides the default tablename generated by GORM

type TypeWithIDORM

type TypeWithIDORM struct {
	UUID          int32           `gorm:"primary_key"`
	IP            string          `gorm:"ip_addr"`
	Things        []*TestTypesORM `gorm:"foreignkey:TypeWithIDID"`
	ANestedObject *TestTypesORM   `gorm:"foreignkey:TypeWithIDID"`
}

TypeWithIDORM no comment was provided for message type

func ConvertTypeWithIDToORM

func ConvertTypeWithIDToORM(from TypeWithId) (TypeWithIDORM, error)

ConvertTypeWithIDToORM takes a pb object and returns an orm object

func (TypeWithIDORM) TableName

func (TypeWithIDORM) TableName() string

TableName overrides the default tablename generated by GORM

type TypeWithId

type TypeWithId struct {
	Ip            string       `protobuf:"bytes,1,opt,name=ip" json:"ip,omitempty"`
	Things        []*TestTypes `protobuf:"bytes,3,rep,name=things" json:"things,omitempty"`
	ANestedObject *TestTypes   `protobuf:"bytes,4,opt,name=a_nested_object,json=aNestedObject" json:"a_nested_object,omitempty"`
}

func ConvertTypeWithIDFromORM

func ConvertTypeWithIDFromORM(from TypeWithIDORM) (TypeWithId, error)

ConvertTypeWithIDFromORM takes an orm object and returns a pb object

func DefaultCreateTypeWithID

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

DefaultCreateTypeWithID executes a basic gorm create 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

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

func (*TypeWithId) GetANestedObject

func (m *TypeWithId) GetANestedObject() *TestTypes

func (*TypeWithId) GetIp

func (m *TypeWithId) GetIp() string

func (*TypeWithId) GetThings

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

func (*TypeWithId) ProtoMessage

func (*TypeWithId) ProtoMessage()

func (*TypeWithId) Reset

func (m *TypeWithId) Reset()

func (*TypeWithId) String

func (m *TypeWithId) String() string

Jump to

Keyboard shortcuts

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