Documentation
¶
Overview ¶
Code generated by goal-cli. DO NOT EDIT. versions:
goal-cli v0.5.24 go go1.23.2
updated_at: 2024-10-09 19:07:27 source: pro/Article.proto
Code generated by goal-cli. DO NOT EDIT. versions:
goal-cli v0.5.24 go go1.23.2
updated_at: 2024-10-09 19:07:27 source: pro/user.proto
Index ¶
- func ArticleMigrator() migrate.Migrator
- func ArticleModelLocalKeyGetter(key string) func(item *ArticleModel) any
- func ArticleModelMultiRelationSetter[T any](key contracts.RelationType) func(item *ArticleModel, value []any)
- func ArticleModelRelationGetter[T any](query func() *table.Table[T], foreignKey string) func(keys []any) map[string][]any
- func ArticleModelSingleRelationSetter[T any](key contracts.RelationType) func(item *ArticleModel, value []any)
- func ArticleModelThroughRelationGetter[T any](query func() *table.Table[T], ...) func(keys []any) map[string][]any
- func ArticleQuery() *table.Table[ArticleModel]
- func ArticleQueryWithExecutor(executor contracts.SqlExecutor) *table.Table[ArticleModel]
- func UserAuthProvider(identify string) contracts.Authenticatable
- func UserMigrator() migrate.Migrator
- func UserModelLocalKeyGetter(key string) func(item *UserModel) any
- func UserModelMultiRelationSetter[T any](key contracts.RelationType) func(item *UserModel, value []any)
- func UserModelRelationGetter[T any](query func() *table.Table[T], foreignKey string) func(keys []any) map[string][]any
- func UserModelSingleRelationSetter[T any](key contracts.RelationType) func(item *UserModel, value []any)
- func UserModelThroughRelationGetter[T any](query func() *table.Table[T], ...) func(keys []any) map[string][]any
- func UserQuery() *table.Table[UserModel]
- func UserQueryWithExecutor(executor contracts.SqlExecutor) *table.Table[UserModel]
- type ArticleModel
- func (model *ArticleModel) Delete() contracts.Exception
- func (model *ArticleModel) Except(keys ...string) contracts.Fields
- func (model *ArticleModel) Exists() bool
- func (model *ArticleModel) Get(key string) any
- func (model *ArticleModel) GetCreatedAt() string
- func (model *ArticleModel) GetId() uint32
- func (model *ArticleModel) GetPrimaryKey() any
- func (model *ArticleModel) GetTitle() string
- func (model *ArticleModel) GetUpdatedAt() string
- func (model *ArticleModel) Hidden(fields ...string) *ArticleModel
- func (model *ArticleModel) Only(key ...string) contracts.Fields
- func (model *ArticleModel) Refresh() contracts.Exception
- func (model *ArticleModel) Save() contracts.Exception
- func (model *ArticleModel) Set(fields contracts.Fields)
- func (model *ArticleModel) SetCreatedAt(value string)
- func (model *ArticleModel) SetId(value uint32)
- func (model *ArticleModel) SetTitle(value string)
- func (model *ArticleModel) SetUpdatedAt(value string)
- func (model *ArticleModel) ToFields() contracts.Fields
- func (model *ArticleModel) Update(fields contracts.Fields) contracts.Exception
- type ArticleStatic
- type UserModel
- func (model *UserModel) Delete() contracts.Exception
- func (model *UserModel) Except(keys ...string) contracts.Fields
- func (model *UserModel) Exists() bool
- func (model *UserModel) Get(key string) any
- func (model *UserModel) GetAuthenticatableKey() string
- func (model *UserModel) GetAvatar() string
- func (model *UserModel) GetChannel() string
- func (model *UserModel) GetCreatedAt() string
- func (model *UserModel) GetId() int64
- func (model *UserModel) GetName() string
- func (model *UserModel) GetOpenId() string
- func (model *UserModel) GetPassword() string
- func (model *UserModel) GetPrimaryKey() any
- func (model *UserModel) GetUpdatedAt() string
- func (model *UserModel) GetWechatInfo() *user.WechatInfoData
- func (model *UserModel) Hidden(fields ...string) *UserModel
- func (model *UserModel) Only(key ...string) contracts.Fields
- func (model *UserModel) Refresh() contracts.Exception
- func (model *UserModel) Save() contracts.Exception
- func (model *UserModel) Set(fields contracts.Fields)
- func (model *UserModel) SetAvatar(value string)
- func (model *UserModel) SetChannel(value string)
- func (model *UserModel) SetCreatedAt(value string)
- func (model *UserModel) SetId(value int64)
- func (model *UserModel) SetName(value string)
- func (model *UserModel) SetOpenId(value string)
- func (model *UserModel) SetPassword(value string)
- func (model *UserModel) SetUpdatedAt(value string)
- func (model *UserModel) SetWechatInfo(value *user.WechatInfoData)
- func (model *UserModel) ToFields() contracts.Fields
- func (model *UserModel) Update(fields contracts.Fields) contracts.Exception
- type UserStatic
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArticleMigrator ¶ added in v0.4.3
func ArticleModelLocalKeyGetter ¶ added in v0.4.3
func ArticleModelLocalKeyGetter(key string) func(item *ArticleModel) any
func ArticleModelMultiRelationSetter ¶ added in v0.4.3
func ArticleModelMultiRelationSetter[T any](key contracts.RelationType) func(item *ArticleModel, value []any)
func ArticleModelRelationGetter ¶ added in v0.4.3
func ArticleModelSingleRelationSetter ¶ added in v0.4.3
func ArticleModelSingleRelationSetter[T any](key contracts.RelationType) func(item *ArticleModel, value []any)
func ArticleModelThroughRelationGetter ¶ added in v0.4.3
func ArticleQuery ¶
func ArticleQuery() *table.Table[ArticleModel]
func ArticleQueryWithExecutor ¶ added in v0.4.3
func ArticleQueryWithExecutor(executor contracts.SqlExecutor) *table.Table[ArticleModel]
func UserAuthProvider ¶ added in v0.4.2
func UserAuthProvider(identify string) contracts.Authenticatable
func UserMigrator ¶ added in v0.4.2
func UserModelLocalKeyGetter ¶ added in v0.4.2
func UserModelMultiRelationSetter ¶ added in v0.4.2
func UserModelMultiRelationSetter[T any](key contracts.RelationType) func(item *UserModel, value []any)
func UserModelRelationGetter ¶ added in v0.4.2
func UserModelSingleRelationSetter ¶ added in v0.4.2
func UserModelSingleRelationSetter[T any](key contracts.RelationType) func(item *UserModel, value []any)
func UserModelThroughRelationGetter ¶ added in v0.4.2
func UserQueryWithExecutor ¶ added in v0.4.2
func UserQueryWithExecutor(executor contracts.SqlExecutor) *table.Table[UserModel]
Types ¶
type ArticleModel ¶
type ArticleModel struct { Id uint32 `json:"id" db:"id;type:INT UNSIGNED;not null;primary key;AUTO_INCREMENT;"` Title string `json:"title" db:"title;type:VARCHAR(255);not null;"` CreatedAt string `json:"created_at" db:"created_at;type:timestamp;default CURRENT_TIMESTAMP;"` UpdatedAt string `json:"updated_at" db:"updated_at;type:timestamp;DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;"` // contains filtered or unexported fields }
ArticleModel @timestamps
func NewArticleModel ¶ added in v0.4.3
func NewArticleModel(fields contracts.Fields) *ArticleModel
func (*ArticleModel) Delete ¶ added in v0.4.3
func (model *ArticleModel) Delete() contracts.Exception
func (*ArticleModel) Except ¶ added in v0.4.3
func (model *ArticleModel) Except(keys ...string) contracts.Fields
func (*ArticleModel) Exists ¶ added in v0.4.3
func (model *ArticleModel) Exists() bool
func (*ArticleModel) Get ¶ added in v0.4.3
func (model *ArticleModel) Get(key string) any
func (*ArticleModel) GetCreatedAt ¶ added in v0.4.3
func (model *ArticleModel) GetCreatedAt() string
func (*ArticleModel) GetId ¶ added in v0.4.3
func (model *ArticleModel) GetId() uint32
func (*ArticleModel) GetPrimaryKey ¶ added in v0.4.3
func (model *ArticleModel) GetPrimaryKey() any
func (*ArticleModel) GetTitle ¶ added in v0.4.3
func (model *ArticleModel) GetTitle() string
func (*ArticleModel) GetUpdatedAt ¶ added in v0.4.3
func (model *ArticleModel) GetUpdatedAt() string
func (*ArticleModel) Hidden ¶ added in v0.4.3
func (model *ArticleModel) Hidden(fields ...string) *ArticleModel
func (*ArticleModel) Only ¶ added in v0.4.3
func (model *ArticleModel) Only(key ...string) contracts.Fields
func (*ArticleModel) Refresh ¶ added in v0.4.3
func (model *ArticleModel) Refresh() contracts.Exception
func (*ArticleModel) Save ¶ added in v0.4.3
func (model *ArticleModel) Save() contracts.Exception
func (*ArticleModel) Set ¶ added in v0.4.3
func (model *ArticleModel) Set(fields contracts.Fields)
func (*ArticleModel) SetCreatedAt ¶ added in v0.4.3
func (model *ArticleModel) SetCreatedAt(value string)
func (*ArticleModel) SetId ¶ added in v0.4.3
func (model *ArticleModel) SetId(value uint32)
func (*ArticleModel) SetTitle ¶ added in v0.4.3
func (model *ArticleModel) SetTitle(value string)
func (*ArticleModel) SetUpdatedAt ¶ added in v0.4.3
func (model *ArticleModel) SetUpdatedAt(value string)
func (*ArticleModel) ToFields ¶ added in v0.4.3
func (model *ArticleModel) ToFields() contracts.Fields
type ArticleStatic ¶ added in v0.4.3
type ArticleStatic struct { TableName string Hidden []string Indexes []string With []contracts.RelationType Appends map[string]func(model *ArticleModel) any IdGetter func(model *ArticleModel, raw uint32) uint32 IdSetter func(model *ArticleModel, raw uint32) uint32 TitleGetter func(model *ArticleModel, raw string) string TitleSetter func(model *ArticleModel, raw string) string CreatedAtGetter func(model *ArticleModel, raw string) string CreatedAtSetter func(model *ArticleModel, raw string) string UpdatedAtGetter func(model *ArticleModel, raw string) string UpdatedAtSetter func(model *ArticleModel, raw string) string Saving func(model *ArticleModel) contracts.Exception Saved func(model *ArticleModel) Updating func(model *ArticleModel, fields contracts.Fields) contracts.Exception Updated func(model *ArticleModel, fields contracts.Fields) Deleting func(model *ArticleModel) contracts.Exception Deleted func(model *ArticleModel) PrimaryKeyGetter func(model *ArticleModel) any }
var ArticleDefine ArticleStatic
type UserModel ¶
type UserModel struct { Id int64 `json:"id" db:"id;type:BIGINT;not null;primary key;AUTO_INCREMENT;"` Name string `json:"name" db:"name;type:VARCHAR(255);not null;"` Avatar string `json:"avatar" db:"avatar;type:VARCHAR(255);not null;"` //@index //@goTag:db:"open_id;type:varchar(255);default 'xxasdasdsx'" OpenId string `db:"open_id;type:varchar(255);default 'xxasdasdsx'" json:"open_id"` WechatInfo *user.WechatInfoData `json:"wechat_info" db:"wechat_info;type:json;not null;"` Channel string `json:"channel" db:"channel;type:VARCHAR(255);not null;"` //@hidden Password string `json:"password" db:"password;type:VARCHAR(255);not null;"` CreatedAt string `json:"created_at" db:"created_at;type:timestamp;default CURRENT_TIMESTAMP;"` UpdatedAt string `json:"updated_at" db:"updated_at;type:timestamp;DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;"` // contains filtered or unexported fields }
UserModel 用户注释 @authenticatable @timestamps
func NewUserModel ¶ added in v0.4.2
func (*UserModel) GetAuthenticatableKey ¶ added in v0.4.2
func (*UserModel) GetChannel ¶ added in v0.4.2
func (*UserModel) GetCreatedAt ¶ added in v0.4.2
func (*UserModel) GetPassword ¶ added in v0.4.2
func (*UserModel) GetPrimaryKey ¶ added in v0.4.2
func (*UserModel) GetUpdatedAt ¶ added in v0.4.2
func (*UserModel) GetWechatInfo ¶ added in v0.4.2
func (model *UserModel) GetWechatInfo() *user.WechatInfoData
func (*UserModel) SetChannel ¶ added in v0.4.2
func (*UserModel) SetCreatedAt ¶ added in v0.4.2
func (*UserModel) SetPassword ¶ added in v0.4.2
func (*UserModel) SetUpdatedAt ¶ added in v0.4.2
func (*UserModel) SetWechatInfo ¶ added in v0.4.2
func (model *UserModel) SetWechatInfo(value *user.WechatInfoData)
type UserStatic ¶ added in v0.4.2
type UserStatic struct { TableName string Hidden []string Indexes []string With []contracts.RelationType Appends map[string]func(model *UserModel) any IdGetter func(model *UserModel, raw int64) int64 IdSetter func(model *UserModel, raw int64) int64 NameGetter func(model *UserModel, raw string) string NameSetter func(model *UserModel, raw string) string AvatarGetter func(model *UserModel, raw string) string AvatarSetter func(model *UserModel, raw string) string OpenIdGetter func(model *UserModel, raw string) string OpenIdSetter func(model *UserModel, raw string) string WechatInfoGetter func(model *UserModel, raw *user.WechatInfoData) *user.WechatInfoData WechatInfoSetter func(model *UserModel, raw *user.WechatInfoData) *user.WechatInfoData ChannelGetter func(model *UserModel, raw string) string ChannelSetter func(model *UserModel, raw string) string PasswordGetter func(model *UserModel, raw string) string PasswordSetter func(model *UserModel, raw string) string CreatedAtGetter func(model *UserModel, raw string) string CreatedAtSetter func(model *UserModel, raw string) string UpdatedAtGetter func(model *UserModel, raw string) string UpdatedAtSetter func(model *UserModel, raw string) string Saving func(model *UserModel) contracts.Exception Saved func(model *UserModel) Updating func(model *UserModel, fields contracts.Fields) contracts.Exception Updated func(model *UserModel, fields contracts.Fields) Deleting func(model *UserModel) contracts.Exception Deleted func(model *UserModel) PrimaryKeyGetter func(model *UserModel) any }
var UserDefine UserStatic
Click to show internal directories.
Click to hide internal directories.