host

package
v0.0.0-...-0cf7bf9 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateHostRequest

type CreateHostRequest struct {
}

type DeleteHostRequest

type DeleteHostRequest struct {
	// contains filtered or unexported fields
}

type Describe

type Describe struct {
	ResourceId   string `json:"resource"`
	CPU          int    `json:"cpu"`
	Memory       int    `json:"memory"`
	GPUAmount    int    `json:"gpu_amount"`
	OSType       string `json:"os_type "`
	OSName       string `json:"os_name"`
	SerialNumber string `json:"serial_number"`
	ImageID      string `json:"image_id"`
}

type Host

type Host struct {
	*Resource
	*Describe
}

host模型的定义

type HostSet

type HostSet struct {
	Items []*Host `json:"items"`
	// contains filtered or unexported fields
}

type QueryHostRequest

type QueryHostRequest struct {
}

type Resource

type Resource struct {
	Id          string            `json:"id"`     //全局唯一id
	Vendor      Vendor            `json:""vendor` //厂商
	Region      string            `json:"region"`
	Zone        string            `json:"zone"`
	CreateAt    int64             `json:"create_at"`
	ExpireAt    int64             `json:"expire_at"`
	Category    string            `json:"category"`
	Type        string            `json:"type"`
	InstanceID  string            `json:"instance_id"`
	Name        string            `json:"name"`
	Description string            `json:"description"`
	Status      string            `json:"status`
	Tags        map[string]string `json:"tags"`
	PublicIP    string            `json:"publicip"`
	PrivateIP   string            `json:"privateip"`
	PayType     string            `json:"pay_type"`
}

type Service

type Service interface {
	CreateHost(context.Context, *Host) (*Host, error)
	QueryHost(context.Context, *QueryHostRequest) ([]*HostSet, error)
	DescribeHost(context.Context, *QueryHostRequest) ([]*Host, error)
	UpdateHost(context.Context, *UpdateHostRequest) (*Host, error)
	DeleteHost(context.Context, *DeleteHostRequest) (*Host, error)
}

host app service的接口定义

type UpdateHostRequest

type UpdateHostRequest struct {
	*Describe
}

type Vendor

type Vendor int
const (
	PrivateIDC Vendor = iota
	Tencent
	AliYun
	HuaWei
)

Jump to

Keyboard shortcuts

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