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

cloudconfig

package
v0.43.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2021 License: Apache-2.0 Imports: 9 Imported by: 3

Documentation

Index

Constants

View Source
const (

	// Shell defines the used shell
	Shell = "/bin/bash"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CloudConfig

type CloudConfig struct {
	Commands   []interface{} `json:"runcmd"`
	Packages   []string      `json:"packages"`
	WriteFiles []File        `json:"write_files"`
}

CloudConfig stores informaiton of the cloud config

func DecodeCloudConfig

func DecodeCloudConfig(s string) (*CloudConfig, error)

DecodeCloudConfig decodes the cloud config

func New

func New() *CloudConfig

New creates a new cloud config

func (*CloudConfig) AddCommand

func (c *CloudConfig) AddCommand(cmd ...string)

AddCommand adds a command, which will be run on node start up

func (*CloudConfig) AddCommands

func (c *CloudConfig) AddCommands(cmds ...[]string)

AddCommands adds commands, which will be run on node start up

func (*CloudConfig) AddFile

func (c *CloudConfig) AddFile(f File)

AddFile adds a file, which will be placed on the node

func (*CloudConfig) AddPackages

func (c *CloudConfig) AddPackages(pkgs ...string)

AddPackages adds packages, which should be installed on the node

func (*CloudConfig) AddScript

func (c *CloudConfig) AddScript(p, s string)

AddScript adds a scipt, which will be placed on the node

func (*CloudConfig) AddShellCommand

func (c *CloudConfig) AddShellCommand(cmd string)

AddShellCommand adds a shell comannd, which will be run on node start up

func (*CloudConfig) Encode

func (c *CloudConfig) Encode() (string, error)

Encode encodes the cloud config

func (*CloudConfig) RunScript

func (c *CloudConfig) RunScript(name, s string)

RunScript adds and runs a script on the node

type File

type File struct {
	Content     string `json:"content"`
	Owner       string `json:"owner"`
	Path        string `json:"path"`
	Permissions string `json:"permissions"`
}

File stores information about the file

Jump to

Keyboard shortcuts

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