models

package
v0.0.0-...-f616806 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultDeleteUser

func DefaultDeleteUser(ctx context.Context, in *User, db *gorm1.DB) error

func DefaultDeleteUserSet

func DefaultDeleteUserSet(ctx context.Context, in []*User, db *gorm1.DB) error

Types

type Gender

type Gender struct {
	Male                 bool     `protobuf:"varint,1,opt,name=male,proto3" json:"male,omitempty"`
	Female               bool     `protobuf:"varint,2,opt,name=female,proto3" json:"female,omitempty"`
	Transgender          bool     `protobuf:"varint,3,opt,name=transgender,proto3" json:"transgender,omitempty"`
	GenderNonBinary      bool     `protobuf:"varint,4,opt,name=genderNonBinary,proto3" json:"genderNonBinary,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Gender) Descriptor

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

func (*Gender) GetFemale

func (m *Gender) GetFemale() bool

func (*Gender) GetGenderNonBinary

func (m *Gender) GetGenderNonBinary() bool

func (*Gender) GetMale

func (m *Gender) GetMale() bool

func (*Gender) GetTransgender

func (m *Gender) GetTransgender() bool

func (*Gender) ProtoMessage

func (*Gender) ProtoMessage()

func (*Gender) Reset

func (m *Gender) Reset()

func (*Gender) String

func (m *Gender) String() string

func (*Gender) Validate

func (this *Gender) Validate() error

func (*Gender) XXX_DiscardUnknown

func (m *Gender) XXX_DiscardUnknown()

func (*Gender) XXX_Marshal

func (m *Gender) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Gender) XXX_Merge

func (m *Gender) XXX_Merge(src proto.Message)

func (*Gender) XXX_Size

func (m *Gender) XXX_Size() int

func (*Gender) XXX_Unmarshal

func (m *Gender) XXX_Unmarshal(b []byte) error

type IHashable

type IHashable interface {
	GetPasswordToHash() string
}

IHashable provides interface definitions for various models associated with this service

type User

type User struct {
	Id                   uint32               `protobuf:"varint,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"`
	DeletedAt            *timestamp.Timestamp `protobuf:"bytes,3,opt,name=deleted_at,json=deletedAt,proto3" json:"deleted_at,omitempty"`
	UpdatedAt            *timestamp.Timestamp `protobuf:"bytes,4,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
	FirstName            string               `protobuf:"bytes,5,opt,name=firstName,proto3" json:"firstName,omitempty"`
	LastName             string               `protobuf:"bytes,6,opt,name=lastName,proto3" json:"lastName,omitempty"`
	Gender               *Gender              `protobuf:"bytes,7,opt,name=gender,proto3" json:"gender,omitempty"`
	Email                string               `protobuf:"bytes,8,opt,name=email,proto3" json:"email,omitempty"`
	Password             string               `protobuf:"bytes,9,opt,name=password,proto3" json:"password,omitempty"`
	BirthDate            string               `protobuf:"bytes,10,opt,name=birthDate,proto3" json:"birthDate,omitempty"`
	IsActive             bool                 `protobuf:"varint,11,opt,name=isActive,proto3" json:"isActive,omitempty"`
	IsOnline             bool                 `protobuf:"varint,12,opt,name=isOnline,proto3" json:"isOnline,omitempty"`
	Username             string               `protobuf:"bytes,13,opt,name=username,proto3" json:"username,omitempty"`
	Authnid              uint32               `protobuf:"varint,14,opt,name=authnid,proto3" json:"authnid,omitempty"`
	XXX_NoUnkeyedLiteral struct{}             `json:"-"`
	XXX_unrecognized     []byte               `json:"-"`
	XXX_sizecache        int32                `json:"-"`
}

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

func DefaultCreateUser(ctx context.Context, in *User, db *gorm1.DB) (*User, error)

DefaultCreateUser executes a basic gorm create call

func DefaultListUser

func DefaultListUser(ctx context.Context, db *gorm1.DB) ([]*User, error)

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

func DefaultReadUser(ctx context.Context, in *User, db *gorm1.DB) (*User, error)

DefaultReadUser executes a basic gorm read call

func DefaultStrictUpdateUser

func DefaultStrictUpdateUser(ctx context.Context, in *User, db *gorm1.DB) (*User, error)

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

func (*User) Descriptor

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

func (*User) GetAuthnid

func (m *User) GetAuthnid() uint32

func (*User) GetBirthDate

func (m *User) GetBirthDate() string

func (*User) GetCreatedAt

func (m *User) GetCreatedAt() *timestamp.Timestamp

func (*User) GetDeletedAt

func (m *User) GetDeletedAt() *timestamp.Timestamp

func (*User) GetEmail

func (m *User) GetEmail() string

func (*User) GetFirstName

func (m *User) GetFirstName() string

func (*User) GetGender

func (m *User) GetGender() *Gender

func (*User) GetId

func (m *User) GetId() uint32

func (*User) GetIsActive

func (m *User) GetIsActive() bool

func (*User) GetIsOnline

func (m *User) GetIsOnline() bool

func (*User) GetLastName

func (m *User) GetLastName() string

func (*User) GetPassword

func (m *User) GetPassword() string

func (User) GetPasswordToHash

func (u User) GetPasswordToHash() string

GetPasswordToHash resturns a password from a user object

func (*User) GetUpdatedAt

func (m *User) GetUpdatedAt() *timestamp.Timestamp

func (*User) GetUsername

func (m *User) GetUsername() string

func (*User) ProtoMessage

func (*User) ProtoMessage()

func (*User) Reset

func (m *User) Reset()

func (*User) String

func (m *User) String() string

func (*User) ToORM

func (m *User) ToORM(ctx context.Context) (UserORM, 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 (*User) Validate

func (this *User) Validate() error

func (*User) XXX_DiscardUnknown

func (m *User) XXX_DiscardUnknown()

func (*User) XXX_Marshal

func (m *User) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*User) XXX_Merge

func (m *User) XXX_Merge(src proto.Message)

func (*User) XXX_Size

func (m *User) XXX_Size() int

func (*User) XXX_Unmarshal

func (m *User) XXX_Unmarshal(b []byte) error

type UserORM

type UserORM struct {
	Authnid   uint32
	BirthDate string
	CreatedAt *time.Time
	DeletedAt *time.Time
	Email     string
	FirstName string
	Id        uint32 `gorm:"type:serial;primary_key;auto_increment"`
	IsActive  bool
	IsOnline  bool
	LastName  string
	Password  string
	UpdatedAt *time.Time
	Username  string
}

func (UserORM) GetPasswordToHash

func (u UserORM) GetPasswordToHash() string

GetPasswordToHash returns a password from a user orm model

func (UserORM) TableName

func (UserORM) TableName() string

TableName overrides the default tablename generated by GORM

func (*UserORM) ToPB

func (m *UserORM) ToPB(ctx context.Context) (User, error)

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

type UserORMWithAfterCreate_

type UserORMWithAfterCreate_ interface {
	AfterCreate_(context.Context, *gorm1.DB) error
}

type UserORMWithAfterDeleteSet

type UserORMWithAfterDeleteSet interface {
	AfterDeleteSet(context.Context, []*User, *gorm1.DB) error
}

type UserORMWithAfterDelete_

type UserORMWithAfterDelete_ interface {
	AfterDelete_(context.Context, *gorm1.DB) error
}

type UserORMWithAfterListFind

type UserORMWithAfterListFind interface {
	AfterListFind(context.Context, *gorm1.DB, *[]UserORM) error
}

type UserORMWithAfterReadFind

type UserORMWithAfterReadFind interface {
	AfterReadFind(context.Context, *gorm1.DB) error
}

type UserORMWithAfterStrictUpdateSave

type UserORMWithAfterStrictUpdateSave interface {
	AfterStrictUpdateSave(context.Context, *gorm1.DB) error
}

type UserORMWithBeforeCreate_

type UserORMWithBeforeCreate_ interface {
	BeforeCreate_(context.Context, *gorm1.DB) (*gorm1.DB, error)
}

type UserORMWithBeforeDeleteSet

type UserORMWithBeforeDeleteSet interface {
	BeforeDeleteSet(context.Context, []*User, *gorm1.DB) (*gorm1.DB, error)
}

type UserORMWithBeforeDelete_

type UserORMWithBeforeDelete_ interface {
	BeforeDelete_(context.Context, *gorm1.DB) (*gorm1.DB, error)
}

type UserORMWithBeforeListApplyQuery

type UserORMWithBeforeListApplyQuery interface {
	BeforeListApplyQuery(context.Context, *gorm1.DB) (*gorm1.DB, error)
}

type UserORMWithBeforeListFind

type UserORMWithBeforeListFind interface {
	BeforeListFind(context.Context, *gorm1.DB) (*gorm1.DB, error)
}

type UserORMWithBeforeReadApplyQuery

type UserORMWithBeforeReadApplyQuery interface {
	BeforeReadApplyQuery(context.Context, *gorm1.DB) (*gorm1.DB, error)
}

type UserORMWithBeforeReadFind

type UserORMWithBeforeReadFind interface {
	BeforeReadFind(context.Context, *gorm1.DB) (*gorm1.DB, error)
}

type UserORMWithBeforeStrictUpdateCleanup

type UserORMWithBeforeStrictUpdateCleanup interface {
	BeforeStrictUpdateCleanup(context.Context, *gorm1.DB) (*gorm1.DB, error)
}

type UserORMWithBeforeStrictUpdateSave

type UserORMWithBeforeStrictUpdateSave interface {
	BeforeStrictUpdateSave(context.Context, *gorm1.DB) (*gorm1.DB, error)
}

type UserWithAfterPatchSave

type UserWithAfterPatchSave interface {
	AfterPatchSave(context.Context, *User, *field_mask1.FieldMask, *gorm1.DB) error
}

type UserWithAfterToORM

type UserWithAfterToORM interface {
	AfterToORM(context.Context, *UserORM) error
}

UserAfterToORM called after default ToORM code

type UserWithAfterToPB

type UserWithAfterToPB interface {
	AfterToPB(context.Context, *User) error
}

UserAfterToPB called after default ToPB code

type UserWithBeforePatchApplyFieldMask

type UserWithBeforePatchApplyFieldMask interface {
	BeforePatchApplyFieldMask(context.Context, *User, *field_mask1.FieldMask, *gorm1.DB) (*gorm1.DB, error)
}

type UserWithBeforePatchRead

type UserWithBeforePatchRead interface {
	BeforePatchRead(context.Context, *User, *field_mask1.FieldMask, *gorm1.DB) (*gorm1.DB, error)
}

type UserWithBeforePatchSave

type UserWithBeforePatchSave interface {
	BeforePatchSave(context.Context, *User, *field_mask1.FieldMask, *gorm1.DB) (*gorm1.DB, error)
}

type UserWithBeforeToORM

type UserWithBeforeToORM interface {
	BeforeToORM(context.Context, *UserORM) error
}

UserBeforeToORM called before default ToORM code

type UserWithBeforeToPB

type UserWithBeforeToPB interface {
	BeforeToPB(context.Context, *User) error
}

UserBeforeToPB called before default ToPB code

Jump to

Keyboard shortcuts

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