Documentation ¶
Index ¶
Constants ¶
View Source
const (
AppName = "system_config"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddConfigRequest ¶
type AddConfigRequest struct {
Items []*KVItem `json:"items"`
}
func NewAddConfigRequest ¶
func NewAddConfigRequest() *AddConfigRequest
func (*AddConfigRequest) AddKVItem ¶
func (r *AddConfigRequest) AddKVItem(items ...*KVItem) *AddConfigRequest
func (*AddConfigRequest) Validate ¶
func (r *AddConfigRequest) Validate() error
type ConfigItem ¶
type ConfigItem struct { apps.ResourceMeta KVItem }
func NewConfigItem ¶
func NewConfigItem() *ConfigItem
func (*ConfigItem) Decrypt ¶
func (c *ConfigItem) Decrypt() error
func (*ConfigItem) Encrypt ¶
func (c *ConfigItem) Encrypt() error
func (*ConfigItem) Load ¶
func (c *ConfigItem) Load(v any) error
func (*ConfigItem) String ¶
func (c *ConfigItem) String() string
func (*ConfigItem) TableName ¶
func (c *ConfigItem) TableName() string
type DescribeConfigRequest ¶
type DescribeConfigRequest struct { DescribeBy DESCRIBE_BY DescribeValue string }
func NewDescribeConfigRequestById ¶
func NewDescribeConfigRequestById(id string) *DescribeConfigRequest
func NewDescribeConfigRequestByKey ¶
func NewDescribeConfigRequestByKey(key string) *DescribeConfigRequest
type KVItem ¶
type KVItem struct { // 配置所属组 Group string `json:"group" bson:"group" validate:"required,lte=64" gorm:"column:group;type:varchar(200);index"` // 配置Key名称 Key string `json:"key" bson:"key" validate:"required,lte=64" gorm:"column:key;type:varchar(200);index"` // 配置Key描述 Desc string `json:"desc" bson:"desc" gorm:"column:desc;type:text"` // 格式 Format FORMAT `json:"format" bson:"format" gorm:"column:format;type:tinyint(1)"` // 配置Key的值 Value string `json:"value" bson:"value" validate:"required" gorm:"column:value;type:text"` // 是否加密 IsEncrypted bool `json:"is_encrypted" bson:"is_encrypted" validate:"required" gorm:"column:is_encrypted;type:tinyint(1)"` // 其他扩展信息 Extras map[string]string `json:"extras" gorm:"column:extras;serializer:json;type:json" description:"其他扩展信息"` }
func (*KVItem) SetIsEncrypted ¶
type QueryConfigRequest ¶
type QueryConfigRequest struct {
Group string `json:"group"`
}
func NewQueryConfigRequest ¶
func NewQueryConfigRequest() *QueryConfigRequest
type Service ¶
type Service interface { // 添加配置 AddConfig(context.Context, *AddConfigRequest) (*types.Set[*ConfigItem], error) // 查询配置项 QueryConfig(context.Context, *QueryConfigRequest) (*types.Set[*ConfigItem], error) // 查询配置详情 DescribeConfig(context.Context, *DescribeConfigRequest) (*ConfigItem, error) // 更新配置 UpdateConfig(context.Context, *UpdateConfigRequest) (*ConfigItem, error) }
func GetService ¶
func GetService() Service
type UpdateConfigRequest ¶
func NewUpdateConfigRequest ¶
func NewUpdateConfigRequest(id string) *UpdateConfigRequest
Click to show internal directories.
Click to hide internal directories.