Documentation ¶
Index ¶
- Variables
- func DeleteAddressGormModels(ctx context.Context, tx *gorm.DB, ids []string) error
- func DeleteCommentGormModels(ctx context.Context, tx *gorm.DB, ids []string) error
- func DeleteCompanyGormModels(ctx context.Context, tx *gorm.DB, ids []string) error
- func DeleteProfileGormModels(ctx context.Context, tx *gorm.DB, ids []string) error
- func DeleteUserGormModels(ctx context.Context, tx *gorm.DB, ids []string) error
- type Address
- func (*Address) Descriptor() ([]byte, []int)deprecated
- func (x *Address) GetCompanyBlob() *Company
- func (x *Address) GetCreatedAt() *timestamppb.Timestamp
- func (x *Address) GetName() string
- func (x *Address) GetSid() string
- func (x *Address) GetUpdatedAt() *timestamppb.Timestamp
- func (x *Address) GetUser() *User
- func (x *Address) GetUserId() string
- func (msg *Address) MarshalJSON() ([]byte, error)
- func (*Address) ProtoMessage()
- func (x *Address) ProtoReflect() protoreflect.Message
- func (x *Address) Reset()
- func (x *Address) String() string
- func (p *Address) ToModel() (theModel *AddressGormModel, err error)
- func (msg *Address) UnmarshalJSON(b []byte) error
- type AddressGormModel
- type AddressGormModels
- type AddressProtos
- func (p *AddressProtos) GetByIds(ctx context.Context, tx *gorm.DB, ids []string, preloads ...string) (err error)
- func (p *AddressProtos) List(ctx context.Context, tx *gorm.DB, limit, offset int, order interface{}, ...) (err error)
- func (p AddressProtos) ToModels() (models AddressGormModels, err error)
- func (p *AddressProtos) Upsert(ctx context.Context, tx *gorm.DB) (models AddressGormModels, err error)
- type Comment
- func (*Comment) Descriptor() ([]byte, []int)deprecated
- func (x *Comment) GetCreatedAt() *timestamppb.Timestamp
- func (x *Comment) GetName() string
- func (x *Comment) GetSid() string
- func (x *Comment) GetUpdatedAt() *timestamppb.Timestamp
- func (x *Comment) GetUser() *User
- func (msg *Comment) MarshalJSON() ([]byte, error)
- func (*Comment) ProtoMessage()
- func (x *Comment) ProtoReflect() protoreflect.Message
- func (x *Comment) Reset()
- func (x *Comment) String() string
- func (p *Comment) ToModel() (theModel *CommentGormModel, err error)
- func (msg *Comment) UnmarshalJSON(b []byte) error
- type CommentGormModel
- type CommentGormModels
- type CommentProtos
- func (p *CommentProtos) GetByIds(ctx context.Context, tx *gorm.DB, ids []string, preloads ...string) (err error)
- func (p *CommentProtos) List(ctx context.Context, tx *gorm.DB, limit, offset int, order interface{}, ...) (err error)
- func (p CommentProtos) ToModels() (models CommentGormModels, err error)
- func (p *CommentProtos) Upsert(ctx context.Context, tx *gorm.DB) (models CommentGormModels, err error)
- type Company
- func (*Company) Descriptor() ([]byte, []int)deprecated
- func (x *Company) GetCreatedAt() *timestamppb.Timestamp
- func (x *Company) GetName() string
- func (x *Company) GetSid() string
- func (x *Company) GetUpdatedAt() *timestamppb.Timestamp
- func (msg *Company) MarshalJSON() ([]byte, error)
- func (*Company) ProtoMessage()
- func (x *Company) ProtoReflect() protoreflect.Message
- func (x *Company) Reset()
- func (x *Company) String() string
- func (p *Company) ToModel() (theModel *CompanyGormModel, err error)
- func (msg *Company) UnmarshalJSON(b []byte) error
- type CompanyGormModel
- type CompanyGormModels
- type CompanyProtos
- func (p *CompanyProtos) GetByIds(ctx context.Context, tx *gorm.DB, ids []string, preloads ...string) (err error)
- func (p *CompanyProtos) List(ctx context.Context, tx *gorm.DB, limit, offset int, order interface{}, ...) (err error)
- func (p CompanyProtos) ToModels() (models CompanyGormModels, err error)
- func (p *CompanyProtos) Upsert(ctx context.Context, tx *gorm.DB) (models CompanyGormModels, err error)
- type EnumOne
- type Profile
- func (*Profile) Descriptor() ([]byte, []int)deprecated
- func (x *Profile) GetCreatedAt() *timestamppb.Timestamp
- func (x *Profile) GetName() string
- func (x *Profile) GetSid() string
- func (x *Profile) GetUpdatedAt() *timestamppb.Timestamp
- func (msg *Profile) MarshalJSON() ([]byte, error)
- func (*Profile) ProtoMessage()
- func (x *Profile) ProtoReflect() protoreflect.Message
- func (x *Profile) Reset()
- func (x *Profile) String() string
- func (p *Profile) ToModel() (theModel *ProfileGormModel, err error)
- func (msg *Profile) UnmarshalJSON(b []byte) error
- type ProfileGormModel
- type ProfileGormModels
- type ProfileProtos
- func (p *ProfileProtos) GetByIds(ctx context.Context, tx *gorm.DB, ids []string, preloads ...string) (err error)
- func (p *ProfileProtos) List(ctx context.Context, tx *gorm.DB, limit, offset int, order interface{}, ...) (err error)
- func (p ProfileProtos) ToModels() (models ProfileGormModels, err error)
- func (p *ProfileProtos) Upsert(ctx context.Context, tx *gorm.DB) (models ProfileGormModels, err error)
- type User
- func (*User) Descriptor() ([]byte, []int)deprecated
- func (x *User) GetABool() bool
- func (x *User) GetABytes() []byte
- func (x *User) GetADouble() float64
- func (x *User) GetAFloat() float32
- func (x *User) GetAString() string
- func (x *User) GetAStructpb() *structpb.Struct
- func (x *User) GetAddress() *Address
- func (x *User) GetAnInt32() int32
- func (x *User) GetAnInt64() int64
- func (x *User) GetAnUnexpectedId() string
- func (x *User) GetBools() []bool
- func (x *User) GetBytess() [][]byte
- func (x *User) GetComments() []*Comment
- func (x *User) GetCompany() *Company
- func (x *User) GetCompanyThree() *Company
- func (x *User) GetCompanyTwo() *Company
- func (x *User) GetCompanyTwoId() string
- func (x *User) GetCreatedAt() string
- func (x *User) GetDate() string
- func (x *User) GetDoubles() []float64
- func (x *User) GetFloats() []float32
- func (x *User) GetInt32S() []int32
- func (x *User) GetInt64S() []int64
- func (x *User) GetIntEnum() EnumOne
- func (x *User) GetIntEnumList() []EnumOne
- func (x *User) GetOptionalDate() string
- func (x *User) GetOptionalScalarField() string
- func (x *User) GetProfiles() []*Profile
- func (x *User) GetSid() string
- func (x *User) GetSomeTimestamp() *timestamppb.Timestamp
- func (x *User) GetStringEnum() EnumOne
- func (x *User) GetStringEnumList() []EnumOne
- func (x *User) GetStrings() []string
- func (x *User) GetUpdatedAt() *timestamppb.Timestamp
- func (msg *User) MarshalJSON() ([]byte, error)
- func (*User) ProtoMessage()
- func (x *User) ProtoReflect() protoreflect.Message
- func (x *User) Reset()
- func (x *User) String() string
- func (p *User) ToModel() (theModel *UserGormModel, err error)
- func (msg *User) UnmarshalJSON(b []byte) error
- type UserGormModel
- type UserGormModels
- type UserProtos
- func (p *UserProtos) GetByIds(ctx context.Context, tx *gorm.DB, ids []string, preloads ...string) (err error)
- func (p *UserProtos) List(ctx context.Context, tx *gorm.DB, limit, offset int, order interface{}, ...) (err error)
- func (p UserProtos) ToModels() (models UserGormModels, err error)
- func (p *UserProtos) Upsert(ctx context.Context, tx *gorm.DB) (models UserGormModels, err error)
Constants ¶
This section is empty.
Variables ¶
var ( EnumOne_name = map[int32]string{ 0: "Default", 1: "One", 2: "Two", 3: "Three", 4: "Four", 5: "Five", 6: "Six", 7: "Seven", 8: "Eight", 9: "Nine", } EnumOne_value = map[string]int32{ "Default": 0, "One": 1, "Two": 2, "Three": 3, "Four": 4, "Five": 5, "Six": 6, "Seven": 7, "Eight": 8, "Nine": 9, } )
Enum value maps for EnumOne.
var File_mysql_example_proto protoreflect.FileDescriptor
Functions ¶
func DeleteAddressGormModels ¶
func DeleteCommentGormModels ¶
func DeleteCompanyGormModels ¶
func DeleteProfileGormModels ¶
Types ¶
type Address ¶
type Address struct { // @gotags: fake:"skip" Sid string `protobuf:"bytes,1,opt,name=sid,proto3" json:"sid,omitempty"` // @gotags: fake:"skip" CreatedAt *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // @gotags: fake:"skip" UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` // @gotags: fake:"{name}" Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` // @gotags: fake:"skip" UserId *string `protobuf:"bytes,5,opt,name=user_id,json=userId,proto3,oneof" json:"user_id,omitempty"` // @gotags: fake:"skip" User *User `protobuf:"bytes,6,opt,name=user,proto3" json:"user,omitempty"` // @gotags: fake:"skip" CompanyBlob *Company `protobuf:"bytes,7,opt,name=companyBlob,proto3" json:"companyBlob,omitempty"` // contains filtered or unexported fields }
func (*Address) Descriptor
deprecated
func (*Address) GetCompanyBlob ¶
func (*Address) GetCreatedAt ¶
func (x *Address) GetCreatedAt() *timestamppb.Timestamp
func (*Address) GetUpdatedAt ¶
func (x *Address) GetUpdatedAt() *timestamppb.Timestamp
func (*Address) MarshalJSON ¶
MarshalJSON implements json.Marshaler
func (*Address) ProtoMessage ¶
func (*Address) ProtoMessage()
func (*Address) ProtoReflect ¶
func (x *Address) ProtoReflect() protoreflect.Message
func (*Address) ToModel ¶
func (p *Address) ToModel() (theModel *AddressGormModel, err error)
func (*Address) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler
type AddressGormModel ¶
type AddressGormModel struct { // @gotags: fake:"skip" Sid string `gorm:"primaryKey;size:34" json:"sid" fake:"skip"` // @gotags: fake:"skip" CreatedAt *time.Time `gorm:"type:timestamp;" json:"createdAt" fake:"skip"` // @gotags: fake:"skip" UpdatedAt *time.Time `gorm:"type:timestamp;" json:"updatedAt" fake:"skip"` // @gotags: fake:"{name}" Name string `json:"name" fake:"{name}"` // @gotags: fake:"skip" UserId *string `json:"userId" fake:"skip"` UserSid *string `gorm:"size:34"` // @gotags: fake:"skip" User *UserGormModel `gorm:"foreignKey:UserSid;references:sid;constraint:OnDelete:CASCADE;" json:"user" fake:"skip"` // @gotags: fake:"skip" CompanyBlob gorm_jsonb.JSONB `gorm:"type:jsonb" json:"companyBlob" fake:"skip"` }
func (*AddressGormModel) TableName ¶
func (m *AddressGormModel) TableName() string
func (*AddressGormModel) ToProto ¶
func (m *AddressGormModel) ToProto() (theProto *Address, err error)
type AddressGormModels ¶
type AddressGormModels []*AddressGormModel
func (AddressGormModels) GetByModelIds ¶
func (AddressGormModels) ToProtos ¶
func (m AddressGormModels) ToProtos() (protos AddressProtos, err error)
type AddressProtos ¶
type AddressProtos []*Address
func (AddressProtos) ToModels ¶
func (p AddressProtos) ToModels() (models AddressGormModels, err error)
func (*AddressProtos) Upsert ¶
func (p *AddressProtos) Upsert(ctx context.Context, tx *gorm.DB) (models AddressGormModels, err error)
Upsert creates the protos using an on conflict clause to do updates. This function does not update *any* associations use gorm's association mode functions to update associations as you see fit after calling upsert. See https://gorm.io/docs/associations.html#Replace-Associations
type Comment ¶
type Comment struct { // @gotags: fake:"skip" Sid string `protobuf:"bytes,1,opt,name=sid,proto3" json:"sid,omitempty"` // @gotags: fake:"skip" CreatedAt *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // @gotags: fake:"skip" UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` // @gotags: fake:"{name}" Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` // @gotags: fake:"skip" User *User `protobuf:"bytes,5,opt,name=user,proto3" json:"user,omitempty"` // contains filtered or unexported fields }
func (*Comment) Descriptor
deprecated
func (*Comment) GetCreatedAt ¶
func (x *Comment) GetCreatedAt() *timestamppb.Timestamp
func (*Comment) GetUpdatedAt ¶
func (x *Comment) GetUpdatedAt() *timestamppb.Timestamp
func (*Comment) MarshalJSON ¶
MarshalJSON implements json.Marshaler
func (*Comment) ProtoMessage ¶
func (*Comment) ProtoMessage()
func (*Comment) ProtoReflect ¶
func (x *Comment) ProtoReflect() protoreflect.Message
func (*Comment) ToModel ¶
func (p *Comment) ToModel() (theModel *CommentGormModel, err error)
func (*Comment) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler
type CommentGormModel ¶
type CommentGormModel struct { // @gotags: fake:"skip" Sid string `gorm:"primaryKey;size:34" json:"sid" fake:"skip"` // @gotags: fake:"skip" CreatedAt *time.Time `gorm:"type:timestamp;" json:"createdAt" fake:"skip"` // @gotags: fake:"skip" UpdatedAt *time.Time `gorm:"type:timestamp;" json:"updatedAt" fake:"skip"` // @gotags: fake:"{name}" Name string `json:"name" fake:"{name}"` UserSid *string `gorm:"size:34"` // @gotags: fake:"skip" User *UserGormModel `gorm:"foreignKey:UserSid;references:sid;constraint:OnDelete:CASCADE;" json:"user" fake:"skip"` }
func (*CommentGormModel) TableName ¶
func (m *CommentGormModel) TableName() string
func (*CommentGormModel) ToProto ¶
func (m *CommentGormModel) ToProto() (theProto *Comment, err error)
type CommentGormModels ¶
type CommentGormModels []*CommentGormModel
func (CommentGormModels) GetByModelIds ¶
func (CommentGormModels) ToProtos ¶
func (m CommentGormModels) ToProtos() (protos CommentProtos, err error)
type CommentProtos ¶
type CommentProtos []*Comment
func (CommentProtos) ToModels ¶
func (p CommentProtos) ToModels() (models CommentGormModels, err error)
func (*CommentProtos) Upsert ¶
func (p *CommentProtos) Upsert(ctx context.Context, tx *gorm.DB) (models CommentGormModels, err error)
Upsert creates the protos using an on conflict clause to do updates. This function does not update *any* associations use gorm's association mode functions to update associations as you see fit after calling upsert. See https://gorm.io/docs/associations.html#Replace-Associations
type Company ¶
type Company struct { // @gotags: fake:"skip" Sid string `protobuf:"bytes,1,opt,name=sid,proto3" json:"sid,omitempty"` // @gotags: fake:"skip" CreatedAt *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // @gotags: fake:"skip" UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` // @gotags: fake:"{name}" Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
func (*Company) Descriptor
deprecated
func (*Company) GetCreatedAt ¶
func (x *Company) GetCreatedAt() *timestamppb.Timestamp
func (*Company) GetUpdatedAt ¶
func (x *Company) GetUpdatedAt() *timestamppb.Timestamp
func (*Company) MarshalJSON ¶
MarshalJSON implements json.Marshaler
func (*Company) ProtoMessage ¶
func (*Company) ProtoMessage()
func (*Company) ProtoReflect ¶
func (x *Company) ProtoReflect() protoreflect.Message
func (*Company) ToModel ¶
func (p *Company) ToModel() (theModel *CompanyGormModel, err error)
func (*Company) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler
type CompanyGormModel ¶
type CompanyGormModel struct { // @gotags: fake:"skip" Sid string `gorm:"primaryKey;size:34" json:"sid" fake:"skip"` // @gotags: fake:"skip" CreatedAt *time.Time `gorm:"type:timestamp;" json:"createdAt" fake:"skip"` // @gotags: fake:"skip" UpdatedAt *time.Time `gorm:"type:timestamp;" json:"updatedAt" fake:"skip"` // @gotags: fake:"{name}" Name string `json:"name" fake:"{name}"` }
func (*CompanyGormModel) TableName ¶
func (m *CompanyGormModel) TableName() string
func (*CompanyGormModel) ToProto ¶
func (m *CompanyGormModel) ToProto() (theProto *Company, err error)
type CompanyGormModels ¶
type CompanyGormModels []*CompanyGormModel
func (CompanyGormModels) GetByModelIds ¶
func (CompanyGormModels) ToProtos ¶
func (m CompanyGormModels) ToProtos() (protos CompanyProtos, err error)
type CompanyProtos ¶
type CompanyProtos []*Company
func (CompanyProtos) ToModels ¶
func (p CompanyProtos) ToModels() (models CompanyGormModels, err error)
func (*CompanyProtos) Upsert ¶
func (p *CompanyProtos) Upsert(ctx context.Context, tx *gorm.DB) (models CompanyGormModels, err error)
Upsert creates the protos using an on conflict clause to do updates. This function does not update *any* associations use gorm's association mode functions to update associations as you see fit after calling upsert. See https://gorm.io/docs/associations.html#Replace-Associations
type EnumOne ¶
type EnumOne int32
func (EnumOne) Descriptor ¶
func (EnumOne) Descriptor() protoreflect.EnumDescriptor
func (EnumOne) EnumDescriptor
deprecated
func (EnumOne) Number ¶
func (x EnumOne) Number() protoreflect.EnumNumber
func (EnumOne) Type ¶
func (EnumOne) Type() protoreflect.EnumType
type Profile ¶
type Profile struct { // @gotags: fake:"skip" Sid string `protobuf:"bytes,1,opt,name=sid,proto3" json:"sid,omitempty"` // @gotags: fake:"skip" CreatedAt *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // @gotags: fake:"skip" UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` // @gotags: fake:"{name}" Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
func (*Profile) Descriptor
deprecated
func (*Profile) GetCreatedAt ¶
func (x *Profile) GetCreatedAt() *timestamppb.Timestamp
func (*Profile) GetUpdatedAt ¶
func (x *Profile) GetUpdatedAt() *timestamppb.Timestamp
func (*Profile) MarshalJSON ¶
MarshalJSON implements json.Marshaler
func (*Profile) ProtoMessage ¶
func (*Profile) ProtoMessage()
func (*Profile) ProtoReflect ¶
func (x *Profile) ProtoReflect() protoreflect.Message
func (*Profile) ToModel ¶
func (p *Profile) ToModel() (theModel *ProfileGormModel, err error)
func (*Profile) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler
type ProfileGormModel ¶
type ProfileGormModel struct { // @gotags: fake:"skip" Sid string `gorm:"primaryKey;size:34" json:"sid" fake:"skip"` // @gotags: fake:"skip" CreatedAt *time.Time `gorm:"type:timestamp;" json:"createdAt" fake:"skip"` // @gotags: fake:"skip" UpdatedAt *time.Time `gorm:"type:timestamp;" json:"updatedAt" fake:"skip"` // @gotags: fake:"{name}" Name string `json:"name" fake:"{name}"` }
func (*ProfileGormModel) TableName ¶
func (m *ProfileGormModel) TableName() string
func (*ProfileGormModel) ToProto ¶
func (m *ProfileGormModel) ToProto() (theProto *Profile, err error)
type ProfileGormModels ¶
type ProfileGormModels []*ProfileGormModel
func (ProfileGormModels) GetByModelIds ¶
func (ProfileGormModels) ToProtos ¶
func (m ProfileGormModels) ToProtos() (protos ProfileProtos, err error)
type ProfileProtos ¶
type ProfileProtos []*Profile
func (ProfileProtos) ToModels ¶
func (p ProfileProtos) ToModels() (models ProfileGormModels, err error)
func (*ProfileProtos) Upsert ¶
func (p *ProfileProtos) Upsert(ctx context.Context, tx *gorm.DB) (models ProfileGormModels, err error)
Upsert creates the protos using an on conflict clause to do updates. This function does not update *any* associations use gorm's association mode functions to update associations as you see fit after calling upsert. See https://gorm.io/docs/associations.html#Replace-Associations
type User ¶
type User struct { // @gotags: fake:"skip" Sid string `protobuf:"bytes,1,opt,name=sid,proto3" json:"sid,omitempty"` // @gotags: fake:"skip" CreatedAt string `protobuf:"bytes,2,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // @gotags: fake:"skip" UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` // @gotags: fake:"{price:0.00,1000.00}" ADouble float64 `protobuf:"fixed64,4,opt,name=a_double,json=aDouble,proto3" json:"a_double,omitempty"` // @gotags: fake:"{price:0.00,1000.00}" AFloat float32 `protobuf:"fixed32,5,opt,name=a_float,json=aFloat,proto3" json:"a_float,omitempty"` // @gotags: fake:"{int32}" AnInt32 int32 `protobuf:"varint,6,opt,name=an_int32,json=anInt32,proto3" json:"an_int32,omitempty"` // @gotags: fake:"{number:9223372036854775807}" AnInt64 int64 `protobuf:"varint,7,opt,name=an_int64,json=anInt64,proto3" json:"an_int64,omitempty"` // @gotags: fake:"{bool}" ABool bool `protobuf:"varint,16,opt,name=a_bool,json=aBool,proto3" json:"a_bool,omitempty"` // @gotags: fake:"{hackerphrase}" AString string `protobuf:"bytes,17,opt,name=a_string,json=aString,proto3" json:"a_string,omitempty"` // @gotags: fake:"skip" ABytes []byte `protobuf:"bytes,18,opt,name=a_bytes,json=aBytes,proto3" json:"a_bytes,omitempty"` // @gotags: fake:"{price:0.00,1000.00}" Doubles []float64 `protobuf:"fixed64,19,rep,packed,name=doubles,proto3" json:"doubles,omitempty"` // @gotags: fake:"{price:0.00,1000.00}" Floats []float32 `protobuf:"fixed32,20,rep,packed,name=floats,proto3" json:"floats,omitempty"` // @gotags: fake:"{int32}" Int32S []int32 `protobuf:"varint,21,rep,packed,name=int32s,proto3" json:"int32s,omitempty"` // @gotags: fake:"{number:9223372036854775807}" Int64S []int64 `protobuf:"varint,22,rep,packed,name=int64s,proto3" json:"int64s,omitempty"` // @gotags: fake:"{bool}" Bools []bool `protobuf:"varint,31,rep,packed,name=bools,proto3" json:"bools,omitempty"` // @gotags: fake:"{hackerphrase}" Strings []string `protobuf:"bytes,32,rep,name=strings,proto3" json:"strings,omitempty"` // @gotags: fake:"skip" Bytess [][]byte `protobuf:"bytes,33,rep,name=bytess,proto3" json:"bytess,omitempty"` // @gotags: fake:"skip" OptionalScalarField *string `` /* 127-byte string literal not displayed */ // @gotags: fake:"skip" AStructpb *structpb.Struct `protobuf:"bytes,35,opt,name=a_structpb,json=aStructpb,proto3" json:"a_structpb,omitempty"` // @gotags: fake:"skip" Company *Company `protobuf:"bytes,36,opt,name=company,proto3" json:"company,omitempty"` // @gotags: fake:"skip" CompanyTwoId *string `protobuf:"bytes,37,opt,name=company_two_id,json=companyTwoId,proto3,oneof" json:"company_two_id,omitempty"` // @gotags: fake:"skip" CompanyTwo *Company `protobuf:"bytes,38,opt,name=company_two,json=companyTwo,proto3" json:"company_two,omitempty"` // @gotags: fake:"skip" AnUnexpectedId *string `protobuf:"bytes,39,opt,name=an_unexpected_id,json=anUnexpectedId,proto3,oneof" json:"an_unexpected_id,omitempty"` // @gotags: fake:"skip" CompanyThree *Company `protobuf:"bytes,40,opt,name=company_three,json=companyThree,proto3" json:"company_three,omitempty"` // @gotags: fake:"skip" Address *Address `protobuf:"bytes,41,opt,name=address,proto3" json:"address,omitempty"` // @gotags: fake:"skip" Comments []*Comment `protobuf:"bytes,42,rep,name=comments,proto3" json:"comments,omitempty"` // @gotags: fake:"skip" Profiles []*Profile `protobuf:"bytes,43,rep,name=profiles,proto3" json:"profiles,omitempty"` // @gotags: fake:"{number:1,9}" IntEnum EnumOne `protobuf:"varint,44,opt,name=int_enum,json=intEnum,proto3,enum=example.postgres.EnumOne" json:"int_enum,omitempty"` // @gotags: fake:"{number:1,9}" StringEnum EnumOne `protobuf:"varint,45,opt,name=string_enum,json=stringEnum,proto3,enum=example.postgres.EnumOne" json:"string_enum,omitempty"` // @gotags: fake:"{number:1,9}" IntEnumList []EnumOne `` /* 135-byte string literal not displayed */ // @gotags: fake:"{number:1,9}" StringEnumList []EnumOne `` /* 144-byte string literal not displayed */ // @gotags: fake:"{date:2006-01-02}" Date string `protobuf:"bytes,48,opt,name=date,proto3" json:"date,omitempty"` // @gotags: fake:"{date:2006-01-02}" OptionalDate *string `protobuf:"bytes,49,opt,name=optional_date,json=optionalDate,proto3,oneof" json:"optional_date,omitempty"` // @gotags: fake:"skip" SomeTimestamp *timestamppb.Timestamp `protobuf:"bytes,50,opt,name=some_timestamp,json=someTimestamp,proto3" json:"some_timestamp,omitempty"` // contains filtered or unexported fields }
func (*User) Descriptor
deprecated
func (*User) GetADouble ¶
func (*User) GetAString ¶
func (*User) GetAStructpb ¶
func (*User) GetAddress ¶
func (*User) GetAnInt32 ¶
func (*User) GetAnInt64 ¶
func (*User) GetAnUnexpectedId ¶
func (*User) GetComments ¶
func (*User) GetCompany ¶
func (*User) GetCompanyThree ¶
func (*User) GetCompanyTwo ¶
func (*User) GetCompanyTwoId ¶
func (*User) GetCreatedAt ¶
func (*User) GetDoubles ¶
func (*User) GetIntEnum ¶
func (*User) GetIntEnumList ¶
func (*User) GetOptionalDate ¶
func (*User) GetOptionalScalarField ¶
func (*User) GetProfiles ¶
func (*User) GetSomeTimestamp ¶
func (x *User) GetSomeTimestamp() *timestamppb.Timestamp
func (*User) GetStringEnum ¶
func (*User) GetStringEnumList ¶
func (*User) GetStrings ¶
func (*User) GetUpdatedAt ¶
func (x *User) GetUpdatedAt() *timestamppb.Timestamp
func (*User) MarshalJSON ¶
MarshalJSON implements json.Marshaler
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
func (*User) ProtoReflect ¶
func (x *User) ProtoReflect() protoreflect.Message
func (*User) ToModel ¶
func (p *User) ToModel() (theModel *UserGormModel, err error)
func (*User) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler
type UserGormModel ¶
type UserGormModel struct { // @gotags: fake:"skip" Sid string `gorm:"primaryKey;size:34" json:"sid" fake:"skip"` // @gotags: fake:"skip" CreatedAt *time.Time `gorm:"type:timestamp;" json:"createdAt" fake:"skip"` // @gotags: fake:"skip" UpdatedAt *time.Time `gorm:"type:timestamp;" json:"updatedAt" fake:"skip"` // @gotags: fake:"{price:0.00,1000.00}" ADouble float64 `json:"aDouble" fake:"{price:0.00,1000.00}"` // @gotags: fake:"{price:0.00,1000.00}" AFloat float32 `json:"aFloat" fake:"{price:0.00,1000.00}"` // @gotags: fake:"{int32}" AnInt32 int32 `json:"anInt32" fake:"{int32}"` // @gotags: fake:"{number:9223372036854775807}" AnInt64 int64 `json:"anInt64" fake:"{number:9223372036854775807}"` // @gotags: fake:"{bool}" ABool *bool `json:"aBool" fake:"{bool}"` // @gotags: fake:"{hackerphrase}" AString string `json:"aString" fake:"{hackerphrase}"` // @gotags: fake:"skip" ABytes []byte `json:"aBytes" fake:"skip"` // @gotags: fake:"{price:0.00,1000.00}" Doubles pq.Float64Array `gorm:"type:float[];" json:"doubles" fake:"{price:0.00,1000.00}"` // @gotags: fake:"{price:0.00,1000.00}" Floats pq.Float32Array `gorm:"type:float[];" json:"floats" fake:"{price:0.00,1000.00}"` // @gotags: fake:"{int32}" Int32S pq.Int32Array `gorm:"type:int[];" json:"int32s" fake:"{int32}"` // @gotags: fake:"{number:9223372036854775807}" Int64S pq.Int64Array `gorm:"type:int[];" json:"int64s" fake:"{number:9223372036854775807}"` // @gotags: fake:"{bool}" Bools pq.BoolArray `gorm:"type:bool[];" json:"bools" fake:"{bool}"` // @gotags: fake:"{hackerphrase}" Strings pq.StringArray `gorm:"type:string[];" json:"strings" fake:"{hackerphrase}"` // @gotags: fake:"skip" Bytess pq.ByteaArray `gorm:"type:bytes[];" json:"bytess" fake:"skip"` // @gotags: fake:"skip" OptionalScalarField *string `json:"optionalScalarField" fake:"skip"` // @gotags: fake:"skip" AStructpb gorm_jsonb.JSONB `gorm:"type:jsonb" json:"aStructpb" fake:"skip"` CompanySid *string `gorm:"size:34"` // @gotags: fake:"skip" Company *CompanyGormModel `gorm:"foreignKey:CompanySid;references:sid;constraint:OnDelete:CASCADE;" json:"company" fake:"skip"` // @gotags: fake:"skip" CompanyTwoId *string `json:"companyTwoId" fake:"skip"` CompanyTwoSid *string `gorm:"size:34"` // @gotags: fake:"skip" CompanyTwo *CompanyGormModel `gorm:"foreignKey:CompanyTwoSid;references:sid;constraint:OnDelete:CASCADE;" json:"companyTwo" fake:"skip"` // @gotags: fake:"skip" AnUnexpectedId *string `json:"anUnexpectedId" fake:"skip"` // @gotags: fake:"skip" CompanyThree *CompanyGormModel `gorm:"foreignKey:AnUnexpectedId;references:sid;constraint:OnDelete:CASCADE;" json:"companyThree" fake:"skip"` // @gotags: fake:"skip" Address *AddressGormModel `gorm:"foreignKey:UserSid;references:Sid;constraint:OnDelete:CASCADE;" json:"address" fake:"skip"` // @gotags: fake:"skip" Comments []*CommentGormModel `gorm:"foreignKey:UserSid;references:Sid;constraint:OnDelete:CASCADE;" json:"comments" fake:"skip"` // @gotags: fake:"skip" Profiles []*ProfileGormModel `` /* 167-byte string literal not displayed */ // @gotags: fake:"{number:1,9}" IntEnum int `json:"intEnum" fake:"{number:1,9}"` // @gotags: fake:"{number:1,9}" StringEnum string `json:"stringEnum" fake:"{number:1,9}"` // @gotags: fake:"{number:1,9}" IntEnumList pq.Int32Array `gorm:"type:int[];" json:"intEnumList" fake:"{number:1,9}"` // @gotags: fake:"{number:1,9}" StringEnumList pq.StringArray `gorm:"type:string[];" json:"stringEnumList" fake:"{number:1,9}"` // @gotags: fake:"{date:2006-01-02}" Date *time.Time `json:"date" fake:"{date:2006-01-02}"` // @gotags: fake:"{date:2006-01-02}" OptionalDate *time.Time `json:"optionalDate" fake:"{date:2006-01-02}"` // @gotags: fake:"skip" SomeTimestamp *time.Time `gorm:"type:timestamp;" json:"someTimestamp" fake:"skip"` }
func (*UserGormModel) TableName ¶
func (m *UserGormModel) TableName() string
func (*UserGormModel) ToProto ¶
func (m *UserGormModel) ToProto() (theProto *User, err error)
type UserGormModels ¶
type UserGormModels []*UserGormModel
func (UserGormModels) GetByModelIds ¶
func (UserGormModels) ToProtos ¶
func (m UserGormModels) ToProtos() (protos UserProtos, err error)
type UserProtos ¶
type UserProtos []*User
func (UserProtos) ToModels ¶
func (p UserProtos) ToModels() (models UserGormModels, err error)
func (*UserProtos) Upsert ¶
func (p *UserProtos) Upsert(ctx context.Context, tx *gorm.DB) (models UserGormModels, err error)
Upsert creates the protos using an on conflict clause to do updates. This function does not update *any* associations use gorm's association mode functions to update associations as you see fit after calling upsert. See https://gorm.io/docs/associations.html#Replace-Associations