system

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2015 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthorizeSSHKeys

func AuthorizeSSHKeys(user string, keysName string, keys []string) error

Add the provide SSH public key to the core user's list of authorized keys

func CreateUser

func CreateUser(u *config.User) error

func EnsureDirectoryExists

func EnsureDirectoryExists(dir string) error

func SetUserPassword

func SetUserPassword(user, hash string) error

func UserExists

func UserExists(u *config.User) bool

func WriteEnvFile

func WriteEnvFile(ef *EnvFile, root string) error

WriteEnvFile updates an existing env `KEY=value` formated file with new values provided in EnvFile.Vars; File.Content is ignored. Existing ordering and any unknown formatting such as comments are preserved. If no changes are required the file is untouched.

func WriteFile

func WriteFile(f *File, root string) (string, error)

Types

type EnvFile

type EnvFile struct {
	Vars map[string]string
	// mask File.Content, it shouldn't be used.
	Content interface{} `json:"-" yaml:"-"`
	*File
}

type File

type File struct {
	config.File
}

File is a top-level structure which embeds its underlying configuration, config.File, and provides the system-specific Permissions().

func (*File) Permissions

func (f *File) Permissions() (os.FileMode, error)

Jump to

Keyboard shortcuts

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