utils

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2018 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TimeoutCtxDefault default timeout for grpc command invocation
	TimeoutCtxDefault = 1 * time.Minute
	// TimeoutCtxHost timeout for grpc command relative to host creation
	TimeoutCtxHost = 5 * time.Minute
)

Variables

View Source
var (
	// Debug if set to true, work in debug mode
	Debug = false
	// Verbose if set to true, increase verbosity
	Verbose = false
)

Functions

func GetConnection

func GetConnection(host string, port int) *grpc.ClientConn

GetConnection returns a connection to GRPC server

func GetContext

func GetContext(timeout time.Duration) (context.Context, context.CancelFunc)

GetContext return a context for grpc commands

func GetReference

func GetReference(in *pb.Reference) string

GetReference return a reference from the name or id given in the pb.Reference

func ToHostStatus

func ToHostStatus(in *model.Host) *pb.HostStatus

ToHostStatus ...

func ToPBBucketList

func ToPBBucketList(in []string) *pb.BucketList

ToPBBucketList convert a list of string into a *ContainerLsit

func ToPBBucketMountPoint

func ToPBBucketMountPoint(in *model.Bucket) *pb.BucketMountingPoint

ToPBBucketMountPoint convert a Bucket into a BucketMountingPoint

func ToPBHost

func ToPBHost(in *model.Host) *pb.Host

ToPBHost convert an host from api to protocolbuffer format

func ToPBHostTemplate

func ToPBHostTemplate(in *model.HostTemplate) *pb.HostTemplate

ToPBHostTemplate convert an template from api to protocolbuffer format

func ToPBImage

func ToPBImage(in *model.Image) *pb.Image

ToPBImage convert an image from api to protocolbuffer format

func ToPBNetwork

func ToPBNetwork(in *model.Network) *pb.Network

ToPBNetwork convert a network from api to protocolbuffer format

func ToPBShare

func ToPBShare(hostName string, share *propsv1.HostShare) *pb.ShareDefinition

ToPBShare convert a share from model to protocolbuffer format

func ToPBShareMount

func ToPBShareMount(shareName string, hostName string, mount *propsv1.HostRemoteMount) *pb.ShareMountDefinition

ToPBShareMount convert share mount on host to protocolbuffer format

func ToPBShareMountList

func ToPBShareMountList(hostName string, share *propsv1.HostShare, mounts map[string]*propsv1.HostRemoteMount) *pb.ShareMountList

ToPBShareMountList converts share mounts to protocol buffer

func ToPBSshConfig

func ToPBSshConfig(from *system.SSHConfig) *pb.SshConfig

ToPBSshConfig converts a system.SSHConfig into a SshConfig

func ToPBVolume

func ToPBVolume(in *model.Volume) *pb.Volume

ToPBVolume converts an api.Volume to a *Volume

func ToPBVolumeAttachment

func ToPBVolumeAttachment(in *model.VolumeAttachment) *pb.VolumeAttachment

ToPBVolumeAttachment converts an api.Volume to a *Volume

func ToPBVolumeInfo

func ToPBVolumeInfo(volume *model.Volume, mounts map[string]*propsv1.HostLocalMount) *pb.VolumeInfo

ToPBVolumeInfo converts an api.Volume to a *VolumeInfo

func ToSystemSshConfig

func ToSystemSshConfig(from *pb.SshConfig) *system.SSHConfig

ToSystemSshConfig converts a pb.SshConfig into a system.SSHConfig

Types

This section is empty.

Jump to

Keyboard shortcuts

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