Documentation ¶
Index ¶
Constants ¶
View Source
const (
AppName = "host"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeleteHostRequest ¶
type DeleteHostRequest struct {
Xid string `json:"xid" validate:"required"`
}
type Host ¶
type Host struct { *model.Base ResourceId string `json:"resource_id" validate:"required,max=12"` // 全局唯一Id Vendor Vendor `json:"vendor"` // 厂商 Name string `json:"name" validate:"required,max=12" ` // 名称 Region string `json:"region" validate:"required,max=12"` // 地域 ExpireAt int64 `json:"expire_at"` // 过期时间 Description string `json:"description"` // 描述 PublicIP string `json:"public_ip"` // 公网IP PrivateIP string `json:"private_ip" validate:"required"` // 内网IP CPU string `json:"cpu"` // 核数 Memory string `json:"memory"` // 内存 OSType string `json:"os_type"` // 操作系统类型,分为Windows和Linux OSName string `json:"os_name"` // 操作系统名称 SerialNumber string `json:"serial_number" validate:"required"` // 序列号 }
Host模型的定义
type ListHostRequest ¶
type ListHostRequest struct { PageSize int `json:"page_size" validate:"max=50"` PageNumber int `json:"page_number" ` SerialNumber string `json:"serial_number" validate:"max=15"` PrivateIp string `json:"privateip" validate:"max=16"` }
func (*ListHostRequest) GetPageSize ¶
func (req *ListHostRequest) GetPageSize() uint
func (*ListHostRequest) OffSet ¶
func (req *ListHostRequest) OffSet() int64
type QueryHostRequest ¶
type QueryHostRequest struct {
Xid string `json:"xid" validate:"required"`
}
type Service ¶
type Service interface { // 录入主机 CreateHost(context.Context, *Host) error // 查询主机列表 ListHost(context.Context, *ListHostRequest) (*HostSet, error) // 查询主机详情 QueryHost(context.Context, *QueryHostRequest) (*Host, error) // 主机更新 UpdateHost(context.Context, *Host) (*Host, error) // 主机删除 DeleteHost(context.Context, *DeleteHostRequest) error }
host app 增删改查接口定义
Click to show internal directories.
Click to hide internal directories.