server

package
v0.0.0-...-4e88557 Latest Latest
Warning

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

Go to latest
Published: May 14, 2020 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DnsClient

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

func NewDNSClient

func NewDNSClient(baseURL string, domain string, apikey string) *DnsClient

func (DnsClient) Add

func (c DnsClient) Add(name string, address string) error

func (DnsClient) Remove

func (c DnsClient) Remove(name string, address string) error

type LVMStorage

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

func (LVMStorage) CreateStorage

func (s LVMStorage) CreateStorage(ctx context.Context, name string, size uint64, sourceImage string) error

func (LVMStorage) RemoveStorage

func (s LVMStorage) RemoveStorage(ctx context.Context, name string) error

func (LVMStorage) StorageBlockDevice

func (s LVMStorage) StorageBlockDevice(name string) string

type Server

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

Server is GRPC server.

func NewServer

func NewServer(conn *libvirt.Connect, storage StorageManager, vmNet *net.IPNet, dnsCli *DnsClient, xmlTemplate *template.Template) Server

NewServer creates a new server instance.

func (Server) Create

func (s Server) Create(ctx context.Context, in *pb.CreateRequest) (*pb.VM, error)

Create is GRPC handler for Create API.

func (Server) Destroy

func (s Server) Destroy(ctx context.Context, in *pb.DestroyRequest) (*pb.DestroyReply, error)

Destroy is GRPC handler for Destroy API.

func (Server) Find

func (s Server) Find(ctx context.Context, req *pb.FindRequest) (*pb.VM, error)

Find is GRPC handler for Find API.

func (Server) List

func (s Server) List(ctx context.Context, req *pb.ListVMRequest) (*pb.ListVMReply, error)

List is GRPC handler for List API.

type StorageManager

type StorageManager interface {
	CreateStorage(ctx context.Context, name string, size uint64, sourceImage string) error
	RemoveStorage(ctx context.Context, name string) error
	StorageBlockDevice(name string) string
}

func NewLVMStorage

func NewLVMStorage(lvmAddress string, lvmCA string, vg string, lvmToken string) (StorageManager, error)

Jump to

Keyboard shortcuts

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