Help us shape the future of Go! Take the 2026 Go Developer Survey

provider

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager interface {
	// SetTemplate 配置模板
	SetTemplate(t Template) error
	// Create 创建
	Create(name string) (string, error)
	// Start 启动虚拟机
	Start(name string) error
	// CreateAndStart 创建并启动
	CreateAndStart(name string) (string, error)
	// 启动并注入公钥
	CreateAndStartAndInjectionPublicKey(name string, publicKey string) (string, error)
	// Stop 关闭虚拟机
	Stop(name string) error
	// Reboot 重启虚拟机
	Reboot(name string) error
	// Shutdown 关闭虚拟机
	Shutdown(name string) error
	// Destroy 销毁虚拟机
	Destroy(name string) error
	// InjectionPublicKey 注入公玥 (vm实现和docker实现时机不同)
	InjectionPublicKey(name string, publicKey string) error
	// Status 查看状态
	Status(name string) (*Status, error)

	// GetIp 获取运行时ip
	GetIp(name string) (string, error)
	// GetAccessPort 获取运行时端口
	GetAccessPort(name string) int
}

Manager 虚拟化接口

type Status

type Status struct {
	Id string
	// status 状态 0: 关闭,1: running , 2:其他
	Status StatusValue
}

func (*Status) IsRunning

func (s *Status) IsRunning() bool

IsRunning 是否正在运行

type StatusValue

type StatusValue int
const OTHER StatusValue = 2
const RUNNING StatusValue = 1
const STOP StatusValue = 0

type Template

type Template struct {
	Cpu, Memory, Disk uint64
	System            string
	PublicKey         string
	Image             string
	AccessPort        int
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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