Documentation ¶
Overview ¶
Copyright 2014 lessOS.com. All rights reserved.
Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
Index ¶
- Constants
- Variables
- func LangHit(ls []*LangEntry, lang string) string
- func LangsStringFilter(str string) string
- func LangsStringFilterArray(str string) types.ArrayString
- func NsSysDataPull() []byte
- func NsSysNodeSearch(bukname string) []byte
- func NsTextSearchCacheNodeEntry(bukname, id string) []byte
- func ObjPrint(name string, obj interface{})
- func PermalinkNameFilter(name string) (string, error)
- func SrvNameFilter(name string) (string, error)
- type Action
- type ActionData
- type FieldModel
- type FsFile
- type FsFileList
- type LangEntry
- type LangList
- type Node
- type NodeField
- type NodeFieldLangs
- type NodeFieldTextRenderOptions
- type NodeFieldType
- type NodeList
- type NodeModel
- type NodeModelList
- type NodeTerm
- type Query
- type Route
- type Router
- type Spec
- type SpecExtensions
- type SpecList
- type SpecUploadCommit
- type SpecVersion
- type SysConfig
- type SysConfigList
- type SysIamStatus
- type SysMemStats
- type SysStatus
- type SysStatusInfo
- type Term
- type TermList
- type TermModel
- type TermModelList
- type View
- type ViewList
Constants ¶
View Source
const ( ErrCodeBadArgument = "BadArgument" ErrCodeInternalError = "InternalError" ErrCodeNotFound = "NotFound" )
View Source
const ( TermTag = "tag" TermTaxonomy = "taxonomy" )
View Source
const (
Version = "0.0.0.dev00"
)
Variables ¶
View Source
var ( NodeIdReg = regexp.MustCompile("^[0-9a-f]{12}$") NodeExtNodeReferReg = regexp.MustCompile("^[0-9a-f]{12,16}$") )
View Source
var (
LangArray = []*LangEntry{
{"en-US", "English"},
{"zh-CN", "简体中文"},
{"zh-TW", "繁體中文"},
}
)
View Source
var (
NodeFieldTypes = []string{
"bool",
"string",
"text",
"date",
"datetime",
"int8",
"int16",
"int32",
"int64",
"uint8",
"uint16",
"uint32",
"uint64",
"float",
"decimal",
}
)
View Source
var (
PermalinkNameReg = regexp.MustCompile("^[0-9a-z_-]{1,100}$")
)
View Source
var (
SrvNameReg = regexp.MustCompile("^[0-9a-z\\-_]{1,50}$")
)
Functions ¶
func LangsStringFilter ¶
func LangsStringFilterArray ¶
func LangsStringFilterArray(str string) types.ArrayString
func NsSysDataPull ¶
func NsSysDataPull() []byte
func NsSysNodeSearch ¶
func PermalinkNameFilter ¶
func SrvNameFilter ¶
Types ¶
type Action ¶
type Action struct { types.TypeMeta `json:",inline"` Name string `json:"name"` ModName string `json:"modname,omitempty"` Datax []ActionData `json:"datax,omitempty"` }
type ActionData ¶
type FieldModel ¶
type FieldModel struct { Name string `json:"name"` Type string `json:"type"` Length string `json:"length,omitempty"` Extra []string `json:"extra,omitempty"` Attrs types.KvPairs `json:"attrs,omitempty"` IndexType int `json:"indexType,omitempty"` Title string `json:"title"` EditDisable bool `json:"edit_disable,omitempty"` Comment string `json:"comment,omitempty"` }
type FsFile ¶
type FsFile struct { types.TypeMeta `json:",inline"` SelfLink string `json:"self_link,omitempty"` Path string `json:"path,omitempty"` PathSet string `json:"pathSet,omitempty"` Name string `json:"name,omitempty"` Size int64 `json:"size,omitempty"` Mime string `json:"mime,omitempty"` Body string `json:"body,omitempty"` SumCheck string `json:"sumcheck,omitempty"` IsDir bool `json:"isdir,omitempty"` ModTime string `json:"modtime,omitempty"` Encode string `json:"encode,omitempty"` }
type FsFileList ¶
type Node ¶
type Node struct { types.TypeMeta `json:",inline"` SelfLink string `json:"self_link,omitempty"` Model *NodeModel `json:"model,omitempty"` ID string `json:"id,omitempty"` PID string `json:"pid,omitempty"` Status int16 `json:"status,omitempty"` UserID string `json:"userid,omitempty"` Title string `json:"title,omitempty"` Created uint32 `json:"created,omitempty"` Updated uint32 `json:"updated,omitempty"` Fields []*NodeField `json:"fields,omitempty"` Terms []NodeTerm `json:"terms,omitempty"` ExtAccessCounter uint32 `json:"ext_access_counter,omitempty"` ExtCommentEnable bool `json:"ext_comment_enable,omitempty"` ExtCommentPerEntry bool `json:"ext_comment_perentry,omitempty"` ExtPermalinkName string `json:"ext_permalink_name,omitempty"` ExtNodeRefer string `json:"ext_node_refer,omitempty"` }
type NodeFieldLangs ¶
type NodeFieldTextRenderOptions ¶
type NodeFieldTextRenderOptions struct {
AbsolutePrefix string
}
type NodeFieldType ¶
type NodeFieldType string
const ( NodeFieldBool NodeFieldType = "bool" NodeFieldString NodeFieldType = "string" NodeFieldText NodeFieldType = "text" NodeFieldDate NodeFieldType = "date" NodeFieldDateTime NodeFieldType = "datetime" NodeFieldInt8 NodeFieldType = "int8" NodeFieldInt16 NodeFieldType = "int16" NodeFieldInt32 NodeFieldType = "int32" NodeFieldInt64 NodeFieldType = "int64" NodeFieldUint8 NodeFieldType = "uint8" NodeFieldUint16 NodeFieldType = "uint16" NodeFieldUint32 NodeFieldType = "uint32" NodeFieldUint64 NodeFieldType = "uint64" NodeFieldFloat NodeFieldType = "float" NodeFieldDecimal NodeFieldType = "decimal" )
type NodeModel ¶
type NodeModel struct { types.TypeMeta `json:",inline"` Meta types.ObjectMeta `json:"meta,omitempty"` ModName string `json:"modname,omitempty"` SrvName string `json:"-"` Status int16 `json:"status,omitempty"` Title string `json:"title,omitempty"` Comment string `json:"comment,omitempty"` Fields []FieldModel `json:"fields,omitempty"` Terms []TermModel `json:"terms,omitempty"` Extensions SpecExtensions `json:"extensions,omitempty"` }
func (*NodeModel) Field ¶
func (item *NodeModel) Field(name string) *FieldModel
type NodeModelList ¶
type Route ¶
type Route struct { types.TypeMeta `json:",inline"` Path string `json:"path"` // e.g. /app/:id DataAction string `json:"dataAction,omitempty"` Template string `json:"template,omitempty"` // e.g. index.tpl Params map[string]string `json:"params,omitempty"` Tree []string `json:"-"` ModName string `json:"modname,omitempty"` Default bool `json:"default,omitempty"` }
type Spec ¶
type Spec struct { types.TypeMeta `json:",inline"` Meta types.InnerObjectMeta `json:"meta,omitempty"` SrvName string `json:"srvname"` Status int16 `json:"status,omitempty"` Title string `json:"title"` Comment string `json:"comment,omitempty"` NodeModels []*NodeModel `json:"nodeModels,omitempty"` TermModels []TermModel `json:"termModels,omitempty"` Actions []Action `json:"actions,omitempty"` Views []View `json:"views,omitempty"` Router Router `json:"router,omitempty"` ThemeConfig string `json:"theme_config,omitempty"` }
func (*Spec) NodeModelGet ¶
type SpecExtensions ¶
type SpecExtensions struct { AccessCounter bool `json:"access_counter,omitempty"` CommentEnable bool `json:"comment_enable,omitempty"` CommentPerEntry bool `json:"comment_perentry,omitempty"` Permalink string `json:"permalink,omitempty"` NodeRefer string `json:"node_refer,omitempty"` NodeSubRefer string `json:"node_sub_refer,omitempty"` TextSearch bool `json:"text_search,omitempty"` }
type SpecUploadCommit ¶
type SpecVersion ¶
type SpecVersion string
func NewSpecVersion ¶
func NewSpecVersion(vstr string) *SpecVersion
func (*SpecVersion) Add ¶
func (v *SpecVersion) Add(major, minor, patch int32) *SpecVersion
func (*SpecVersion) Compare ¶
func (v *SpecVersion) Compare(other *SpecVersion) int
Compare compares this version to another version. This returns -1, 0, or 1 if this version is smaller, equal, or larger than the compared version, respectively.
func (*SpecVersion) String ¶
func (v *SpecVersion) String() string
func (*SpecVersion) Valid ¶
func (v *SpecVersion) Valid() bool
type SysConfigList ¶
type SysConfigList struct { types.TypeMeta `json:",inline"` Items []SysConfig `json:"items,omitempty"` }
func (*SysConfigList) Fetch ¶
func (ls *SysConfigList) Fetch(key string) *SysConfig
func (*SysConfigList) FetchString ¶
func (ls *SysConfigList) FetchString(key string) string
func (*SysConfigList) Insert ¶
func (ls *SysConfigList) Insert(entry SysConfig)
func (*SysConfigList) Remove ¶
func (ls *SysConfigList) Remove(key string)
type SysIamStatus ¶
type SysIamStatus struct { types.TypeMeta `json:",inline"` ServiceUrl string `json:"service_url"` ServiceUrlFrontend string `json:"service_url_frontend"` InstanceSelf iamapi.AppInstance `json:"instance_self"` InstanceRegistered iamapi.AppInstance `json:"instance_registered"` }
type SysMemStats ¶
type SysStatus ¶
type SysStatus struct { types.TypeMeta `json:",inline"` Meta types.ObjectMeta `json:"meta,omitempty"` InstanceID string `json:"instance_id,omitempty"` AppVersion string `json:"app_version,omitempty"` AppRelease string `json:"app_release,omitempty"` RuntimeVersion string `json:"runtime_version,omitempty"` Uptime string `json:"uptime,omitempty"` CoroutineNumber int `json:"coroutine_number,omitempty"` Info SysStatusInfo `json:"info"` MemStats SysMemStats `json:"memstats"` }
type SysStatusInfo ¶
type SysStatusInfo struct { CpuNum int `json:"cpu_num"` Uptime int64 `json:"uptime"` Loads [3]uint64 `json:"loads"` MemTotal uint64 `json:"mem_total"` MemFree uint64 `json:"mem_free"` MemBuffer uint64 `json:"mem_buffer"` MemUsed uint64 `json:"mem_used"` SwapTotal uint64 `json:"swap_total"` SwapFree uint64 `json:"swap_free"` Procs uint16 `json:"procs"` }
type Term ¶
type Term struct { types.TypeMeta `json:",inline"` Model *TermModel `json:"model,omitempty"` ID uint32 `json:"id,omitempty"` PID uint32 `json:"pid,omitempty"` UID string `json:"uid,omitempty"` Status int16 `json:"status,omitempty"` UserID string `json:"userid,omitempty"` Title string `json:"title"` Weight int32 `json:"weight,omitempty"` Created uint32 `json:"created,omitempty"` Updated uint32 `json:"updated,omitempty"` }
type TermModel ¶
type TermModel struct { types.TypeMeta `json:",inline"` Meta types.ObjectMeta `json:"meta,omitempty"` ModName string `json:"modname,omitempty"` Status int16 `json:"status,omitempty"` Type string `json:"type,omitempty"` Title string `json:"title,omitempty"` Comment string `json:"comment,omitempty"` }
type TermModelList ¶
Click to show internal directories.
Click to hide internal directories.