Documentation
¶
Overview ¶
Package setting 设置项管理
Index ¶
Constants ¶
View Source
const ( TypeBool = "bool" TypeNumber = "number" TypeString = "string" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
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 GroupRequest ¶
type GroupRequest struct {
XMLName struct{} `json:"-" xml:"group"`
ID string `json:"id,omitempty" xml:"id,attr,omitempty"`
Items []*ItemRequest `json:"items" xml:"item"`
// contains filtered or unexported fields
}
func (*GroupRequest) CTXSanitize ¶
func (g *GroupRequest) CTXSanitize(v *web.Validation)
type GroupResponse ¶
type GroupResponse struct {
XMLName struct{} `json:"-" xml:"group"`
ID string `json:"id" xml:"id,attr"`
Title string `json:"title" xml:"title"`
Desc string `json:"desc" xml:"desc"`
Items []*ItemResponse `json:"items,omitempty" xml:"item,omitempty"`
}
type ItemRequest ¶
type ItemResponse ¶
type ItemResponse struct {
ID string `json:"id" xml:"id,attr"`
Title string `json:"title" xml:"title"`
Desc string `json:"desc" xml:"desc"`
Value any `json:"value" xml:"value"`
Type string `json:"type,omitempty" xml:"type,attr,omitempty"`
Multiple bool `json:"multiple,omitempty" xml:"multiple,attr,omitempty"`
Slice bool `json:"slice,omitempty" xml:"slice,attr,omitempty"`
Candidate []*CandidateResponse `json:"candidate,omitempty" xml:"candidate,omitempty"`
}
type Request ¶
type Request struct {
XMLName struct{} `json:"-" xml:"setting"`
Groups []*GroupRequest `json:"groups,omitempty" xml:"group,omitempty"`
// contains filtered or unexported fields
}
func (*Request) CTXSanitize ¶
func (r *Request) CTXSanitize(v *web.Validation)
type Response ¶
type Response struct {
XMLName struct{} `json:"-" xml:"settings"`
Groups []*GroupResponse `json:"groups,omitempty" xml:"groups,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.