Documentation ¶
Overview ¶
Package entities is a generated protocol buffer package.
It is generated from these files:
service/account/proto/entities/entities.proto
It has these top-level messages:
User Profile
Index ¶
- Variables
- func DefaultDeleteProfile(ctx context.Context, in *Profile, db *gorm1.DB) error
- func DefaultDeleteProfileSet(ctx context.Context, in []*Profile, db *gorm1.DB) error
- func DefaultDeleteUser(ctx context.Context, in *User, db *gorm1.DB) error
- func DefaultDeleteUserSet(ctx context.Context, in []*User, db *gorm1.DB) error
- type Profile
- func DefaultApplyFieldMaskProfile(ctx context.Context, patchee *Profile, patcher *Profile, ...) (*Profile, error)
- func DefaultCreateProfile(ctx context.Context, in *Profile, db *gorm1.DB) (*Profile, error)
- func DefaultListProfile(ctx context.Context, db *gorm1.DB) ([]*Profile, error)
- func DefaultPatchProfile(ctx context.Context, in *Profile, updateMask *field_mask1.FieldMask, ...) (*Profile, error)
- func DefaultPatchSetProfile(ctx context.Context, objects []*Profile, updateMasks []*field_mask1.FieldMask, ...) ([]*Profile, error)
- func DefaultReadProfile(ctx context.Context, in *Profile, db *gorm1.DB) (*Profile, error)
- func DefaultStrictUpdateProfile(ctx context.Context, in *Profile, db *gorm1.DB) (*Profile, error)
- func (*Profile) Descriptor() ([]byte, []int)
- func (m *Profile) GetAge() uint32
- func (m *Profile) GetAvatar() string
- func (m *Profile) GetBirthday() *timestamp.Timestamp
- func (m *Profile) GetCreatedAt() *timestamp.Timestamp
- func (m *Profile) GetDeletedAt() *timestamp.Timestamp
- func (m *Profile) GetGender() Profile_GenderType
- func (m *Profile) GetId() *types.UUID
- func (m *Profile) GetPreferredTheme() *wrappers.StringValue
- func (m *Profile) GetTz() string
- func (m *Profile) GetUpdatedAt() *timestamp.Timestamp
- func (*Profile) ProtoMessage()
- func (m *Profile) Reset()
- func (m *Profile) String() string
- func (m *Profile) ToORM(ctx context.Context) (ProfileORM, error)
- func (m *Profile) Validate() error
- func (m *Profile) XXX_DiscardUnknown()
- func (m *Profile) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Profile) XXX_Merge(src proto.Message)
- func (m *Profile) XXX_Size() int
- func (m *Profile) XXX_Unmarshal(b []byte) error
- type ProfileORM
- type ProfileORMWithAfterCreate_
- type ProfileORMWithAfterDeleteSet
- type ProfileORMWithAfterDelete_
- type ProfileORMWithAfterListFind
- type ProfileORMWithAfterReadFind
- type ProfileORMWithAfterStrictUpdateSave
- type ProfileORMWithBeforeCreate_
- type ProfileORMWithBeforeDeleteSet
- type ProfileORMWithBeforeDelete_
- type ProfileORMWithBeforeListApplyQuery
- type ProfileORMWithBeforeListFind
- type ProfileORMWithBeforeReadApplyQuery
- type ProfileORMWithBeforeReadFind
- type ProfileORMWithBeforeStrictUpdateCleanup
- type ProfileORMWithBeforeStrictUpdateSave
- type ProfileValidationError
- type ProfileWithAfterPatchSave
- type ProfileWithAfterToORM
- type ProfileWithAfterToPB
- type ProfileWithBeforePatchApplyFieldMask
- type ProfileWithBeforePatchRead
- type ProfileWithBeforePatchSave
- type ProfileWithBeforeToORM
- type ProfileWithBeforeToPB
- type Profile_GenderType
- type User
- func DefaultApplyFieldMaskUser(ctx context.Context, patchee *User, patcher *User, ...) (*User, error)
- func DefaultCreateUser(ctx context.Context, in *User, db *gorm1.DB) (*User, error)
- func DefaultListUser(ctx context.Context, db *gorm1.DB) ([]*User, error)
- func DefaultPatchSetUser(ctx context.Context, objects []*User, updateMasks []*field_mask1.FieldMask, ...) ([]*User, error)
- func DefaultPatchUser(ctx context.Context, in *User, updateMask *field_mask1.FieldMask, db *gorm1.DB) (*User, error)
- func DefaultReadUser(ctx context.Context, in *User, db *gorm1.DB) (*User, error)
- func DefaultStrictUpdateUser(ctx context.Context, in *User, db *gorm1.DB) (*User, error)
- func (*User) Descriptor() ([]byte, []int)
- func (m *User) GetCreatedAt() *timestamp.Timestamp
- func (m *User) GetDeletedAt() *timestamp.Timestamp
- func (m *User) GetEmail() string
- func (m *User) GetFirstName() string
- func (m *User) GetId() *types.UUID
- func (m *User) GetLastName() string
- func (m *User) GetProfile() *Profile
- func (m *User) GetUpdatedAt() *timestamp.Timestamp
- func (m *User) GetUsername() *wrappers.StringValue
- func (*User) ProtoMessage()
- func (m *User) Reset()
- func (m *User) String() string
- func (m *User) ToORM(ctx context.Context) (UserORM, error)
- func (m *User) Validate() error
- func (m *User) XXX_DiscardUnknown()
- func (m *User) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *User) XXX_Merge(src proto.Message)
- func (m *User) XXX_Size() int
- func (m *User) XXX_Unmarshal(b []byte) error
- type UserORM
- type UserORMWithAfterCreate_
- type UserORMWithAfterDeleteSet
- type UserORMWithAfterDelete_
- type UserORMWithAfterListFind
- type UserORMWithAfterReadFind
- type UserORMWithAfterStrictUpdateSave
- type UserORMWithBeforeCreate_
- type UserORMWithBeforeDeleteSet
- type UserORMWithBeforeDelete_
- type UserORMWithBeforeListApplyQuery
- type UserORMWithBeforeListFind
- type UserORMWithBeforeReadApplyQuery
- type UserORMWithBeforeReadFind
- type UserORMWithBeforeStrictUpdateCleanup
- type UserORMWithBeforeStrictUpdateSave
- type UserValidationError
- type UserWithAfterPatchSave
- type UserWithAfterToORM
- type UserWithAfterToPB
- type UserWithBeforePatchApplyFieldMask
- type UserWithBeforePatchRead
- type UserWithBeforePatchSave
- type UserWithBeforeToORM
- type UserWithBeforeToPB
Constants ¶
This section is empty.
Variables ¶
var Profile_GenderType_name = map[int32]string{
0: "GENDER_TYPE_UNSPECIFIED",
1: "GENDER_TYPE_MALE",
2: "GENDER_TYPE_FEMALE",
}
var Profile_GenderType_value = map[string]int32{
"GENDER_TYPE_UNSPECIFIED": 0,
"GENDER_TYPE_MALE": 1,
"GENDER_TYPE_FEMALE": 2,
}
Functions ¶
func DefaultDeleteProfile ¶
func DefaultDeleteProfileSet ¶
Types ¶
type Profile ¶
type Profile struct { // gorm.types.UUID id = 1 [(gorm.field).tag = { // type: "uuid", primary_key: true, default: "uuid_generate_v4()" }]; primary // key Id *types.UUID `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` CreatedAt *timestamp.Timestamp `protobuf:"bytes,2,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` UpdatedAt *timestamp.Timestamp `protobuf:"bytes,3,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` DeletedAt *timestamp.Timestamp `protobuf:"bytes,4,opt,name=deleted_at,json=deletedAt,proto3" json:"deleted_at,omitempty"` Tz string `protobuf:"bytes,5,opt,name=tz,proto3" json:"tz,omitempty"` Avatar string `protobuf:"bytes,6,opt,name=avatar,proto3" json:"avatar,omitempty"` // FIXME: https://github.com/jinzhu/gorm/issues/1978 Gender Profile_GenderType `protobuf:"varint,7,opt,name=gender,proto3,enum=mkit.service.account.entities.v1.Profile_GenderType" json:"gender,omitempty"` Birthday *timestamp.Timestamp `protobuf:"bytes,8,opt,name=birthday,proto3" json:"birthday,omitempty"` Age uint32 `protobuf:"varint,9,opt,name=age,proto3" json:"age,omitempty"` PreferredTheme *wrappers.StringValue `protobuf:"bytes,10,opt,name=preferred_theme,json=preferredTheme,proto3" json:"preferred_theme,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Profile Entity
func DefaultApplyFieldMaskProfile ¶
func DefaultApplyFieldMaskProfile(ctx context.Context, patchee *Profile, patcher *Profile, updateMask *field_mask1.FieldMask, prefix string, db *gorm1.DB) (*Profile, error)
DefaultApplyFieldMaskProfile patches an pbObject with patcher according to a field mask.
func DefaultCreateProfile ¶
DefaultCreateProfile executes a basic gorm create call
func DefaultListProfile ¶
DefaultListProfile executes a gorm list call
func DefaultPatchProfile ¶
func DefaultPatchProfile(ctx context.Context, in *Profile, updateMask *field_mask1.FieldMask, db *gorm1.DB) (*Profile, error)
DefaultPatchProfile executes a basic gorm update call with patch behavior
func DefaultPatchSetProfile ¶
func DefaultPatchSetProfile(ctx context.Context, objects []*Profile, updateMasks []*field_mask1.FieldMask, db *gorm1.DB) ([]*Profile, error)
DefaultPatchSetProfile executes a bulk gorm update call with patch behavior
func DefaultReadProfile ¶
DefaultReadProfile executes a basic gorm read call
func DefaultStrictUpdateProfile ¶
DefaultStrictUpdateProfile clears first level 1:many children and then executes a gorm update call
func (*Profile) Descriptor ¶
func (*Profile) GetBirthday ¶
func (*Profile) GetCreatedAt ¶
func (*Profile) GetDeletedAt ¶
func (*Profile) GetGender ¶
func (m *Profile) GetGender() Profile_GenderType
func (*Profile) GetPreferredTheme ¶
func (m *Profile) GetPreferredTheme() *wrappers.StringValue
func (*Profile) GetUpdatedAt ¶
func (*Profile) ProtoMessage ¶
func (*Profile) ProtoMessage()
func (*Profile) ToORM ¶
func (m *Profile) ToORM(ctx context.Context) (ProfileORM, 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
func (*Profile) XXX_DiscardUnknown ¶
func (m *Profile) XXX_DiscardUnknown()
func (*Profile) XXX_Marshal ¶
func (*Profile) XXX_Unmarshal ¶
type ProfileORM ¶
type ProfileORM struct { Avatar string Birthday *time.Time `gorm:"not null"` CreatedAt *time.Time `gorm:"not null"` DeletedAt *time.Time `gorm:"index:idx_profiles_deleted_at"` Gender string Id go_uuid1.UUID `gorm:"type:uuid;primary_key;unique;not null"` PreferredTheme *string Tz string UpdatedAt *time.Time `gorm:"not null"` UserId *go_uuid1.UUID }
func (*ProfileORM) AfterToPB ¶
func (m *ProfileORM) AfterToPB(ctx context.Context, profile *Profile) error
AfterToPB implements the posthook interface for the Profile type. This allows us to customize conversion behavior. In this example, we set the User's Age based on the Birthday, instead of storing it separately in the DB
func (*ProfileORM) BeforeCreate ¶
func (m *ProfileORM) BeforeCreate(scope *gorm.Scope) error
BeforeCreate implements the GORM BeforeCreate interface for the ProfileORM type.
func (ProfileORM) TableName ¶
func (ProfileORM) TableName() string
TableName overrides the default tablename generated by GORM
type ProfileValidationError ¶
type ProfileValidationError struct {
// contains filtered or unexported fields
}
ProfileValidationError is the validation error returned by Profile.Validate if the designated constraints aren't met.
func (ProfileValidationError) Cause ¶
func (e ProfileValidationError) Cause() error
Cause function returns cause value.
func (ProfileValidationError) Error ¶
func (e ProfileValidationError) Error() string
Error satisfies the builtin error interface
func (ProfileValidationError) ErrorName ¶
func (e ProfileValidationError) ErrorName() string
ErrorName returns error name.
func (ProfileValidationError) Field ¶
func (e ProfileValidationError) Field() string
Field function returns field value.
func (ProfileValidationError) Key ¶
func (e ProfileValidationError) Key() bool
Key function returns key value.
func (ProfileValidationError) Reason ¶
func (e ProfileValidationError) Reason() string
Reason function returns reason value.
type ProfileWithAfterToORM ¶
type ProfileWithAfterToORM interface {
AfterToORM(context.Context, *ProfileORM) error
}
ProfileAfterToORM called after default ToORM code
type ProfileWithAfterToPB ¶
ProfileAfterToPB called after default ToPB code
type ProfileWithBeforeToORM ¶
type ProfileWithBeforeToORM interface {
BeforeToORM(context.Context, *ProfileORM) error
}
ProfileBeforeToORM called before default ToORM code
type ProfileWithBeforeToPB ¶
ProfileBeforeToPB called before default ToPB code
type Profile_GenderType ¶
type Profile_GenderType int32
const ( Profile_GENDER_TYPE_UNSPECIFIED Profile_GenderType = 0 Profile_GENDER_TYPE_MALE Profile_GenderType = 1 Profile_GENDER_TYPE_FEMALE Profile_GenderType = 2 )
func (Profile_GenderType) EnumDescriptor ¶
func (Profile_GenderType) EnumDescriptor() ([]byte, []int)
func (Profile_GenderType) String ¶
func (x Profile_GenderType) String() string
type User ¶
type User struct { Id *types.UUID `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` CreatedAt *timestamp.Timestamp `protobuf:"bytes,2,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` UpdatedAt *timestamp.Timestamp `protobuf:"bytes,3,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` DeletedAt *timestamp.Timestamp `protobuf:"bytes,4,opt,name=deleted_at,json=deletedAt,proto3" json:"deleted_at,omitempty"` Username *wrappers.StringValue `protobuf:"bytes,7,opt,name=username,proto3" json:"username,omitempty"` FirstName string `protobuf:"bytes,8,opt,name=first_name,json=firstName,proto3" json:"first_name,omitempty"` LastName string `protobuf:"bytes,9,opt,name=last_name,json=lastName,proto3" json:"last_name,omitempty"` Email string `protobuf:"bytes,10,opt,name=email,proto3" json:"email,omitempty"` Profile *Profile `protobuf:"bytes,11,opt,name=profile,proto3" json:"profile,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
User Entity
func DefaultApplyFieldMaskUser ¶
func DefaultApplyFieldMaskUser(ctx context.Context, patchee *User, patcher *User, updateMask *field_mask1.FieldMask, prefix string, db *gorm1.DB) (*User, error)
DefaultApplyFieldMaskUser patches an pbObject with patcher according to a field mask.
func DefaultCreateUser ¶
DefaultCreateUser executes a basic gorm create call
func DefaultListUser ¶
DefaultListUser executes a gorm list call
func DefaultPatchSetUser ¶
func DefaultPatchSetUser(ctx context.Context, objects []*User, updateMasks []*field_mask1.FieldMask, db *gorm1.DB) ([]*User, error)
DefaultPatchSetUser executes a bulk gorm update call with patch behavior
func DefaultPatchUser ¶
func DefaultPatchUser(ctx context.Context, in *User, updateMask *field_mask1.FieldMask, db *gorm1.DB) (*User, error)
DefaultPatchUser executes a basic gorm update call with patch behavior
func DefaultReadUser ¶
DefaultReadUser executes a basic gorm read call
func DefaultStrictUpdateUser ¶
DefaultStrictUpdateUser clears first level 1:many children and then executes a gorm update call
func (*User) Descriptor ¶
func (*User) GetCreatedAt ¶
func (*User) GetDeletedAt ¶
func (*User) GetFirstName ¶
func (*User) GetLastName ¶
func (*User) GetProfile ¶
func (*User) GetUpdatedAt ¶
func (*User) GetUsername ¶
func (m *User) GetUsername() *wrappers.StringValue
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
func (*User) ToORM ¶
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
func (*User) XXX_DiscardUnknown ¶
func (m *User) XXX_DiscardUnknown()
func (*User) XXX_Unmarshal ¶
type UserORM ¶
type UserORM struct { CreatedAt *time.Time `gorm:"not null"` DeletedAt *time.Time `gorm:"index:idx_users_deleted_at"` Email string `gorm:"not null"` FirstName string `gorm:"size:255;not null"` Id go_uuid1.UUID `gorm:"type:uuid;primary_key;unique;not null"` LastName string `gorm:"not null"` Profile *ProfileORM `gorm:"foreignkey:UserId;association_foreignkey:Id;preload:true"` UpdatedAt *time.Time `gorm:"not null"` Username *string `gorm:"size:100;not null"` }
func (*UserORM) BeforeCreate ¶
BeforeCreate implements the GORM BeforeCreate interface for the UserORM type. you can use this method to generate new UUID for CREATE operation or let database create it with this annotation: {type: "uuid", primary_key: true, not_null:true, default: "uuid_generate_v4()"}]; we prefer First method as it works with both SQLite & PostgreSQL
type UserORMWithAfterCreate_ ¶
type UserORMWithAfterDelete_ ¶
type UserValidationError ¶
type UserValidationError struct {
// contains filtered or unexported fields
}
UserValidationError is the validation error returned by User.Validate if the designated constraints aren't met.
func (UserValidationError) Cause ¶
func (e UserValidationError) Cause() error
Cause function returns cause value.
func (UserValidationError) Error ¶
func (e UserValidationError) Error() string
Error satisfies the builtin error interface
func (UserValidationError) ErrorName ¶
func (e UserValidationError) ErrorName() string
ErrorName returns error name.
func (UserValidationError) Field ¶
func (e UserValidationError) Field() string
Field function returns field value.
func (UserValidationError) Key ¶
func (e UserValidationError) Key() bool
Key function returns key value.
func (UserValidationError) Reason ¶
func (e UserValidationError) Reason() string
Reason function returns reason value.
type UserWithAfterPatchSave ¶
type UserWithAfterToORM ¶
UserAfterToORM called after default ToORM code
type UserWithAfterToPB ¶
UserAfterToPB called after default ToPB code
type UserWithBeforePatchRead ¶
type UserWithBeforePatchSave ¶
type UserWithBeforeToORM ¶
UserBeforeToORM called before default ToORM code