util

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2015 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultDirectoryPermissions config.FileMode = 0755
	DefaultFilePermissions      config.FileMode = 0644
)
View Source
const (
	DefaultPresetPermissions os.FileMode = 0644
)

Variables

This section is empty.

Functions

func FileFromNetworkdUnit

func FileFromNetworkdUnit(unit config.NetworkdUnit) *config.File

func FileFromSystemdUnit

func FileFromSystemdUnit(unit config.SystemdUnit) *config.File

func FileFromUnitDropin

func FileFromUnitDropin(unit config.SystemdUnit, dropin config.SystemdUnitDropIn) *config.File

func NetworkdUnitsPath

func NetworkdUnitsPath() string

func SystemdDropinsPath

func SystemdDropinsPath(unitName string) string

func SystemdUnitsPath

func SystemdUnitsPath() string

Types

type Util

type Util struct {
	DestDir string // directory prefix to use in applying fs paths.
	*log.Logger
}

Util encapsulates logging and destdir indirection for the util methods.

func (Util) AuthorizeSSHKeys

func (u Util) AuthorizeSSHKeys(c config.User) error

Add the provided SSH public keys to the user's authorized keys.

func (Util) CreateGroup

func (u Util) CreateGroup(g config.Group) error

CreateGroup creates the group as described.

func (Util) CreateUser

func (u Util) CreateUser(c config.User) error

CreateUser creates the user as described.

func (Util) EnableUnit

func (u Util) EnableUnit(unit config.SystemdUnit) error

func (Util) JoinPath

func (u Util) JoinPath(path ...string) string

JoinPath returns a path into the context ala filepath.Join(d, args)

func (Util) MaskUnit

func (u Util) MaskUnit(unit config.SystemdUnit) error

func (Util) SetPasswordHash

func (u Util) SetPasswordHash(c config.User) error

SetPasswordHash sets the password hash of the specified user.

func (Util) WriteFile

func (u Util) WriteFile(f *config.File) error

WriteFile creates and writes the file described by f using the provided context

Jump to

Keyboard shortcuts

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