forge

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2019 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddGroup

func AddGroup(name string) error

func AddMounts added in v0.1.11

func AddMounts(mounts []*api.Mount) error

AddMounts adds mounts to node

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

Forge is the top level function responsible for implementing "forging" a set of foundry instructions onto a node

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 ForgeRootfs added in v0.1.8

func ForgeRootfs() 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

func ValidateDHCP added in v0.1.11

func ValidateDHCP(dhcp string) bool

Types

type Entry added in v0.1.6

type Entry struct{ Name, Value string }

type FSTab added in v0.1.11

type FSTab struct {
	Device    string
	Directory string
	Type      string
	Options   []string
	Dump      int
	Fsck      int
}

FSTab is the internal fstab format

type FSTabFile added in v0.1.11

type FSTabFile struct {
	// Entries is a linux user to FsTab Entry, the user key, tells us how to chown the directory
	// username: /mnt, /dev, ...
	Entries map[string][]*FSTab
}

FSTabFile wraps all the FSTab entries in /etc/fstab

func (*FSTabFile) AddFSTabEntry added in v0.1.11

func (f *FSTabFile) AddFSTabEntry(mount *api.Mount) error

AddFSTabEntry places entries into fstab for durability

func (*FSTabFile) FSTabParse added in v0.1.11

func (f *FSTabFile) FSTabParse() error

FSTabParse parses fstab file

func (*FSTabFile) FSTabWrite added in v0.1.11

func (f *FSTabFile) FSTabWrite() error

FSTabWrite writes out the fstab file

func (*FSTabFile) FindEntryByDevice added in v0.1.11

func (f *FSTabFile) FindEntryByDevice(device string) *FSTab

FindEntryByDevice checks fstab file for an entry using specified device

func (*FSTabFile) RunMount added in v0.1.11

func (f *FSTabFile) RunMount() error

RunMount runs the mount command to mount all items in fstab

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) SetDHCP added in v0.1.11

func (c SystemdConfig) SetDHCP(value string)

SetDHCP configues systemd-networkd's dhcp value

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