Documentation
¶
Overview ¶
Package setting 设置项管理
Index ¶
Constants ¶
View Source
const ( TypeBool = "bool" TypeNumber = "number" TypeString = "string" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Attribute ¶
type Attribute struct {
ID string
Title, Desc web.LocaleStringer
Multiple bool // 多行文本
Candidate []Candidate
}
Attribute 对配置对象各个字段的描述
type Candidate ¶
type Candidate struct {
Value any
Title, Desc web.LocaleStringer // 值的字面文本以及详细说明,desc 可以为空。
}
Candidate 修改数据
type CandidateResponse ¶
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
Group 对配置对象的操作接口
func (*Group) HandlePatch ¶
HandlePatch 更新设置项
type GroupRequest ¶
type GroupRequest struct {
XMLName struct{} `json:"-" yaml:"-" xml:"group"`
ID string `json:"id,omitempty" yaml:"id,omitempty" xml:"id,attr,omitempty"`
Items []*ItemRequest `json:"items" yaml:"items" xml:"item"`
// contains filtered or unexported fields
}
func (*GroupRequest) CTXSanitize ¶
func (g *GroupRequest) CTXSanitize(ctx *web.Context, v *web.Validation)
type GroupResponse ¶
type GroupResponse struct {
XMLName struct{} `json:"-" yaml:"-" xml:"group"`
ID string `json:"id" yaml:"id" xml:"id,attr"`
Title string `json:"title" yaml:"title" xml:"title"`
Desc string `json:"desc" yaml:"desc" xml:"desc"`
Items []*ItemResponse `json:"items,omitempty" yaml:"items,omitempty" xml:"item,omitempty"`
}
type ItemRequest ¶
type ItemResponse ¶
type ItemResponse struct {
ID string `json:"id" yaml:"id" xml:"id,attr"`
Title string `json:"title" yaml:"title" xml:"title"`
Desc string `json:"desc" yaml:"desc" xml:"desc"`
Value any `json:"value" yaml:"value" xml:"value"`
Type string `json:"type,omitempty" yaml:"type,omitempty" xml:"type,attr,omitempty"`
Multiple bool `json:"multiple,omitempty" yaml:"multiple,omitempty" xml:"multiple,attr,omitempty"`
Slice bool `json:"slice,omitempty" yaml:"slice,omitempty" xml:"slice,attr,omitempty"`
Candidate []*CandidateResponse `json:"candidate,omitempty" yaml:"candidate,omitempty" xml:"candidate,omitempty"`
}
type Request ¶
type Request struct {
XMLName struct{} `json:"-" yaml:"-" xml:"setting"`
Groups []*GroupRequest `json:"groups,omitempty" yaml:"groups,omitempty" xml:"group,omitempty"`
// contains filtered or unexported fields
}
func (*Request) CTXSanitize ¶
func (r *Request) CTXSanitize(ctx *web.Context, v *web.Validation)
type Response ¶
type Response struct {
XMLName struct{} `json:"-" yaml:"-" xml:"setting"`
Groups []*GroupResponse `json:"groups,omitempty" yaml:"groups,omitempty" xml:"groups,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.