libgadget

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2017 License: GPL-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GadgetPrivKeyLocation = ""
	GadgetPubKeyLocation  = ""
)

Functions

func EnsureDocker added in v0.5.1

func EnsureDocker(binary string, g *GadgetContext) error

func EnsureIp added in v0.5.1

func EnsureIp() error

func EnsureKeys

func EnsureKeys() error

func GadgetInstallConfig

func GadgetInstallConfig(g *GadgetContext) error

func GadgetInstallKeys

func GadgetInstallKeys() error

func GadgetLogin

func GadgetLogin(keyLocation string) (*ssh.Client, error)

func GenGadgetKeys

func GenGadgetKeys() (string, string, error)

func PathExists

func PathExists(path string) (bool, error)

func PrependToStrings

func PrependToStrings(stringArray []string, prefix string) []string

func RequiredSsh

func RequiredSsh() error

func RunLocalCommand

func RunLocalCommand(binary string, filter string, g *GadgetContext, arguments ...string) (string, string, error)

func RunRemoteCommand

func RunRemoteCommand(client *ssh.Client, cmd ...string) (*bytes.Buffer, *bytes.Buffer, error)

func WalkUp

func WalkUp(bottom_dir string) (string, error)

recursive function, returns ("", rc) on failure returns ("/path/to/dir", rc) on success

Types

type GadgetConfig

type GadgetConfig struct {
	Spec     string
	Name     string
	UUID     string
	Type     string
	Rootfs   GadgetRootfs "rootfs,omitempty"
	Onboot   []GadgetContainer
	Services []GadgetContainer
}

func CleanConfig

func CleanConfig(g GadgetConfig) GadgetConfig

func ParseConfig

func ParseConfig(config []byte) (GadgetConfig, error)

func TemplateConfig

func TemplateConfig(gName, gUu1, gUu2 string) GadgetConfig

type GadgetContainer

type GadgetContainer struct {
	Name         string
	UUID         string
	Image        string
	Directory    string
	Net          string
	PID          string "pid,omitempty"
	Readonly     bool
	Forking      bool
	Command      []string `yaml:",flow"`
	Binds        []string `yaml:",flow"`
	Capabilities []string `yaml:",flow"`
	Devices      []string `yaml:",flow"`
	Alias        string   "alias,omitempty"
	ImageAlias   string   "imagealias,omitempty"
}

type GadgetContainers

type GadgetContainers []GadgetContainer

func FindStagedContainers

func FindStagedContainers(args []string, containers GadgetContainers) (GadgetContainers, error)

func (GadgetContainers) Find

func (containers GadgetContainers) Find(name string) (GadgetContainer, error)

type GadgetContext

type GadgetContext struct {
	Config           GadgetConfig
	Verbose          bool
	WorkingDirectory string
}

func (*GadgetContext) LoadConfig

func (g *GadgetContext) LoadConfig() error

type GadgetRootfs added in v0.5.1

type GadgetRootfs struct {
	From string
	Hash string
}

Jump to

Keyboard shortcuts

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