forge

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2019 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddGroup

func AddGroup(name string) error

func AddSshAuthorizedKeys

func AddSshAuthorizedKeys(user string, keys []string) error

func AddUser

func AddUser(name, passwd string) error

func AddUserToGroup

func AddUserToGroup(name, group string) error

func Error

func Error(message string) error

Error creates an error, and logs it righteously

func ErrorE

func ErrorE(message string, err error) error

Encapsulate err in a structured log and return an abstracted high-level error with message as the payload

func ErrorEF

func ErrorEF(message string, err error, fields log.Fields) error

Encapsulate fields and err in a structured log and return an abstracted high-level error with message as the payload

func ErrorF

func ErrorF(message string, fields log.Fields) error

Encapsulate fields in a structured log and return an abstracted high-level error with message as the payload

func Forge

func Forge(mc *api.MachineConfig) error

func ForgeHostname added in v0.1.5

func ForgeHostname(hostname string) error

func ForgeInterfaces

func ForgeInterfaces(interfaces []*api.Interface) error

func ForgePhy

func ForgePhy(ifx *api.Interface) error

func ForgeUsers

func ForgeUsers(users []*api.User) error

func ForgeVlan

func ForgeVlan(ifx *api.Interface) error

func ForgeVxlan

func ForgeVxlan(ifx *api.Interface) error

TODO

func GetIds

func GetIds() ([]string, error)

func ValidateAddress

func ValidateAddress(addr string) bool

Types

type Entry added in v0.1.6

type Entry struct{ Name, Value string }

type PosixUser

type PosixUser struct {
	Uid      int
	Gid      int
	Username string
	Name     string
	HomeDir  string
}

func GetPosixUser

func GetPosixUser(name string) (*PosixUser, error)

type Section

type Section []Entry

type SystemdConfig

type SystemdConfig map[string]Section

func Read added in v0.1.6

func Read(filename string) (SystemdConfig, error)

func (SystemdConfig) MatchName

func (c SystemdConfig) MatchName(name string)

func (SystemdConfig) Netdev added in v0.1.6

func (c SystemdConfig) Netdev(name, kind string)

func (SystemdConfig) NetdevVlan added in v0.1.6

func (c SystemdConfig) NetdevVlan(vid int)

func (SystemdConfig) SetAddress

func (c SystemdConfig) SetAddress(value string)

func (SystemdConfig) SetEntry

func (c SystemdConfig) SetEntry(section, name, value string)

func (SystemdConfig) SetMtu added in v0.1.6

func (c SystemdConfig) SetMtu(value int)

func (SystemdConfig) SetVlan added in v0.1.6

func (c SystemdConfig) SetVlan(name string, vid int)

func (SystemdConfig) Write

func (c SystemdConfig) Write(name, kind string) error

Jump to

Keyboard shortcuts

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