example

package
v0.0.0-...-fafdb79 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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.

View Source
var File_mysql_example_proto protoreflect.FileDescriptor

Functions

func DeleteAddressGormModels

func DeleteAddressGormModels(ctx context.Context, tx *gorm.DB, ids []string) error

func DeleteCommentGormModels

func DeleteCommentGormModels(ctx context.Context, tx *gorm.DB, ids []string) error

func DeleteCompanyGormModels

func DeleteCompanyGormModels(ctx context.Context, tx *gorm.DB, ids []string) error

func DeleteProfileGormModels

func DeleteProfileGormModels(ctx context.Context, tx *gorm.DB, ids []string) error

func DeleteUserGormModels

func DeleteUserGormModels(ctx context.Context, tx *gorm.DB, ids []string) error

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) Descriptor() ([]byte, []int)

Deprecated: Use Address.ProtoReflect.Descriptor instead.

func (*Address) GetCompanyBlob

func (x *Address) GetCompanyBlob() *Company

func (*Address) GetCreatedAt

func (x *Address) GetCreatedAt() *timestamppb.Timestamp

func (*Address) GetName

func (x *Address) GetName() string

func (*Address) GetSid

func (x *Address) GetSid() string

func (*Address) GetUpdatedAt

func (x *Address) GetUpdatedAt() *timestamppb.Timestamp

func (*Address) GetUser

func (x *Address) GetUser() *User

func (*Address) GetUserId

func (x *Address) GetUserId() string

func (*Address) MarshalJSON

func (msg *Address) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*Address) ProtoMessage

func (*Address) ProtoMessage()

func (*Address) ProtoReflect

func (x *Address) ProtoReflect() protoreflect.Message

func (*Address) Reset

func (x *Address) Reset()

func (*Address) String

func (x *Address) String() string

func (*Address) ToModel

func (p *Address) ToModel() (theModel *AddressGormModel, err error)

func (*Address) UnmarshalJSON

func (msg *Address) UnmarshalJSON(b []byte) error

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 (m AddressGormModels) GetByModelIds(ctx context.Context, tx *gorm.DB, preloads ...string) (err error)

func (AddressGormModels) ToProtos

func (m AddressGormModels) ToProtos() (protos AddressProtos, err error)

type AddressProtos

type AddressProtos []*Address

func (*AddressProtos) GetByIds

func (p *AddressProtos) GetByIds(ctx context.Context, tx *gorm.DB, ids []string, preloads ...string) (err error)

func (*AddressProtos) List

func (p *AddressProtos) List(ctx context.Context, tx *gorm.DB, limit, offset int, order interface{}, preloads ...string) (err error)

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) Descriptor() ([]byte, []int)

Deprecated: Use Comment.ProtoReflect.Descriptor instead.

func (*Comment) GetCreatedAt

func (x *Comment) GetCreatedAt() *timestamppb.Timestamp

func (*Comment) GetName

func (x *Comment) GetName() string

func (*Comment) GetSid

func (x *Comment) GetSid() string

func (*Comment) GetUpdatedAt

func (x *Comment) GetUpdatedAt() *timestamppb.Timestamp

func (*Comment) GetUser

func (x *Comment) GetUser() *User

func (*Comment) MarshalJSON

func (msg *Comment) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*Comment) ProtoMessage

func (*Comment) ProtoMessage()

func (*Comment) ProtoReflect

func (x *Comment) ProtoReflect() protoreflect.Message

func (*Comment) Reset

func (x *Comment) Reset()

func (*Comment) String

func (x *Comment) String() string

func (*Comment) ToModel

func (p *Comment) ToModel() (theModel *CommentGormModel, err error)

func (*Comment) UnmarshalJSON

func (msg *Comment) UnmarshalJSON(b []byte) error

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 (m CommentGormModels) GetByModelIds(ctx context.Context, tx *gorm.DB, preloads ...string) (err error)

func (CommentGormModels) ToProtos

func (m CommentGormModels) ToProtos() (protos CommentProtos, err error)

type CommentProtos

type CommentProtos []*Comment

func (*CommentProtos) GetByIds

func (p *CommentProtos) GetByIds(ctx context.Context, tx *gorm.DB, ids []string, preloads ...string) (err error)

func (*CommentProtos) List

func (p *CommentProtos) List(ctx context.Context, tx *gorm.DB, limit, offset int, order interface{}, preloads ...string) (err error)

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) Descriptor() ([]byte, []int)

Deprecated: Use Company.ProtoReflect.Descriptor instead.

func (*Company) GetCreatedAt

func (x *Company) GetCreatedAt() *timestamppb.Timestamp

func (*Company) GetName

func (x *Company) GetName() string

func (*Company) GetSid

func (x *Company) GetSid() string

func (*Company) GetUpdatedAt

func (x *Company) GetUpdatedAt() *timestamppb.Timestamp

func (*Company) MarshalJSON

func (msg *Company) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*Company) ProtoMessage

func (*Company) ProtoMessage()

func (*Company) ProtoReflect

func (x *Company) ProtoReflect() protoreflect.Message

func (*Company) Reset

func (x *Company) Reset()

func (*Company) String

func (x *Company) String() string

func (*Company) ToModel

func (p *Company) ToModel() (theModel *CompanyGormModel, err error)

func (*Company) UnmarshalJSON

func (msg *Company) UnmarshalJSON(b []byte) error

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 (m CompanyGormModels) GetByModelIds(ctx context.Context, tx *gorm.DB, preloads ...string) (err error)

func (CompanyGormModels) ToProtos

func (m CompanyGormModels) ToProtos() (protos CompanyProtos, err error)

type CompanyProtos

type CompanyProtos []*Company

func (*CompanyProtos) GetByIds

func (p *CompanyProtos) GetByIds(ctx context.Context, tx *gorm.DB, ids []string, preloads ...string) (err error)

func (*CompanyProtos) List

func (p *CompanyProtos) List(ctx context.Context, tx *gorm.DB, limit, offset int, order interface{}, preloads ...string) (err error)

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
const (
	EnumOne_Default EnumOne = 0
	EnumOne_One     EnumOne = 1
	EnumOne_Two     EnumOne = 2
	EnumOne_Three   EnumOne = 3
	EnumOne_Four    EnumOne = 4
	EnumOne_Five    EnumOne = 5
	EnumOne_Six     EnumOne = 6
	EnumOne_Seven   EnumOne = 7
	EnumOne_Eight   EnumOne = 8
	EnumOne_Nine    EnumOne = 9
)

func (EnumOne) Descriptor

func (EnumOne) Descriptor() protoreflect.EnumDescriptor

func (EnumOne) Enum

func (x EnumOne) Enum() *EnumOne

func (EnumOne) EnumDescriptor deprecated

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

Deprecated: Use EnumOne.Descriptor instead.

func (EnumOne) Number

func (x EnumOne) Number() protoreflect.EnumNumber

func (EnumOne) String

func (x EnumOne) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Profile.ProtoReflect.Descriptor instead.

func (*Profile) GetCreatedAt

func (x *Profile) GetCreatedAt() *timestamppb.Timestamp

func (*Profile) GetName

func (x *Profile) GetName() string

func (*Profile) GetSid

func (x *Profile) GetSid() string

func (*Profile) GetUpdatedAt

func (x *Profile) GetUpdatedAt() *timestamppb.Timestamp

func (*Profile) MarshalJSON

func (msg *Profile) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*Profile) ProtoMessage

func (*Profile) ProtoMessage()

func (*Profile) ProtoReflect

func (x *Profile) ProtoReflect() protoreflect.Message

func (*Profile) Reset

func (x *Profile) Reset()

func (*Profile) String

func (x *Profile) String() string

func (*Profile) ToModel

func (p *Profile) ToModel() (theModel *ProfileGormModel, err error)

func (*Profile) UnmarshalJSON

func (msg *Profile) UnmarshalJSON(b []byte) error

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 (m ProfileGormModels) GetByModelIds(ctx context.Context, tx *gorm.DB, preloads ...string) (err error)

func (ProfileGormModels) ToProtos

func (m ProfileGormModels) ToProtos() (protos ProfileProtos, err error)

type ProfileProtos

type ProfileProtos []*Profile

func (*ProfileProtos) GetByIds

func (p *ProfileProtos) GetByIds(ctx context.Context, tx *gorm.DB, ids []string, preloads ...string) (err error)

func (*ProfileProtos) List

func (p *ProfileProtos) List(ctx context.Context, tx *gorm.DB, limit, offset int, order interface{}, preloads ...string) (err error)

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) Descriptor() ([]byte, []int)

Deprecated: Use User.ProtoReflect.Descriptor instead.

func (*User) GetABool

func (x *User) GetABool() bool

func (*User) GetABytes

func (x *User) GetABytes() []byte

func (*User) GetADouble

func (x *User) GetADouble() float64

func (*User) GetAFloat

func (x *User) GetAFloat() float32

func (*User) GetAString

func (x *User) GetAString() string

func (*User) GetAStructpb

func (x *User) GetAStructpb() *structpb.Struct

func (*User) GetAddress

func (x *User) GetAddress() *Address

func (*User) GetAnInt32

func (x *User) GetAnInt32() int32

func (*User) GetAnInt64

func (x *User) GetAnInt64() int64

func (*User) GetAnUnexpectedId

func (x *User) GetAnUnexpectedId() string

func (*User) GetBools

func (x *User) GetBools() []bool

func (*User) GetBytess

func (x *User) GetBytess() [][]byte

func (*User) GetComments

func (x *User) GetComments() []*Comment

func (*User) GetCompany

func (x *User) GetCompany() *Company

func (*User) GetCompanyThree

func (x *User) GetCompanyThree() *Company

func (*User) GetCompanyTwo

func (x *User) GetCompanyTwo() *Company

func (*User) GetCompanyTwoId

func (x *User) GetCompanyTwoId() string

func (*User) GetCreatedAt

func (x *User) GetCreatedAt() string

func (*User) GetDate

func (x *User) GetDate() string

func (*User) GetDoubles

func (x *User) GetDoubles() []float64

func (*User) GetFloats

func (x *User) GetFloats() []float32

func (*User) GetInt32S

func (x *User) GetInt32S() []int32

func (*User) GetInt64S

func (x *User) GetInt64S() []int64

func (*User) GetIntEnum

func (x *User) GetIntEnum() EnumOne

func (*User) GetIntEnumList

func (x *User) GetIntEnumList() []EnumOne

func (*User) GetOptionalDate

func (x *User) GetOptionalDate() string

func (*User) GetOptionalScalarField

func (x *User) GetOptionalScalarField() string

func (*User) GetProfiles

func (x *User) GetProfiles() []*Profile

func (*User) GetSid

func (x *User) GetSid() string

func (*User) GetSomeTimestamp

func (x *User) GetSomeTimestamp() *timestamppb.Timestamp

func (*User) GetStringEnum

func (x *User) GetStringEnum() EnumOne

func (*User) GetStringEnumList

func (x *User) GetStringEnumList() []EnumOne

func (*User) GetStrings

func (x *User) GetStrings() []string

func (*User) GetUpdatedAt

func (x *User) GetUpdatedAt() *timestamppb.Timestamp

func (*User) MarshalJSON

func (msg *User) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*User) ProtoMessage

func (*User) ProtoMessage()

func (*User) ProtoReflect

func (x *User) ProtoReflect() protoreflect.Message

func (*User) Reset

func (x *User) Reset()

func (*User) String

func (x *User) String() string

func (*User) ToModel

func (p *User) ToModel() (theModel *UserGormModel, err error)

func (*User) UnmarshalJSON

func (msg *User) UnmarshalJSON(b []byte) error

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 (m UserGormModels) GetByModelIds(ctx context.Context, tx *gorm.DB, preloads ...string) (err error)

func (UserGormModels) ToProtos

func (m UserGormModels) ToProtos() (protos UserProtos, err error)

type UserProtos

type UserProtos []*User

func (*UserProtos) GetByIds

func (p *UserProtos) GetByIds(ctx context.Context, tx *gorm.DB, ids []string, preloads ...string) (err error)

func (*UserProtos) List

func (p *UserProtos) List(ctx context.Context, tx *gorm.DB, limit, offset int, order interface{}, preloads ...string) (err error)

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

Jump to

Keyboard shortcuts

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