cloudconfig

package
v0.130.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2023 License: Apache-2.0 Imports: 8 Imported by: 4 modules, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 information 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 script, which will be placed on the node

func (*CloudConfig) AddShellCommand

func (c *CloudConfig) AddShellCommand(cmd string)

AddShellCommand adds a shell command, 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