Documentation ¶
Index ¶
- Constants
- func Auth(ctx context.Context, req *protocol.Message, token string) error
- func GetCtxUserDepts(ctx context.Context) []string
- func GetCtxUserId(ctx context.Context) string
- func GetCtxUserRoles(ctx context.Context) []string
- type AppConfig
- type AuthConfig
- type BaseEntity
- type BasePageArg
- type BasePageReply
- type BaseService
- func (svc *BaseService) BatchDeleteByPks(ctx context.Context, tableName, pkName string, pkValues []string, ...) (int, error)
- func (svc *BaseService) DeleteByFreeField(ctx context.Context, tableName, columnName string, value any) (int, error)
- func (svc *BaseService) GetPage(arg BasePageArg) *zorm.Page
- type EmptyArg
- type EmptyReply
- type GoSineX
- type IdArg
- type IdHashConfig
- type JwtConfig
- type LoginUser
- type Md5MixConfig
- type OptReply
- type RpcService
- type SaveReply
- type SecretConfig
- type ServerCodec
Constants ¶
View Source
const ( GSX_USERID = "gsx-userid" GSX_DEPTS = "gsx-depts" GSX_ROLES = "gsx-roles" )
ctx常量
View Source
const Login_Audience = "login"
登录审批者
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AppConfig ¶
type AppConfig struct { Host string `mapstructure:"host"` Port int `mapstructure:"port"` Secret SecretConfig `mapstructure:"secret"` Rpc bgateway.RpcConfig `mapstructure:"rpc"` Auth AuthConfig `mapstructure:"auth"` Log logx.LogConfig `mapstructure:"log"` SwitchStrategyFunc dbx.StrategyFunc Datasource []dbx.DatasourceConfig `mapstructure:"datasource"` Cache cachex.CacheConfig `mapstructure:"cache"` }
基本配置
type AuthConfig ¶
type BaseEntity ¶
type BaseEntity struct { zorm.EntityStruct Id int `column:"id" json:"-" name:"主键"` Version int `column:"version" name:"乐观锁" json:"-"` UserPerms string `column:"user_perms" name:"用户权限" json:"-"` DeptPerms string `column:"dept_perms" name:"部门权限" json:"-"` CreatedAt time.Time `column:"created_at" name:"创建时间" json:"createdAt"` UpdatedAt time.Time `column:"updated_at" name:"更新时间" json:"updatedAt"` }
func (*BaseEntity) GetVersion ¶
func (entity *BaseEntity) GetVersion() int
func (*BaseEntity) SetCreatedAt ¶
func (entity *BaseEntity) SetCreatedAt(createdAt time.Time)
func (*BaseEntity) SetUpdatedAt ¶
func (entity *BaseEntity) SetUpdatedAt(updatedAt time.Time)
func (*BaseEntity) SetVersion ¶
func (entity *BaseEntity) SetVersion(version int)
type BasePageArg ¶
type BasePageReply ¶
type BasePageReply struct {
Total int `json:"total" name:"总记录条数"`
}
type BaseService ¶
type BaseService struct{}
func (*BaseService) BatchDeleteByPks ¶
func (svc *BaseService) BatchDeleteByPks(ctx context.Context, tableName, pkName string, pkValues []string, cfg IdHashConfig) (int, error)
根据主键批量删除
func (*BaseService) DeleteByFreeField ¶
func (svc *BaseService) DeleteByFreeField(ctx context.Context, tableName, columnName string, value any) (int, error)
根据任意字段删除
type GoSineX ¶
type GoSineX struct {
// contains filtered or unexported fields
}
定义GoSine+
func (*GoSineX) RegisterService ¶
func (gsp *GoSineX) RegisterService(services ...RpcService)
注册service
type IdArg ¶
type IdArg struct {
Id string `json:"id" name:"主键" validate:"required"`
}
通用id参数
func (*IdArg) GetIntValue ¶
func (arg *IdArg) GetIntValue(cfg IdHashConfig) int
type IdHashConfig ¶
type JwtConfig ¶
type JwtConfig struct { Issuer string `mapstructure:"issuer"` Secret string `mapstructure:"secret"` LoginExpired int `mapstructure:"login-expired"` }
jwt配置
type Md5MixConfig ¶
type RpcService ¶
定义注册的rpc service信息
type SecretConfig ¶
type SecretConfig struct { IdHash IdHashConfig `mapstructure:"id-hash"` Md5Mix Md5MixConfig `mapstructure:"md5-mix"` }
type ServerCodec ¶
type ServerCodec struct{}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.