Documentation ¶
Index ¶
Constants ¶
View Source
const (
//注册到ioc的服务名
AppName = "host"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeleteHostRequest ¶
type DeleteHostRequest struct {
Id string
}
func NewDeleteHostRequest ¶
func NewDeleteHostRequest(id string) *DeleteHostRequest
type Describe ¶
type Describe struct { CPU int `json:"cpu" validate:"required"` // 核数 Memory int `json:"memory" validate:"required"` // 内存 GPUAmount int `json:"gpu_amount"` // GPU数量 GPUSpec string `json:"gpu_spec"` // GPU类型 OSType string `json:"os_type"` // 操作系统类型,分为Windows和Linux OSName string `json:"os_name"` // 操作系统名称 SerialNumber string `json:"serial_number"` // 序列号 }
type DescribeHostRequest ¶
type DescribeHostRequest struct {
Id string
}
func NewDescribeHostRequest ¶
func NewDescribeHostRequest(id string) *DescribeHostRequest
type Host ¶
func (*Host) InjectDefault ¶
func (h *Host) InjectDefault()
type HostSet ¶
func NewHostSet ¶
func NewHostSet() *HostSet
type QueryHostRequest ¶
type QueryHostRequest struct { PageSize int `json:"page_size"` PageNumber int `json:"page_number"` KeyWords string `json:"kws"` }
func NewQueryHostRequest ¶
func NewQueryHostRequest() *QueryHostRequest
func (*QueryHostRequest) GetPageSize ¶
func (req *QueryHostRequest) GetPageSize() uint
func (*QueryHostRequest) OffSet ¶
func (req *QueryHostRequest) OffSet() int64
type Resource ¶
type Resource struct { Id string `json:"id" validate:"required"` // 全局唯一Id Vendor string `json:"vendor"` // 厂商 Region string `json:"region" validate:"required"` // 地域 CreateAt int64 `json:"create_at"` // 创建时间 ExpireAt int64 `json:"expire_at"` // 过期时间 Type string `json:"type" validate:"required"` // 规格 Name string `json:"name" validate:"required"` // 名称 Description string `json:"description"` // 描述 Status string `json:"status"` // 服务商中的状态 UpdateAt int64 `json:"update_at"` // 更新时间 SyncAt int64 `json:"sync_at"` // 同步时间 Accout string `json:"accout"` // 资源的所属账号 PublicIP string `json:"public_ip"` // 公网IP PrivateIP string `json:"private_ip"` // 内网IP }
type Service ¶
type Service interface { CreateHost(context.Context, *Host) (*Host, error) QueryHost(context.Context, *QueryHostRequest) (*HostSet, error) DescribeHost(context.Context, *DescribeHostRequest) (*Host, error) UpdateHost(context.Context, *UpdateHostRequest) (*Host, error) DeleteHost(context.Context, *DeleteHostRequest) error }
type UpdateHostRequest ¶
func NewUpdateHostRequest ¶
func NewUpdateHostRequest(id string, host *Host) *UpdateHostRequest
Click to show internal directories.
Click to hide internal directories.