Documentation ¶
Index ¶
- Constants
- Variables
- func InitDB(db *DBConfig) (err error)
- func InitData() (err error)
- type AppUser
- type Cluster
- type ClusterLog
- type Component
- type ComponentData
- type DBConfig
- type Host
- func (m *Host) Add() (err error, errC *sutil.ControllerError)
- func (m *Host) All() (ls *List, err error, errC *sutil.ControllerError)
- func (m *Host) Delete() (err error, errC *sutil.ControllerError)
- func (m *Host) DeleteMulti() (err error, errC *sutil.ControllerError)
- func (m *Host) One() (err error, errC *sutil.ControllerError)
- func (m *Host) Update() (err error, errC *sutil.ControllerError)
- type List
- type MetaComponent
- func (m *MetaComponent) Add() (err error, errC *sutil.ControllerError)
- func (m *MetaComponent) All() (ls *List, err error, errC *sutil.ControllerError)
- func (m *MetaComponent) Delete() (err error, errC *sutil.ControllerError)
- func (m *MetaComponent) DeleteMulti() (err error, errC *sutil.ControllerError)
- func (m *MetaComponent) One() (err error, errC *sutil.ControllerError)
- func (m *MetaComponent) Update() (err error, errC *sutil.ControllerError)
- type Notification
- type PageQuery
- type Property
- func (m *Property) Add() (err error, errC *sutil.ControllerError)
- func (m *Property) All() (ls *List, err error, errC *sutil.ControllerError)
- func (m *Property) Delete() (err error, errC *sutil.ControllerError)
- func (m *Property) DeleteMulti() (err error, errC *sutil.ControllerError)
- func (m *Property) One() (err error, errC *sutil.ControllerError)
- func (m *Property) Update() (err error, errC *sutil.ControllerError)
- type ResponseModel
- type Task
- type Token
- type User
- func (m *User) Add() (err error, errC *sutil.ControllerError)
- func (m *User) All() (ls *List, err error, errC *sutil.ControllerError)
- func (m *User) Delete() (err error, errC *sutil.ControllerError)
- func (m *User) DeleteMulti() (err error, errC *sutil.ControllerError)
- func (m *User) GetUserInfo(token string) (err error, errC *sutil.ControllerError)
- func (m *User) Login() (token *Token, err error, errC *sutil.ControllerError)
- func (m *User) Logout(token string) (err error, errC *sutil.ControllerError)
- func (m *User) One() (err error, errC *sutil.ControllerError)
Constants ¶
View Source
const ( FormatTime = "15:04:05" FormatDate = "2006-01-02" FormatDateTime = "2006-01-02 15:04:05" )
Variables ¶
View Source
var (
TabPrefix = "siot_"
)
Functions ¶
Types ¶
type AppUser ¶
type AppUser struct { Id int `json:"id"` Appid string `orm:"size(128)" json:"appid"` Secret string `orm:"size(128)" json:"secret"` CreateTime int64 `json:"create_time"` Salt string `orm:"size(128)" json:"salt"` Role string `orm:"size(128);null" json:"role,omitempty"` User *User `orm:"rel(fk)" json:"users"` Access []string `orm:"-" json:"access,omitempty"` UserIds []int `orm:"-" json:"user_ids,omitempty"` }
func (*AppUser) DeleteByUser ¶
type Cluster ¶
type Cluster struct { Id int `json:"id"` Name string `orm:"size(64)" json:"name,omitempty"` Description string `orm:"size(128);null" json:"description,omitempty"` State string `orm:"size(32);null" json:"state,omitempty"` Components []*Component `orm:"rel(m2m);rel_table(siot_cluster_component)" json:"components,omitempty"` }
type ClusterLog ¶
type ClusterLog struct { ClusterId string `json:"cluster_id"` Created time.Time `json:"created"` Log *Notification `json:"log"` }
type Component ¶
type Component struct { Id int `json:"id"` MetaComponent *MetaComponent `orm:"rel(fk)" json:"meta_Component,omitempty"` Hosts []*Host `orm:"rel(m2m);rel_table(siot_component_host)" json:"hosts,omitempty"` ComponentData []*ComponentData `orm:"rel(m2m);rel_table(siot_cluster_component_data)" json:"component_data,omitempty"` HostsMap map[string][]string `orm:"-" json:"hosts,omitempty"` }
type ComponentData ¶
type Host ¶
type Host struct { PageQuery `orm:"-"` Id int `json:"id" description:"主机ID"` HostName string `orm:"size(32)" json:"hostname,omitempty" description:"主机名"` IP string `orm:"size(32);column(ip)" json:"ip,omitempty" description:"主机IP"` User string `orm:"size(32);column(user)" json:"user,omitempty" description:"主机用户"` Passwd string `orm:"size(32);column(passwd)" json:"passwd,omitempty" description:"主机密码"` RootPasswd string `orm:"size(32);column(root_passwd)" json:"root_passwd,omitempty" description:"主机ROOT密码"` Description string `orm:"size(128);null" json:"description,omitempty" description:"描述信息"` Ids []int `orm:"-" json:"ids,omitempty"` }
func (*Host) DeleteMulti ¶
func (m *Host) DeleteMulti() (err error, errC *sutil.ControllerError)
type MetaComponent ¶
type MetaComponent struct { PageQuery `orm:"-"` Id int `json:"id" description:"组件ID"` Name string `orm:"size(64)" json:"name,omitempty" description:"组件名称"` Version string `orm:"size(32)" json:"version,omitempty" description:"组件版本"` Description string `orm:"size(128);null" json:"description,omitempty" description:"描述信息"` Propertys []*Property `orm:"reverse(many)" json:"propertys,omitempty" description:"组件属性列表"` Ids []int `orm:"-" json:"ids,omitempty"` }
func (*MetaComponent) Add ¶
func (m *MetaComponent) Add() (err error, errC *sutil.ControllerError)
func (*MetaComponent) All ¶
func (m *MetaComponent) All() (ls *List, err error, errC *sutil.ControllerError)
func (*MetaComponent) Delete ¶
func (m *MetaComponent) Delete() (err error, errC *sutil.ControllerError)
func (*MetaComponent) DeleteMulti ¶
func (m *MetaComponent) DeleteMulti() (err error, errC *sutil.ControllerError)
func (*MetaComponent) One ¶
func (m *MetaComponent) One() (err error, errC *sutil.ControllerError)
func (*MetaComponent) Update ¶
func (m *MetaComponent) Update() (err error, errC *sutil.ControllerError)
type Notification ¶
type Property ¶
type Property struct { PageQuery `orm:"-"` Id int `json:"id" description:"属性ID"` Variable string `orm:"size(32)" json:"variable,omitempty" description:"变量名"` Label string `orm:"size(32)" json:"label,omitempty" description:"标签"` Description string `orm:"size(128);null" json:"description,omitempty" description:"描述信息"` Type string `orm:"size(32)" json:"type,omitempty" description:"变量类型"` Default string `orm:"size(255);null" json:"default,omitempty" description:"默认值"` Required bool `json:"required,omitempty" description:"是否必须"` MetaComponent *MetaComponent `orm:"rel(fk)" json:"meta_component,omitempty" description:"所属组件"` Ids []int `orm:"-" json:"ids,omitempty"` }
func (*Property) DeleteMulti ¶
func (m *Property) DeleteMulti() (err error, errC *sutil.ControllerError)
type ResponseModel ¶
type Token ¶
type Token struct { Id int `json:"id,omitempty"` Token string `json:"token,omitempty"` Secret string `json:"secret,omitempty"` CreateTime int64 `json:"create_time,omitempty"` }
func NewTokenForApp ¶
func NewTokenForUser ¶
type User ¶
type User struct { PageQuery `orm:"-"` Id int `json:"id" description:"用户ID"` UserName string `orm:"size(64)" json:"username,omitempty" description:"登陆名"` Password string `orm:"size(64)" json:"password,omitempty" description:"登陆密码"` Name string `orm:"size(64);null" json:"realName,omitempty" description:"用户姓名"` CreateTime int64 `json:"create_time,omitempty" description:"创建时间"` Salt string `orm:"size(128)" json:"salt,omitempty" description:"密码加密"` Ids []int `orm:"-" json:"ids,omitempty"` Roles []string `orm:"-" json:"roles,omitempty" description:"用户角色"` }
func (*User) DeleteMulti ¶
func (m *User) DeleteMulti() (err error, errC *sutil.ControllerError)
func (*User) GetUserInfo ¶
func (m *User) GetUserInfo(token string) (err error, errC *sutil.ControllerError)
Click to show internal directories.
Click to hide internal directories.