yavirt

package
v0.0.0-...-b022d11 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const LabelMeta = "ERU_META"

LabelMeta .

Variables

This section is empty.

Functions

func InitClient

func InitClient(config *types.Config)

InitClient init yavirt client

Types

type Guest

type Guest struct {
	ID            string
	Status        string
	TransitStatus string
	CreateTime    int64
	TransitTime   int64
	UpdateTime    int64
	CPU           int
	Mem           int64
	Storage       int64
	ImageID       int64
	ImageName     string
	ImageUser     string
	Networks      map[string]string
	Labels        map[string]string
	IPs           []string
	Hostname      string
	Running       bool
	HealthCheck   *HealthCheck
	// contains filtered or unexported fields
}

Guest yavirt virtual machine

func (*Guest) CheckHealth

func (g *Guest) CheckHealth(ctx context.Context, timeout time.Duration) bool

CheckHealth returns if the guest is healthy

type HealthCheck

type HealthCheck struct {
	TCPPorts []string
	HTTPPort string
	HTTPURL  string
	HTTPCode int
}

HealthCheck .

type Yavirt

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

Yavirt .

func GetClient

func GetClient() *Yavirt

GetClient .

func New

func New(config *types.Config) (*Yavirt, error)

New returns a wrapper of yavirt client

func (*Yavirt) AttachWorkload

func (y *Yavirt) AttachWorkload(context.Context, string) (io.Reader, io.Reader, error)

AttachWorkload not implemented yet

func (*Yavirt) CollectWorkloadMetrics

func (y *Yavirt) CollectWorkloadMetrics(context.Context, string)

CollectWorkloadMetrics no need yet

func (*Yavirt) Events

func (y *Yavirt) Events(ctx context.Context, filters map[string]string) (<-chan *types.WorkloadEventMessage, <-chan error)

Events returns the events of workloads' changes

func (*Yavirt) GetStatus

func (y *Yavirt) GetStatus(ctx context.Context, ID string, checkHealth bool) (*types.WorkloadStatus, error)

GetStatus checks workload's status first, then returns workload status

func (*Yavirt) GetWorkloadName

func (y *Yavirt) GetWorkloadName(context.Context, string) (string, error)

GetWorkloadName not implemented yet

func (*Yavirt) IsDaemonRunning

func (y *Yavirt) IsDaemonRunning(ctx context.Context) bool

IsDaemonRunning returns if the runtime daemon is running.

func (*Yavirt) ListWorkloadIDs

func (y *Yavirt) ListWorkloadIDs(ctx context.Context, filters map[string]string) (ids []string, err error)

ListWorkloadIDs lists workload IDs filtered by given condition

func (*Yavirt) LogFieldsExtra

func (y *Yavirt) LogFieldsExtra(context.Context, string) (map[string]string, error)

LogFieldsExtra .

func (*Yavirt) Name

func (y *Yavirt) Name() string

Name returns the name of runtime

Jump to

Keyboard shortcuts

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