forge

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2019 License: Apache-2.0 Imports: 14 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

TODO

func ForgeVxlan

func ForgeVxlan(ifx *api.Interface) error

TODO

func GetIds

func GetIds() ([]string, error)

func ValidateAddress

func ValidateAddress(addr string) bool

Types

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 map[string]string

type SystemdConfig

type SystemdConfig map[string]Section

func (SystemdConfig) MatchName

func (c SystemdConfig) MatchName(name string)

func (SystemdConfig) SetAddress

func (c SystemdConfig) SetAddress(value string)

func (SystemdConfig) SetEntry

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

func (SystemdConfig) Write

func (c SystemdConfig) Write(name string) error

Jump to

Keyboard shortcuts

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