models

package
v0.0.0-...-fa2a287 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PAGES_PER_TIME    = 5
	PAGE_SIZE_DEFAULT = 10
)

Functions

func Init

func Init()

func QueryAgentList

func QueryAgentList(queryDto QueryAgentDto, pageInfo *PageInfo) ([]Agent, *PageInfo)

func QueryEndpointList

func QueryEndpointList(queryDto QueryEndpointDto, pageInfo *PageInfo) ([]Endpoint, *PageInfo)

func QueryHostGroupList

func QueryHostGroupList(queryDto QueryHostGroupDto, pageInfo *PageInfo) ([]HostGroup, *PageInfo)

func QueryRelEndpointGroupList

func QueryRelEndpointGroupList(queryDto QueryRelEndpointGroupDto, pageInfo *PageInfo) ([]RelEndpointGroup, *PageInfo)

func QueryUserList

func QueryUserList(queryDto QueryUserDto, pageInfo *PageInfo) ([]User, *PageInfo)

Types

type Agent

type Agent struct {
	Id              int64
	GmtCreate       time.Time `orm:"auto_now_add;type(datetime)"`
	GmtModified     time.Time `orm:"auto_now_add;type(datetime)"`
	Name            string
	Version         string
	Tarball         string `orm:"null"`
	Md5             string `orm:"null"`
	Cmd             string `orm:"null"`
	RunUser         string `orm:"null"`
	WorkDir         string `orm:"null"`
	ConfigFileName  string `orm:"null"`
	ConfigRemoteUrl string `orm:"null"`
}

func (*Agent) CheckExists

func (this *Agent) CheckExists() bool

func (*Agent) DeleteByCond

func (this *Agent) DeleteByCond() (int64, error)

func (*Agent) DeleteByPK

func (this *Agent) DeleteByPK() (int64, error)

func (*Agent) Get

func (this *Agent) Get() (*Agent, error)

func (*Agent) Insert

func (this *Agent) Insert() (int64, error)

func (*Agent) TableUnique

func (this *Agent) TableUnique() [][]string

type Endpoint

type Endpoint struct {
	Id             int64
	GmtCreate      time.Time `orm:"type(datetime)"`
	GmtModified    time.Time `orm:"type(datetime)"`
	Hostname       string    `form:"hostname"`
	Ip             string    `form:"ip"`
	UpdaterVersion string    `form:"updaterVersion" orm:"null"`
	RunUser        string    `form:"runUser" orm:"null"`
}

func (*Endpoint) DeleteByCond

func (this *Endpoint) DeleteByCond() (int64, error)

func (*Endpoint) DeleteByPK

func (this *Endpoint) DeleteByPK() (int64, error)

func (*Endpoint) Insert

func (this *Endpoint) Insert() (int64, error)

func (*Endpoint) TableUnique

func (this *Endpoint) TableUnique() [][]string

type EndpointAgent

type EndpointAgent struct {
	Id           int64
	GmtCreate    time.Time `orm:"auto_now_add;type(datetime)"`
	GmtModified  time.Time `orm:"auto_now_add;type(datetime)"`
	Hostname     string    `json:"hostname"`
	AgentName    string    `json:"agentName"`
	AgentVersion string    `json:"agentVersion" orm:"null"`
	RunUser      string    `json:"runUser" orm:"null"`
	WorkDir      string    `json:"workDir" orm:"null"`
	Status       string    `json:"status" orm:"null"`
	GmtReport    time.Time `orm:"auto_now_add;type(datetime)"`
}

func QueryEndpointAgentList

func QueryEndpointAgentList(hostname string) []EndpointAgent

func (*EndpointAgent) Delete

func (this *EndpointAgent) Delete(excludes []string) (int64, error)

func (*EndpointAgent) Insert

func (this *EndpointAgent) Insert() (int64, error)

func (*EndpointAgent) TableUnique

func (this *EndpointAgent) TableUnique() [][]string

type HostGroup

type HostGroup struct {
	Id          int64
	GmtCreate   time.Time `orm:"auto_now_add;type(datetime)"`
	GmtModified time.Time `orm:"auto_now_add;type(datetime)"`
	GroupName   string    `form:"groupName"`
}

func (*HostGroup) CheckExists

func (this *HostGroup) CheckExists() bool

func (*HostGroup) DeleteByCond

func (this *HostGroup) DeleteByCond() (int64, error)

func (*HostGroup) DeleteByPK

func (this *HostGroup) DeleteByPK() (int64, error)

func (*HostGroup) Get

func (this *HostGroup) Get() (*HostGroup, error)

func (*HostGroup) Insert

func (this *HostGroup) Insert() (int64, error)

func (*HostGroup) TableUnique

func (this *HostGroup) TableUnique() [][]string

type PageInfo

type PageInfo struct {
	PageSize  int `form:"pageSize"`
	PageIndex int `form:"pageIndex"`
	RowCount  int64
	Sort      string `form:"sort"`
	Order     string `form:"order"`
}

func NewPageInfo

func NewPageInfo(request *http.Request) *PageInfo

func (*PageInfo) GetStartIndex

func (this *PageInfo) GetStartIndex() int

func (*PageInfo) SetPageSize

func (this *PageInfo) SetPageSize(size int)

func (*PageInfo) SetRowCount

func (this *PageInfo) SetRowCount(total int64)

type QueryAgentDto

type QueryAgentDto struct {
	AgentName string `form:"agentName"`
	RunUser   string `form:"runUser"`
}

type QueryEndpointDto

type QueryEndpointDto struct {
	Hostname string `form:"hostname"`
	Ip       string `form:"ip"`
}

type QueryHostGroupDto

type QueryHostGroupDto struct {
	GroupName string `form:"groupName"`
}

type QueryRelEndpointGroupDto

type QueryRelEndpointGroupDto struct {
	HostGroupId int64  `form:"hostGroupId"`
	RelType     string `form:"relType"`
	PropName    string `form:"propName"`
	PropValue   string `form:"propValue"`
}

type QueryUserDto

type QueryUserDto struct {
	UserName string `form:"userName"`
	RealName string `form:"realName"`
	RoleName string `form:"roleName"`
}

type RelAgentGroup

type RelAgentGroup struct {
	Id          int64
	GmtCreate   time.Time `orm:"auto_now_add;type(datetime)"`
	GmtModified time.Time `orm:"auto_now_add;type(datetime)"`
	AgentId     int64     `form:"agentId"`
	HostGroupId int64     `form:"hostGroupId"`
}

func (*RelAgentGroup) DeleteByCond

func (this *RelAgentGroup) DeleteByCond() (int64, error)

func (*RelAgentGroup) DeleteByPK

func (this *RelAgentGroup) DeleteByPK() (int64, error)

func (*RelAgentGroup) Insert

func (this *RelAgentGroup) Insert() (int64, error)

func (*RelAgentGroup) TableUnique

func (this *RelAgentGroup) TableUnique() [][]string

type RelAgentGroupDto

type RelAgentGroupDto struct {
	Id          int64
	GmtCreate   time.Time
	GmtModified time.Time
	AgentId     int64
	HostGroupId int64
	GroupName   string
}

func QueryRelAgentGroupList

func QueryRelAgentGroupList(agentId int64) ([]RelAgentGroupDto, error)

type RelEndpointGroup

type RelEndpointGroup struct {
	Id          int64
	GmtCreate   time.Time `orm:"auto_now_add;type(datetime)"`
	GmtModified time.Time `orm:"auto_now_add;type(datetime)"`
	HostGroupId int64     `form:"hostGroupId"`
	RelType     string    `form:"relType"`
	PropName    string    `form:"propName"`
	PropValue   string    `form:"propValue"`
}

* RelType - fixed 固定值, regex 正则

func (*RelEndpointGroup) DeleteByCond

func (this *RelEndpointGroup) DeleteByCond() (int64, error)

func (*RelEndpointGroup) DeleteByPK

func (this *RelEndpointGroup) DeleteByPK() (int64, error)

func (*RelEndpointGroup) Get

func (this *RelEndpointGroup) Get() (*RelEndpointGroup, error)

func (*RelEndpointGroup) Insert

func (this *RelEndpointGroup) Insert() (int64, error)

type User

type User struct {
	Id            int64
	UserName      string `form:"userName"`
	LoginPwd      string `form:"loginPwd"`
	RealName      string `form:"realName"`
	PhoneNo       string `form:"phoneNo"`
	Email         string `form:"email"`
	RoleName      string `form:"roleName" orm:"default(NORMAL)"`
	AccountStatus int8   `orm:"default(1)"`
}

func CheckLogin

func CheckLogin(userName, loginPwd string) (*User, error)

func GetUserById

func GetUserById(userId int64) *User

func (*User) ChangeLoginPasswd

func (this *User) ChangeLoginPasswd() (int64, error)

func (*User) CheckExists

func (this *User) CheckExists() bool

func (*User) Insert

func (this *User) Insert() (int64, error)

func (*User) TableUnique

func (u *User) TableUnique() [][]string

func (*User) Update

func (this *User) Update() (int64, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL