Documentation
¶
Index ¶
- Constants
- func AddGlobalScopeForAttachment(name string, apply func(builder query.Condition))
- func AddGlobalScopeForJournal(name string, apply func(builder query.Condition))
- func AddGlobalScopeForShare(name string, apply func(builder query.Condition))
- func AddGlobalScopeForSharePlan(name string, apply func(builder query.Condition))
- func AddGlobalScopeForShareUserRel(name string, apply func(builder query.Condition))
- func AddGlobalScopeForUser(name string, apply func(builder query.Condition))
- func AddLocalScopeForAttachment(name string, apply func(builder query.Condition))
- func AddLocalScopeForJournal(name string, apply func(builder query.Condition))
- func AddLocalScopeForShare(name string, apply func(builder query.Condition))
- func AddLocalScopeForSharePlan(name string, apply func(builder query.Condition))
- func AddLocalScopeForShareUserRel(name string, apply func(builder query.Condition))
- func AddLocalScopeForUser(name string, apply func(builder query.Condition))
- func AttachmentFields() []string
- func JournalFields() []string
- func SetAttachmentTable(tableName string)
- func SetJournalTable(tableName string)
- func SetSharePlanTable(tableName string)
- func SetShareTable(tableName string)
- func SetShareUserRelTable(tableName string)
- func SetUserTable(tableName string)
- func ShareFields() []string
- func SharePlanFields() []string
- func ShareUserRelFields() []string
- func UserFields() []string
- type Attachment
- func (inst *Attachment) As(dst interface{}) error
- func (inst *Attachment) Delete() error
- func (inst *Attachment) Save(onlyFields ...string) error
- func (inst *Attachment) SetModel(attachmentModel *AttachmentModel)
- func (inst *Attachment) Staled(onlyFields ...string) bool
- func (inst *Attachment) StaledKV(onlyFields ...string) query.KV
- func (inst *Attachment) String() string
- func (w *Attachment) ToAttachmentPlain() AttachmentPlain
- type AttachmentModel
- func (m *AttachmentModel) Condition(builder query.SQLBuilder) *AttachmentModel
- func (m *AttachmentModel) Count(builders ...query.SQLBuilder) (int64, error)
- func (m *AttachmentModel) Create(kv query.KV) (int64, error)
- func (m *AttachmentModel) Delete(builders ...query.SQLBuilder) (int64, error)
- func (m *AttachmentModel) DeleteById(id int64) (int64, error)
- func (m *AttachmentModel) Exists(builders ...query.SQLBuilder) (bool, error)
- func (m *AttachmentModel) Find(id int64) (Attachment, error)
- func (m *AttachmentModel) First(builders ...query.SQLBuilder) (Attachment, error)
- func (m *AttachmentModel) Get(builders ...query.SQLBuilder) ([]Attachment, error)
- func (m *AttachmentModel) GetDB() query.Database
- func (m *AttachmentModel) Paginate(page int64, perPage int64, builders ...query.SQLBuilder) ([]Attachment, query.PaginateMeta, error)
- func (m *AttachmentModel) Save(attachment Attachment, onlyFields ...string) (int64, error)
- func (m *AttachmentModel) SaveAll(attachments []Attachment) ([]int64, error)
- func (m *AttachmentModel) SaveOrUpdate(attachment Attachment, onlyFields ...string) (id int64, updated bool, err error)
- func (m *AttachmentModel) Update(attachment Attachment, builders ...query.SQLBuilder) (int64, error)
- func (m *AttachmentModel) UpdateById(id int64, attachment Attachment, onlyFields ...string) (int64, error)
- func (m *AttachmentModel) UpdateFields(kv query.KV, builders ...query.SQLBuilder) (int64, error)
- func (m *AttachmentModel) UpdatePart(attachment Attachment, onlyFields ...string) (int64, error)
- func (m *AttachmentModel) WithLocalScopes(names ...string) *AttachmentModel
- func (m *AttachmentModel) WithoutGlobalScopes(names ...string) *AttachmentModel
- type AttachmentPlain
- type Journal
- func (inst *Journal) As(dst interface{}) error
- func (inst *Journal) Delete() error
- func (inst *Journal) Save(onlyFields ...string) error
- func (inst *Journal) SetModel(journalModel *JournalModel)
- func (inst *Journal) Staled(onlyFields ...string) bool
- func (inst *Journal) StaledKV(onlyFields ...string) query.KV
- func (inst *Journal) String() string
- func (w *Journal) ToJournalPlain() JournalPlain
- type JournalModel
- func (m *JournalModel) Condition(builder query.SQLBuilder) *JournalModel
- func (m *JournalModel) Count(builders ...query.SQLBuilder) (int64, error)
- func (m *JournalModel) Create(kv query.KV) (int64, error)
- func (m *JournalModel) Delete(builders ...query.SQLBuilder) (int64, error)
- func (m *JournalModel) DeleteById(id int64) (int64, error)
- func (m *JournalModel) Exists(builders ...query.SQLBuilder) (bool, error)
- func (m *JournalModel) Find(id int64) (Journal, error)
- func (m *JournalModel) First(builders ...query.SQLBuilder) (Journal, error)
- func (m *JournalModel) Get(builders ...query.SQLBuilder) ([]Journal, error)
- func (m *JournalModel) GetDB() query.Database
- func (m *JournalModel) Paginate(page int64, perPage int64, builders ...query.SQLBuilder) ([]Journal, query.PaginateMeta, error)
- func (m *JournalModel) Save(journal Journal, onlyFields ...string) (int64, error)
- func (m *JournalModel) SaveAll(journals []Journal) ([]int64, error)
- func (m *JournalModel) SaveOrUpdate(journal Journal, onlyFields ...string) (id int64, updated bool, err error)
- func (m *JournalModel) Update(journal Journal, builders ...query.SQLBuilder) (int64, error)
- func (m *JournalModel) UpdateById(id int64, journal Journal, onlyFields ...string) (int64, error)
- func (m *JournalModel) UpdateFields(kv query.KV, builders ...query.SQLBuilder) (int64, error)
- func (m *JournalModel) UpdatePart(journal Journal, onlyFields ...string) (int64, error)
- func (m *JournalModel) WithLocalScopes(names ...string) *JournalModel
- func (m *JournalModel) WithoutGlobalScopes(names ...string) *JournalModel
- type JournalPlain
- type Share
- func (inst *Share) As(dst interface{}) error
- func (inst *Share) Delete() error
- func (inst *Share) Save(onlyFields ...string) error
- func (inst *Share) SetModel(shareModel *ShareModel)
- func (inst *Share) SharePlan() *ShareHasOneSharePlanRel
- func (inst *Share) ShareUserRels() *ShareHasManyShareUserRelRel
- func (inst *Share) Staled(onlyFields ...string) bool
- func (inst *Share) StaledKV(onlyFields ...string) query.KV
- func (inst *Share) String() string
- func (w *Share) ToSharePlain() SharePlain
- type ShareHasManyShareUserRelRel
- func (rel *ShareHasManyShareUserRelRel) Count(builders ...query.SQLBuilder) (int64, error)
- func (rel *ShareHasManyShareUserRelRel) Create(target ShareUserRel) (int64, error)
- func (rel *ShareHasManyShareUserRelRel) Exists(builders ...query.SQLBuilder) (bool, error)
- func (rel *ShareHasManyShareUserRelRel) First(builders ...query.SQLBuilder) (ShareUserRel, error)
- func (rel *ShareHasManyShareUserRelRel) Get(builders ...query.SQLBuilder) ([]ShareUserRel, error)
- type ShareHasOneSharePlanRel
- func (rel *ShareHasOneSharePlanRel) Associate(target SharePlan) error
- func (rel *ShareHasOneSharePlanRel) Create(target SharePlan) (int64, error)
- func (rel *ShareHasOneSharePlanRel) Dissociate() error
- func (rel *ShareHasOneSharePlanRel) Exists(builders ...query.SQLBuilder) (bool, error)
- func (rel *ShareHasOneSharePlanRel) First(builders ...query.SQLBuilder) (SharePlan, error)
- type ShareModel
- func (m *ShareModel) Condition(builder query.SQLBuilder) *ShareModel
- func (m *ShareModel) Count(builders ...query.SQLBuilder) (int64, error)
- func (m *ShareModel) Create(kv query.KV) (int64, error)
- func (m *ShareModel) Delete(builders ...query.SQLBuilder) (int64, error)
- func (m *ShareModel) DeleteById(id int64) (int64, error)
- func (m *ShareModel) Exists(builders ...query.SQLBuilder) (bool, error)
- func (m *ShareModel) Find(id int64) (Share, error)
- func (m *ShareModel) First(builders ...query.SQLBuilder) (Share, error)
- func (m *ShareModel) ForceDelete(builders ...query.SQLBuilder) (int64, error)
- func (m *ShareModel) ForceDeleteById(id int64) (int64, error)
- func (m *ShareModel) Get(builders ...query.SQLBuilder) ([]Share, error)
- func (m *ShareModel) GetDB() query.Database
- func (m *ShareModel) Paginate(page int64, perPage int64, builders ...query.SQLBuilder) ([]Share, query.PaginateMeta, error)
- func (m *ShareModel) Restore(builders ...query.SQLBuilder) (int64, error)
- func (m *ShareModel) RestoreById(id int64) (int64, error)
- func (m *ShareModel) Save(share Share, onlyFields ...string) (int64, error)
- func (m *ShareModel) SaveAll(shares []Share) ([]int64, error)
- func (m *ShareModel) SaveOrUpdate(share Share, onlyFields ...string) (id int64, updated bool, err error)
- func (m *ShareModel) Update(share Share, builders ...query.SQLBuilder) (int64, error)
- func (m *ShareModel) UpdateById(id int64, share Share, onlyFields ...string) (int64, error)
- func (m *ShareModel) UpdateFields(kv query.KV, builders ...query.SQLBuilder) (int64, error)
- func (m *ShareModel) UpdatePart(share Share, onlyFields ...string) (int64, error)
- func (m *ShareModel) WithLocalScopes(names ...string) *ShareModel
- func (m *ShareModel) WithTrashed() *ShareModel
- func (m *ShareModel) WithoutGlobalScopes(names ...string) *ShareModel
- type SharePlain
- type SharePlan
- func (inst *SharePlan) As(dst interface{}) error
- func (inst *SharePlan) Delete() error
- func (inst *SharePlan) Save(onlyFields ...string) error
- func (inst *SharePlan) SetModel(sharePlanModel *SharePlanModel)
- func (inst *SharePlan) Share() *SharePlanBelongsToShareRel
- func (inst *SharePlan) Staled(onlyFields ...string) bool
- func (inst *SharePlan) StaledKV(onlyFields ...string) query.KV
- func (inst *SharePlan) String() string
- func (w *SharePlan) ToSharePlanPlain() SharePlanPlain
- type SharePlanBelongsToShareRel
- func (rel *SharePlanBelongsToShareRel) Associate(target Share) error
- func (rel *SharePlanBelongsToShareRel) Create(target Share) (int64, error)
- func (rel *SharePlanBelongsToShareRel) Dissociate() error
- func (rel *SharePlanBelongsToShareRel) Exists(builders ...query.SQLBuilder) (bool, error)
- func (rel *SharePlanBelongsToShareRel) First(builders ...query.SQLBuilder) (Share, error)
- type SharePlanModel
- func (m *SharePlanModel) Condition(builder query.SQLBuilder) *SharePlanModel
- func (m *SharePlanModel) Count(builders ...query.SQLBuilder) (int64, error)
- func (m *SharePlanModel) Create(kv query.KV) (int64, error)
- func (m *SharePlanModel) Delete(builders ...query.SQLBuilder) (int64, error)
- func (m *SharePlanModel) DeleteById(id int64) (int64, error)
- func (m *SharePlanModel) Exists(builders ...query.SQLBuilder) (bool, error)
- func (m *SharePlanModel) Find(id int64) (SharePlan, error)
- func (m *SharePlanModel) First(builders ...query.SQLBuilder) (SharePlan, error)
- func (m *SharePlanModel) Get(builders ...query.SQLBuilder) ([]SharePlan, error)
- func (m *SharePlanModel) GetDB() query.Database
- func (m *SharePlanModel) Paginate(page int64, perPage int64, builders ...query.SQLBuilder) ([]SharePlan, query.PaginateMeta, error)
- func (m *SharePlanModel) Save(sharePlan SharePlan, onlyFields ...string) (int64, error)
- func (m *SharePlanModel) SaveAll(sharePlans []SharePlan) ([]int64, error)
- func (m *SharePlanModel) SaveOrUpdate(sharePlan SharePlan, onlyFields ...string) (id int64, updated bool, err error)
- func (m *SharePlanModel) Update(sharePlan SharePlan, builders ...query.SQLBuilder) (int64, error)
- func (m *SharePlanModel) UpdateById(id int64, sharePlan SharePlan, onlyFields ...string) (int64, error)
- func (m *SharePlanModel) UpdateFields(kv query.KV, builders ...query.SQLBuilder) (int64, error)
- func (m *SharePlanModel) UpdatePart(sharePlan SharePlan, onlyFields ...string) (int64, error)
- func (m *SharePlanModel) WithLocalScopes(names ...string) *SharePlanModel
- func (m *SharePlanModel) WithoutGlobalScopes(names ...string) *SharePlanModel
- type SharePlanPlain
- type ShareUserRel
- func (inst *ShareUserRel) As(dst interface{}) error
- func (inst *ShareUserRel) Delete() error
- func (inst *ShareUserRel) Save(onlyFields ...string) error
- func (inst *ShareUserRel) SetModel(shareUserRelModel *ShareUserRelModel)
- func (inst *ShareUserRel) Staled(onlyFields ...string) bool
- func (inst *ShareUserRel) StaledKV(onlyFields ...string) query.KV
- func (inst *ShareUserRel) String() string
- func (w *ShareUserRel) ToShareUserRelPlain() ShareUserRelPlain
- func (inst *ShareUserRel) User() *ShareUserRelBelongsToUserRel
- type ShareUserRelBelongsToUserRel
- func (rel *ShareUserRelBelongsToUserRel) Associate(target User) error
- func (rel *ShareUserRelBelongsToUserRel) Create(target User) (int64, error)
- func (rel *ShareUserRelBelongsToUserRel) Dissociate() error
- func (rel *ShareUserRelBelongsToUserRel) Exists(builders ...query.SQLBuilder) (bool, error)
- func (rel *ShareUserRelBelongsToUserRel) First(builders ...query.SQLBuilder) (User, error)
- type ShareUserRelModel
- func (m *ShareUserRelModel) Condition(builder query.SQLBuilder) *ShareUserRelModel
- func (m *ShareUserRelModel) Count(builders ...query.SQLBuilder) (int64, error)
- func (m *ShareUserRelModel) Create(kv query.KV) (int64, error)
- func (m *ShareUserRelModel) Delete(builders ...query.SQLBuilder) (int64, error)
- func (m *ShareUserRelModel) DeleteById(id int64) (int64, error)
- func (m *ShareUserRelModel) Exists(builders ...query.SQLBuilder) (bool, error)
- func (m *ShareUserRelModel) Find(id int64) (ShareUserRel, error)
- func (m *ShareUserRelModel) First(builders ...query.SQLBuilder) (ShareUserRel, error)
- func (m *ShareUserRelModel) Get(builders ...query.SQLBuilder) ([]ShareUserRel, error)
- func (m *ShareUserRelModel) GetDB() query.Database
- func (m *ShareUserRelModel) Paginate(page int64, perPage int64, builders ...query.SQLBuilder) ([]ShareUserRel, query.PaginateMeta, error)
- func (m *ShareUserRelModel) Save(shareUserRel ShareUserRel, onlyFields ...string) (int64, error)
- func (m *ShareUserRelModel) SaveAll(shareUserRels []ShareUserRel) ([]int64, error)
- func (m *ShareUserRelModel) SaveOrUpdate(shareUserRel ShareUserRel, onlyFields ...string) (id int64, updated bool, err error)
- func (m *ShareUserRelModel) Update(shareUserRel ShareUserRel, builders ...query.SQLBuilder) (int64, error)
- func (m *ShareUserRelModel) UpdateById(id int64, shareUserRel ShareUserRel, onlyFields ...string) (int64, error)
- func (m *ShareUserRelModel) UpdateFields(kv query.KV, builders ...query.SQLBuilder) (int64, error)
- func (m *ShareUserRelModel) UpdatePart(shareUserRel ShareUserRel, onlyFields ...string) (int64, error)
- func (m *ShareUserRelModel) WithLocalScopes(names ...string) *ShareUserRelModel
- func (m *ShareUserRelModel) WithoutGlobalScopes(names ...string) *ShareUserRelModel
- type ShareUserRelPlain
- type User
- func (inst *User) As(dst interface{}) error
- func (inst *User) Delete() error
- func (inst *User) Save(onlyFields ...string) error
- func (inst *User) SetModel(userModel *UserModel)
- func (inst *User) Staled(onlyFields ...string) bool
- func (inst *User) StaledKV(onlyFields ...string) query.KV
- func (inst *User) String() string
- func (w *User) ToUserPlain() UserPlain
- type UserModel
- func (m *UserModel) Condition(builder query.SQLBuilder) *UserModel
- func (m *UserModel) Count(builders ...query.SQLBuilder) (int64, error)
- func (m *UserModel) Create(kv query.KV) (int64, error)
- func (m *UserModel) Delete(builders ...query.SQLBuilder) (int64, error)
- func (m *UserModel) DeleteById(id int64) (int64, error)
- func (m *UserModel) Exists(builders ...query.SQLBuilder) (bool, error)
- func (m *UserModel) Find(id int64) (User, error)
- func (m *UserModel) First(builders ...query.SQLBuilder) (User, error)
- func (m *UserModel) Get(builders ...query.SQLBuilder) ([]User, error)
- func (m *UserModel) GetDB() query.Database
- func (m *UserModel) Paginate(page int64, perPage int64, builders ...query.SQLBuilder) ([]User, query.PaginateMeta, error)
- func (m *UserModel) Save(user User, onlyFields ...string) (int64, error)
- func (m *UserModel) SaveAll(users []User) ([]int64, error)
- func (m *UserModel) SaveOrUpdate(user User, onlyFields ...string) (id int64, updated bool, err error)
- func (m *UserModel) Update(user User, builders ...query.SQLBuilder) (int64, error)
- func (m *UserModel) UpdateById(id int64, user User, onlyFields ...string) (int64, error)
- func (m *UserModel) UpdateFields(kv query.KV, builders ...query.SQLBuilder) (int64, error)
- func (m *UserModel) UpdatePart(user User, onlyFields ...string) (int64, error)
- func (m *UserModel) WithLocalScopes(names ...string) *UserModel
- func (m *UserModel) WithoutGlobalScopes(names ...string) *UserModel
- type UserPlain
Constants ¶
const ( AttachmentFieldId = "id" AttachmentFieldName = "name" AttachmentFieldAttaType = "atta_type" AttachmentFieldAttaPath = "atta_path" AttachmentFieldCreatedAt = "created_at" )
const ( JournalFieldId = "id" JournalFieldAction = "action" JournalFieldParams = "params" JournalFieldTriggerUserId = "trigger_user_id" JournalFieldCreatedAt = "created_at" )
const ()
const ()
const ()
const ( UserFieldId = "id" UserFieldUuid = "uuid" UserFieldName = "name" UserFieldAccount = "account" UserFieldStatus = "status" UserFieldPassword = "password" UserFieldCreatedAt = "created_at" UserFieldUpdatedAt = "updated_at" )
Variables ¶
This section is empty.
Functions ¶
func AddGlobalScopeForAttachment ¶
AddGlobalScopeForAttachment assign a global scope to a model
func AddGlobalScopeForJournal ¶
AddGlobalScopeForJournal assign a global scope to a model
func AddGlobalScopeForShare ¶
AddGlobalScopeForShare assign a global scope to a model
func AddGlobalScopeForSharePlan ¶
AddGlobalScopeForSharePlan assign a global scope to a model
func AddGlobalScopeForShareUserRel ¶
AddGlobalScopeForShareUserRel assign a global scope to a model
func AddGlobalScopeForUser ¶
AddGlobalScopeForUser assign a global scope to a model
func AddLocalScopeForAttachment ¶
AddLocalScopeForAttachment assign a local scope to a model
func AddLocalScopeForJournal ¶
AddLocalScopeForJournal assign a local scope to a model
func AddLocalScopeForShare ¶
AddLocalScopeForShare assign a local scope to a model
func AddLocalScopeForSharePlan ¶
AddLocalScopeForSharePlan assign a local scope to a model
func AddLocalScopeForShareUserRel ¶
AddLocalScopeForShareUserRel assign a local scope to a model
func AddLocalScopeForUser ¶
AddLocalScopeForUser assign a local scope to a model
func AttachmentFields ¶
func AttachmentFields() []string
AttachmentFields return all fields in Attachment model
func SetAttachmentTable ¶
func SetAttachmentTable(tableName string)
func SetJournalTable ¶
func SetJournalTable(tableName string)
func SetSharePlanTable ¶
func SetSharePlanTable(tableName string)
func SetShareTable ¶
func SetShareTable(tableName string)
func SetShareUserRelTable ¶
func SetShareUserRelTable(tableName string)
func SetUserTable ¶
func SetUserTable(tableName string)
func SharePlanFields ¶
func SharePlanFields() []string
SharePlanFields return all fields in SharePlan model
func ShareUserRelFields ¶
func ShareUserRelFields() []string
ShareUserRelFields return all fields in ShareUserRel model
Types ¶
type Attachment ¶
type Attachment struct { Id null.Int Name null.String AttaType null.String AttaPath null.String CreatedAt null.Time // contains filtered or unexported fields }
Attachment is a Attachment object
func (*Attachment) As ¶
func (inst *Attachment) As(dst interface{}) error
As convert object to other type dst must be a pointer to struct
func (*Attachment) Save ¶
func (inst *Attachment) Save(onlyFields ...string) error
Save create a new model or update it
func (*Attachment) SetModel ¶
func (inst *Attachment) SetModel(attachmentModel *AttachmentModel)
SetModel set model for Attachment
func (*Attachment) Staled ¶
func (inst *Attachment) Staled(onlyFields ...string) bool
Staled identify whether the object has been modified
func (*Attachment) StaledKV ¶
func (inst *Attachment) StaledKV(onlyFields ...string) query.KV
StaledKV return all fields has been modified
func (*Attachment) String ¶
func (inst *Attachment) String() string
String convert instance to json string
func (*Attachment) ToAttachmentPlain ¶
func (w *Attachment) ToAttachmentPlain() AttachmentPlain
type AttachmentModel ¶
type AttachmentModel struct {
// contains filtered or unexported fields
}
AttachmentModel is a model which encapsulates the operations of the object
func NewAttachmentModel ¶
func NewAttachmentModel(db query.Database) *AttachmentModel
NewAttachmentModel create a AttachmentModel
func (*AttachmentModel) Condition ¶
func (m *AttachmentModel) Condition(builder query.SQLBuilder) *AttachmentModel
Condition add query builder to model
func (*AttachmentModel) Count ¶
func (m *AttachmentModel) Count(builders ...query.SQLBuilder) (int64, error)
Count return model count for a given query
func (*AttachmentModel) Create ¶
func (m *AttachmentModel) Create(kv query.KV) (int64, error)
Create save a new attachment to database
func (*AttachmentModel) Delete ¶
func (m *AttachmentModel) Delete(builders ...query.SQLBuilder) (int64, error)
Delete remove a model
func (*AttachmentModel) DeleteById ¶
func (m *AttachmentModel) DeleteById(id int64) (int64, error)
DeleteById remove a model by id
func (*AttachmentModel) Exists ¶
func (m *AttachmentModel) Exists(builders ...query.SQLBuilder) (bool, error)
Exists return whether the records exists for a given query
func (*AttachmentModel) Find ¶
func (m *AttachmentModel) Find(id int64) (Attachment, error)
Find retrieve a model by its primary key
func (*AttachmentModel) First ¶
func (m *AttachmentModel) First(builders ...query.SQLBuilder) (Attachment, error)
First return first result for given query
func (*AttachmentModel) Get ¶
func (m *AttachmentModel) Get(builders ...query.SQLBuilder) ([]Attachment, error)
Get retrieve all results for given query
func (*AttachmentModel) GetDB ¶
func (m *AttachmentModel) GetDB() query.Database
GetDB return database instance
func (*AttachmentModel) Paginate ¶
func (m *AttachmentModel) Paginate(page int64, perPage int64, builders ...query.SQLBuilder) ([]Attachment, query.PaginateMeta, error)
func (*AttachmentModel) Save ¶
func (m *AttachmentModel) Save(attachment Attachment, onlyFields ...string) (int64, error)
Save save a attachment to database
func (*AttachmentModel) SaveAll ¶
func (m *AttachmentModel) SaveAll(attachments []Attachment) ([]int64, error)
SaveAll save all attachments to database
func (*AttachmentModel) SaveOrUpdate ¶
func (m *AttachmentModel) SaveOrUpdate(attachment Attachment, onlyFields ...string) (id int64, updated bool, err error)
SaveOrUpdate save a new attachment or update it when it has a id > 0
func (*AttachmentModel) Update ¶
func (m *AttachmentModel) Update(attachment Attachment, builders ...query.SQLBuilder) (int64, error)
Update update a model for given query
func (*AttachmentModel) UpdateById ¶
func (m *AttachmentModel) UpdateById(id int64, attachment Attachment, onlyFields ...string) (int64, error)
UpdateById update a model by id
func (*AttachmentModel) UpdateFields ¶
func (m *AttachmentModel) UpdateFields(kv query.KV, builders ...query.SQLBuilder) (int64, error)
UpdateFields update kv for a given query
func (*AttachmentModel) UpdatePart ¶
func (m *AttachmentModel) UpdatePart(attachment Attachment, onlyFields ...string) (int64, error)
UpdatePart update a model for given query
func (*AttachmentModel) WithLocalScopes ¶
func (m *AttachmentModel) WithLocalScopes(names ...string) *AttachmentModel
WithLocalScopes add a local scope for given query
func (*AttachmentModel) WithoutGlobalScopes ¶
func (m *AttachmentModel) WithoutGlobalScopes(names ...string) *AttachmentModel
WithoutGlobalScopes remove a global scope for given query
type AttachmentPlain ¶
type AttachmentPlain struct { Id int64 Name string AttaType string AttaPath string CreatedAt time.Time }
func (AttachmentPlain) As ¶
func (w AttachmentPlain) As(dst interface{}) error
As convert object to other type dst must be a pointer to struct
func (AttachmentPlain) ToAttachment ¶
func (w AttachmentPlain) ToAttachment(allows ...string) Attachment
type Journal ¶
type Journal struct { Id null.Int Action null.String Params null.String TriggerUserId null.Int CreatedAt null.Time // contains filtered or unexported fields }
Journal is a Journal object
func (*Journal) SetModel ¶
func (inst *Journal) SetModel(journalModel *JournalModel)
SetModel set model for Journal
func (*Journal) ToJournalPlain ¶
func (w *Journal) ToJournalPlain() JournalPlain
type JournalModel ¶
type JournalModel struct {
// contains filtered or unexported fields
}
JournalModel is a model which encapsulates the operations of the object
func NewJournalModel ¶
func NewJournalModel(db query.Database) *JournalModel
NewJournalModel create a JournalModel
func (*JournalModel) Condition ¶
func (m *JournalModel) Condition(builder query.SQLBuilder) *JournalModel
Condition add query builder to model
func (*JournalModel) Count ¶
func (m *JournalModel) Count(builders ...query.SQLBuilder) (int64, error)
Count return model count for a given query
func (*JournalModel) Create ¶
func (m *JournalModel) Create(kv query.KV) (int64, error)
Create save a new journal to database
func (*JournalModel) Delete ¶
func (m *JournalModel) Delete(builders ...query.SQLBuilder) (int64, error)
Delete remove a model
func (*JournalModel) DeleteById ¶
func (m *JournalModel) DeleteById(id int64) (int64, error)
DeleteById remove a model by id
func (*JournalModel) Exists ¶
func (m *JournalModel) Exists(builders ...query.SQLBuilder) (bool, error)
Exists return whether the records exists for a given query
func (*JournalModel) Find ¶
func (m *JournalModel) Find(id int64) (Journal, error)
Find retrieve a model by its primary key
func (*JournalModel) First ¶
func (m *JournalModel) First(builders ...query.SQLBuilder) (Journal, error)
First return first result for given query
func (*JournalModel) Get ¶
func (m *JournalModel) Get(builders ...query.SQLBuilder) ([]Journal, error)
Get retrieve all results for given query
func (*JournalModel) GetDB ¶
func (m *JournalModel) GetDB() query.Database
GetDB return database instance
func (*JournalModel) Paginate ¶
func (m *JournalModel) Paginate(page int64, perPage int64, builders ...query.SQLBuilder) ([]Journal, query.PaginateMeta, error)
func (*JournalModel) Save ¶
func (m *JournalModel) Save(journal Journal, onlyFields ...string) (int64, error)
Save save a journal to database
func (*JournalModel) SaveAll ¶
func (m *JournalModel) SaveAll(journals []Journal) ([]int64, error)
SaveAll save all journals to database
func (*JournalModel) SaveOrUpdate ¶
func (m *JournalModel) SaveOrUpdate(journal Journal, onlyFields ...string) (id int64, updated bool, err error)
SaveOrUpdate save a new journal or update it when it has a id > 0
func (*JournalModel) Update ¶
func (m *JournalModel) Update(journal Journal, builders ...query.SQLBuilder) (int64, error)
Update update a model for given query
func (*JournalModel) UpdateById ¶
UpdateById update a model by id
func (*JournalModel) UpdateFields ¶
func (m *JournalModel) UpdateFields(kv query.KV, builders ...query.SQLBuilder) (int64, error)
UpdateFields update kv for a given query
func (*JournalModel) UpdatePart ¶
func (m *JournalModel) UpdatePart(journal Journal, onlyFields ...string) (int64, error)
UpdatePart update a model for given query
func (*JournalModel) WithLocalScopes ¶
func (m *JournalModel) WithLocalScopes(names ...string) *JournalModel
WithLocalScopes add a local scope for given query
func (*JournalModel) WithoutGlobalScopes ¶
func (m *JournalModel) WithoutGlobalScopes(names ...string) *JournalModel
WithoutGlobalScopes remove a global scope for given query
type JournalPlain ¶
type JournalPlain struct { Id int64 Action string Params string TriggerUserId int64 CreatedAt time.Time }
func (JournalPlain) As ¶
func (w JournalPlain) As(dst interface{}) error
As convert object to other type dst must be a pointer to struct
func (JournalPlain) ToJournal ¶
func (w JournalPlain) ToJournal(allows ...string) Journal
type Share ¶
type Share struct { // contains filtered or unexported fields }
Share is a Share object
func (*Share) SetModel ¶
func (inst *Share) SetModel(shareModel *ShareModel)
SetModel set model for Share
func (*Share) SharePlan ¶
func (inst *Share) SharePlan() *ShareHasOneSharePlanRel
func (*Share) ShareUserRels ¶
func (inst *Share) ShareUserRels() *ShareHasManyShareUserRelRel
func (*Share) ToSharePlain ¶
func (w *Share) ToSharePlain() SharePlain
type ShareHasManyShareUserRelRel ¶
type ShareHasManyShareUserRelRel struct {
// contains filtered or unexported fields
}
func (*ShareHasManyShareUserRelRel) Count ¶
func (rel *ShareHasManyShareUserRelRel) Count(builders ...query.SQLBuilder) (int64, error)
func (*ShareHasManyShareUserRelRel) Create ¶
func (rel *ShareHasManyShareUserRelRel) Create(target ShareUserRel) (int64, error)
func (*ShareHasManyShareUserRelRel) Exists ¶
func (rel *ShareHasManyShareUserRelRel) Exists(builders ...query.SQLBuilder) (bool, error)
func (*ShareHasManyShareUserRelRel) First ¶
func (rel *ShareHasManyShareUserRelRel) First(builders ...query.SQLBuilder) (ShareUserRel, error)
func (*ShareHasManyShareUserRelRel) Get ¶
func (rel *ShareHasManyShareUserRelRel) Get(builders ...query.SQLBuilder) ([]ShareUserRel, error)
type ShareHasOneSharePlanRel ¶
type ShareHasOneSharePlanRel struct {
// contains filtered or unexported fields
}
func (*ShareHasOneSharePlanRel) Associate ¶
func (rel *ShareHasOneSharePlanRel) Associate(target SharePlan) error
func (*ShareHasOneSharePlanRel) Create ¶
func (rel *ShareHasOneSharePlanRel) Create(target SharePlan) (int64, error)
func (*ShareHasOneSharePlanRel) Dissociate ¶
func (rel *ShareHasOneSharePlanRel) Dissociate() error
func (*ShareHasOneSharePlanRel) Exists ¶
func (rel *ShareHasOneSharePlanRel) Exists(builders ...query.SQLBuilder) (bool, error)
func (*ShareHasOneSharePlanRel) First ¶
func (rel *ShareHasOneSharePlanRel) First(builders ...query.SQLBuilder) (SharePlan, error)
type ShareModel ¶
type ShareModel struct {
// contains filtered or unexported fields
}
ShareModel is a model which encapsulates the operations of the object
func NewShareModel ¶
func NewShareModel(db query.Database) *ShareModel
NewShareModel create a ShareModel
func (*ShareModel) Condition ¶
func (m *ShareModel) Condition(builder query.SQLBuilder) *ShareModel
Condition add query builder to model
func (*ShareModel) Count ¶
func (m *ShareModel) Count(builders ...query.SQLBuilder) (int64, error)
Count return model count for a given query
func (*ShareModel) Create ¶
func (m *ShareModel) Create(kv query.KV) (int64, error)
Create save a new share to database
func (*ShareModel) Delete ¶
func (m *ShareModel) Delete(builders ...query.SQLBuilder) (int64, error)
Delete remove a model
func (*ShareModel) DeleteById ¶
func (m *ShareModel) DeleteById(id int64) (int64, error)
DeleteById remove a model by id
func (*ShareModel) Exists ¶
func (m *ShareModel) Exists(builders ...query.SQLBuilder) (bool, error)
Exists return whether the records exists for a given query
func (*ShareModel) Find ¶
func (m *ShareModel) Find(id int64) (Share, error)
Find retrieve a model by its primary key
func (*ShareModel) First ¶
func (m *ShareModel) First(builders ...query.SQLBuilder) (Share, error)
First return first result for given query
func (*ShareModel) ForceDelete ¶
func (m *ShareModel) ForceDelete(builders ...query.SQLBuilder) (int64, error)
ForceDelete permanently remove a soft deleted model from the database
func (*ShareModel) ForceDeleteById ¶
func (m *ShareModel) ForceDeleteById(id int64) (int64, error)
ForceDeleteById permanently remove a soft deleted model from the database by id
func (*ShareModel) Get ¶
func (m *ShareModel) Get(builders ...query.SQLBuilder) ([]Share, error)
Get retrieve all results for given query
func (*ShareModel) GetDB ¶
func (m *ShareModel) GetDB() query.Database
GetDB return database instance
func (*ShareModel) Paginate ¶
func (m *ShareModel) Paginate(page int64, perPage int64, builders ...query.SQLBuilder) ([]Share, query.PaginateMeta, error)
func (*ShareModel) Restore ¶
func (m *ShareModel) Restore(builders ...query.SQLBuilder) (int64, error)
Restore restore a soft deleted model into an active state
func (*ShareModel) RestoreById ¶
func (m *ShareModel) RestoreById(id int64) (int64, error)
RestoreById restore a soft deleted model into an active state by id
func (*ShareModel) Save ¶
func (m *ShareModel) Save(share Share, onlyFields ...string) (int64, error)
Save save a share to database
func (*ShareModel) SaveAll ¶
func (m *ShareModel) SaveAll(shares []Share) ([]int64, error)
SaveAll save all shares to database
func (*ShareModel) SaveOrUpdate ¶
func (m *ShareModel) SaveOrUpdate(share Share, onlyFields ...string) (id int64, updated bool, err error)
SaveOrUpdate save a new share or update it when it has a id > 0
func (*ShareModel) Update ¶
func (m *ShareModel) Update(share Share, builders ...query.SQLBuilder) (int64, error)
Update update a model for given query
func (*ShareModel) UpdateById ¶
UpdateById update a model by id
func (*ShareModel) UpdateFields ¶
func (m *ShareModel) UpdateFields(kv query.KV, builders ...query.SQLBuilder) (int64, error)
UpdateFields update kv for a given query
func (*ShareModel) UpdatePart ¶
func (m *ShareModel) UpdatePart(share Share, onlyFields ...string) (int64, error)
UpdatePart update a model for given query
func (*ShareModel) WithLocalScopes ¶
func (m *ShareModel) WithLocalScopes(names ...string) *ShareModel
WithLocalScopes add a local scope for given query
func (*ShareModel) WithTrashed ¶
func (m *ShareModel) WithTrashed() *ShareModel
WithTrashed force soft deleted models to appear in a result set
func (*ShareModel) WithoutGlobalScopes ¶
func (m *ShareModel) WithoutGlobalScopes(names ...string) *ShareModel
WithoutGlobalScopes remove a global scope for given query
type SharePlain ¶
type SharePlain struct {}
func (SharePlain) As ¶
func (w SharePlain) As(dst interface{}) error
As convert object to other type dst must be a pointer to struct
func (SharePlain) ToShare ¶
func (w SharePlain) ToShare(allows ...string) Share
type SharePlan ¶
type SharePlan struct { // contains filtered or unexported fields }
SharePlan is a SharePlan object
func (*SharePlan) SetModel ¶
func (inst *SharePlan) SetModel(sharePlanModel *SharePlanModel)
SetModel set model for SharePlan
func (*SharePlan) Share ¶
func (inst *SharePlan) Share() *SharePlanBelongsToShareRel
func (*SharePlan) ToSharePlanPlain ¶
func (w *SharePlan) ToSharePlanPlain() SharePlanPlain
type SharePlanBelongsToShareRel ¶
type SharePlanBelongsToShareRel struct {
// contains filtered or unexported fields
}
func (*SharePlanBelongsToShareRel) Associate ¶
func (rel *SharePlanBelongsToShareRel) Associate(target Share) error
func (*SharePlanBelongsToShareRel) Create ¶
func (rel *SharePlanBelongsToShareRel) Create(target Share) (int64, error)
func (*SharePlanBelongsToShareRel) Dissociate ¶
func (rel *SharePlanBelongsToShareRel) Dissociate() error
func (*SharePlanBelongsToShareRel) Exists ¶
func (rel *SharePlanBelongsToShareRel) Exists(builders ...query.SQLBuilder) (bool, error)
func (*SharePlanBelongsToShareRel) First ¶
func (rel *SharePlanBelongsToShareRel) First(builders ...query.SQLBuilder) (Share, error)
type SharePlanModel ¶
type SharePlanModel struct {
// contains filtered or unexported fields
}
SharePlanModel is a model which encapsulates the operations of the object
func NewSharePlanModel ¶
func NewSharePlanModel(db query.Database) *SharePlanModel
NewSharePlanModel create a SharePlanModel
func (*SharePlanModel) Condition ¶
func (m *SharePlanModel) Condition(builder query.SQLBuilder) *SharePlanModel
Condition add query builder to model
func (*SharePlanModel) Count ¶
func (m *SharePlanModel) Count(builders ...query.SQLBuilder) (int64, error)
Count return model count for a given query
func (*SharePlanModel) Create ¶
func (m *SharePlanModel) Create(kv query.KV) (int64, error)
Create save a new share_plan to database
func (*SharePlanModel) Delete ¶
func (m *SharePlanModel) Delete(builders ...query.SQLBuilder) (int64, error)
Delete remove a model
func (*SharePlanModel) DeleteById ¶
func (m *SharePlanModel) DeleteById(id int64) (int64, error)
DeleteById remove a model by id
func (*SharePlanModel) Exists ¶
func (m *SharePlanModel) Exists(builders ...query.SQLBuilder) (bool, error)
Exists return whether the records exists for a given query
func (*SharePlanModel) Find ¶
func (m *SharePlanModel) Find(id int64) (SharePlan, error)
Find retrieve a model by its primary key
func (*SharePlanModel) First ¶
func (m *SharePlanModel) First(builders ...query.SQLBuilder) (SharePlan, error)
First return first result for given query
func (*SharePlanModel) Get ¶
func (m *SharePlanModel) Get(builders ...query.SQLBuilder) ([]SharePlan, error)
Get retrieve all results for given query
func (*SharePlanModel) GetDB ¶
func (m *SharePlanModel) GetDB() query.Database
GetDB return database instance
func (*SharePlanModel) Paginate ¶
func (m *SharePlanModel) Paginate(page int64, perPage int64, builders ...query.SQLBuilder) ([]SharePlan, query.PaginateMeta, error)
func (*SharePlanModel) Save ¶
func (m *SharePlanModel) Save(sharePlan SharePlan, onlyFields ...string) (int64, error)
Save save a share_plan to database
func (*SharePlanModel) SaveAll ¶
func (m *SharePlanModel) SaveAll(sharePlans []SharePlan) ([]int64, error)
SaveAll save all share_plans to database
func (*SharePlanModel) SaveOrUpdate ¶
func (m *SharePlanModel) SaveOrUpdate(sharePlan SharePlan, onlyFields ...string) (id int64, updated bool, err error)
SaveOrUpdate save a new share_plan or update it when it has a id > 0
func (*SharePlanModel) Update ¶
func (m *SharePlanModel) Update(sharePlan SharePlan, builders ...query.SQLBuilder) (int64, error)
Update update a model for given query
func (*SharePlanModel) UpdateById ¶
func (m *SharePlanModel) UpdateById(id int64, sharePlan SharePlan, onlyFields ...string) (int64, error)
UpdateById update a model by id
func (*SharePlanModel) UpdateFields ¶
func (m *SharePlanModel) UpdateFields(kv query.KV, builders ...query.SQLBuilder) (int64, error)
UpdateFields update kv for a given query
func (*SharePlanModel) UpdatePart ¶
func (m *SharePlanModel) UpdatePart(sharePlan SharePlan, onlyFields ...string) (int64, error)
UpdatePart update a model for given query
func (*SharePlanModel) WithLocalScopes ¶
func (m *SharePlanModel) WithLocalScopes(names ...string) *SharePlanModel
WithLocalScopes add a local scope for given query
func (*SharePlanModel) WithoutGlobalScopes ¶
func (m *SharePlanModel) WithoutGlobalScopes(names ...string) *SharePlanModel
WithoutGlobalScopes remove a global scope for given query
type SharePlanPlain ¶
type SharePlanPlain struct {}
func (SharePlanPlain) As ¶
func (w SharePlanPlain) As(dst interface{}) error
As convert object to other type dst must be a pointer to struct
func (SharePlanPlain) ToSharePlan ¶
func (w SharePlanPlain) ToSharePlan(allows ...string) SharePlan
type ShareUserRel ¶
type ShareUserRel struct { // contains filtered or unexported fields }
ShareUserRel is a ShareUserRel object
func (*ShareUserRel) As ¶
func (inst *ShareUserRel) As(dst interface{}) error
As convert object to other type dst must be a pointer to struct
func (*ShareUserRel) Delete ¶
func (inst *ShareUserRel) Delete() error
Delete remove a share_user_rel
func (*ShareUserRel) Save ¶
func (inst *ShareUserRel) Save(onlyFields ...string) error
Save create a new model or update it
func (*ShareUserRel) SetModel ¶
func (inst *ShareUserRel) SetModel(shareUserRelModel *ShareUserRelModel)
SetModel set model for ShareUserRel
func (*ShareUserRel) Staled ¶
func (inst *ShareUserRel) Staled(onlyFields ...string) bool
Staled identify whether the object has been modified
func (*ShareUserRel) StaledKV ¶
func (inst *ShareUserRel) StaledKV(onlyFields ...string) query.KV
StaledKV return all fields has been modified
func (*ShareUserRel) String ¶
func (inst *ShareUserRel) String() string
String convert instance to json string
func (*ShareUserRel) ToShareUserRelPlain ¶
func (w *ShareUserRel) ToShareUserRelPlain() ShareUserRelPlain
func (*ShareUserRel) User ¶
func (inst *ShareUserRel) User() *ShareUserRelBelongsToUserRel
type ShareUserRelBelongsToUserRel ¶
type ShareUserRelBelongsToUserRel struct {
// contains filtered or unexported fields
}
func (*ShareUserRelBelongsToUserRel) Associate ¶
func (rel *ShareUserRelBelongsToUserRel) Associate(target User) error
func (*ShareUserRelBelongsToUserRel) Create ¶
func (rel *ShareUserRelBelongsToUserRel) Create(target User) (int64, error)
func (*ShareUserRelBelongsToUserRel) Dissociate ¶
func (rel *ShareUserRelBelongsToUserRel) Dissociate() error
func (*ShareUserRelBelongsToUserRel) Exists ¶
func (rel *ShareUserRelBelongsToUserRel) Exists(builders ...query.SQLBuilder) (bool, error)
func (*ShareUserRelBelongsToUserRel) First ¶
func (rel *ShareUserRelBelongsToUserRel) First(builders ...query.SQLBuilder) (User, error)
type ShareUserRelModel ¶
type ShareUserRelModel struct {
// contains filtered or unexported fields
}
ShareUserRelModel is a model which encapsulates the operations of the object
func NewShareUserRelModel ¶
func NewShareUserRelModel(db query.Database) *ShareUserRelModel
NewShareUserRelModel create a ShareUserRelModel
func (*ShareUserRelModel) Condition ¶
func (m *ShareUserRelModel) Condition(builder query.SQLBuilder) *ShareUserRelModel
Condition add query builder to model
func (*ShareUserRelModel) Count ¶
func (m *ShareUserRelModel) Count(builders ...query.SQLBuilder) (int64, error)
Count return model count for a given query
func (*ShareUserRelModel) Create ¶
func (m *ShareUserRelModel) Create(kv query.KV) (int64, error)
Create save a new share_user_rel to database
func (*ShareUserRelModel) Delete ¶
func (m *ShareUserRelModel) Delete(builders ...query.SQLBuilder) (int64, error)
Delete remove a model
func (*ShareUserRelModel) DeleteById ¶
func (m *ShareUserRelModel) DeleteById(id int64) (int64, error)
DeleteById remove a model by id
func (*ShareUserRelModel) Exists ¶
func (m *ShareUserRelModel) Exists(builders ...query.SQLBuilder) (bool, error)
Exists return whether the records exists for a given query
func (*ShareUserRelModel) Find ¶
func (m *ShareUserRelModel) Find(id int64) (ShareUserRel, error)
Find retrieve a model by its primary key
func (*ShareUserRelModel) First ¶
func (m *ShareUserRelModel) First(builders ...query.SQLBuilder) (ShareUserRel, error)
First return first result for given query
func (*ShareUserRelModel) Get ¶
func (m *ShareUserRelModel) Get(builders ...query.SQLBuilder) ([]ShareUserRel, error)
Get retrieve all results for given query
func (*ShareUserRelModel) GetDB ¶
func (m *ShareUserRelModel) GetDB() query.Database
GetDB return database instance
func (*ShareUserRelModel) Paginate ¶
func (m *ShareUserRelModel) Paginate(page int64, perPage int64, builders ...query.SQLBuilder) ([]ShareUserRel, query.PaginateMeta, error)
func (*ShareUserRelModel) Save ¶
func (m *ShareUserRelModel) Save(shareUserRel ShareUserRel, onlyFields ...string) (int64, error)
Save save a share_user_rel to database
func (*ShareUserRelModel) SaveAll ¶
func (m *ShareUserRelModel) SaveAll(shareUserRels []ShareUserRel) ([]int64, error)
SaveAll save all share_user_rels to database
func (*ShareUserRelModel) SaveOrUpdate ¶
func (m *ShareUserRelModel) SaveOrUpdate(shareUserRel ShareUserRel, onlyFields ...string) (id int64, updated bool, err error)
SaveOrUpdate save a new share_user_rel or update it when it has a id > 0
func (*ShareUserRelModel) Update ¶
func (m *ShareUserRelModel) Update(shareUserRel ShareUserRel, builders ...query.SQLBuilder) (int64, error)
Update update a model for given query
func (*ShareUserRelModel) UpdateById ¶
func (m *ShareUserRelModel) UpdateById(id int64, shareUserRel ShareUserRel, onlyFields ...string) (int64, error)
UpdateById update a model by id
func (*ShareUserRelModel) UpdateFields ¶
func (m *ShareUserRelModel) UpdateFields(kv query.KV, builders ...query.SQLBuilder) (int64, error)
UpdateFields update kv for a given query
func (*ShareUserRelModel) UpdatePart ¶
func (m *ShareUserRelModel) UpdatePart(shareUserRel ShareUserRel, onlyFields ...string) (int64, error)
UpdatePart update a model for given query
func (*ShareUserRelModel) WithLocalScopes ¶
func (m *ShareUserRelModel) WithLocalScopes(names ...string) *ShareUserRelModel
WithLocalScopes add a local scope for given query
func (*ShareUserRelModel) WithoutGlobalScopes ¶
func (m *ShareUserRelModel) WithoutGlobalScopes(names ...string) *ShareUserRelModel
WithoutGlobalScopes remove a global scope for given query
type ShareUserRelPlain ¶
type ShareUserRelPlain struct {}
func (ShareUserRelPlain) As ¶
func (w ShareUserRelPlain) As(dst interface{}) error
As convert object to other type dst must be a pointer to struct
func (ShareUserRelPlain) ToShareUserRel ¶
func (w ShareUserRelPlain) ToShareUserRel(allows ...string) ShareUserRel
type User ¶
type User struct { Id null.Int Uuid null.String Name null.String Account null.String Status null.Int Password null.String `json:"-"` CreatedAt null.Time UpdatedAt null.Time // contains filtered or unexported fields }
User is a User object
func (*User) ToUserPlain ¶
type UserModel ¶
type UserModel struct {
// contains filtered or unexported fields
}
UserModel is a model which encapsulates the operations of the object
func (*UserModel) Condition ¶
func (m *UserModel) Condition(builder query.SQLBuilder) *UserModel
Condition add query builder to model
func (*UserModel) Count ¶
func (m *UserModel) Count(builders ...query.SQLBuilder) (int64, error)
Count return model count for a given query
func (*UserModel) Delete ¶
func (m *UserModel) Delete(builders ...query.SQLBuilder) (int64, error)
Delete remove a model
func (*UserModel) DeleteById ¶
DeleteById remove a model by id
func (*UserModel) Exists ¶
func (m *UserModel) Exists(builders ...query.SQLBuilder) (bool, error)
Exists return whether the records exists for a given query
func (*UserModel) First ¶
func (m *UserModel) First(builders ...query.SQLBuilder) (User, error)
First return first result for given query
func (*UserModel) Get ¶
func (m *UserModel) Get(builders ...query.SQLBuilder) ([]User, error)
Get retrieve all results for given query
func (*UserModel) Paginate ¶
func (m *UserModel) Paginate(page int64, perPage int64, builders ...query.SQLBuilder) ([]User, query.PaginateMeta, error)
func (*UserModel) SaveOrUpdate ¶
func (m *UserModel) SaveOrUpdate(user User, onlyFields ...string) (id int64, updated bool, err error)
SaveOrUpdate save a new user or update it when it has a id > 0
func (*UserModel) UpdateById ¶
UpdateById update a model by id
func (*UserModel) UpdateFields ¶
UpdateFields update kv for a given query
func (*UserModel) UpdatePart ¶
UpdatePart update a model for given query
func (*UserModel) WithLocalScopes ¶
WithLocalScopes add a local scope for given query
func (*UserModel) WithoutGlobalScopes ¶
WithoutGlobalScopes remove a global scope for given query