duck

package module
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2020 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(add ...Item)

func AddFromSource added in v0.0.4

func AddFromSource(source string, add ...Item)

func Apply

func Apply() error

func RedError added in v0.0.4

func RedError(e error) string

func RedPrintln added in v0.0.4

func RedPrintln(s string)

func SetAssetLoader added in v0.0.4

func SetAssetLoader(fn func(string) (io.Reader, error))

func SetDescribe added in v0.0.4

func SetDescribe(s string)

func SetSourcePrefix added in v0.0.4

func SetSourcePrefix(s string)

func Warnf

func Warnf(str string, args ...interface{})

Types

type Color added in v0.0.4

type Color int
const (
	Black Color = iota + 1
	Red
	Green
	Yellow
	Blue
	Magenta
	Cyan
	White
)

type File

type File struct {
	Path string
	User User

	Content  string
	Template string

	Delete bool
	// contains filtered or unexported fields
}

func (*File) StaticFiles added in v0.0.4

func (f *File) StaticFiles() []string

func (*File) String added in v0.0.3

func (f *File) String() string

func (*File) Validate added in v0.0.4

func (f *File) Validate() error

type Group

type Group struct {
	Name string
	Gid  int

	// If GidPrimary (yaml: gid_primary) is true, the gid is treated as the primary identifier.
	// Behavior:
	//		GidPrimary true: groupmod --new-name (name) is used if you change the name of a group
	//    GidPrimary false: groupmod -o (gid) is used if you change the gid of a group
	GidPrimary bool `duck:"gid_primary"`

	Delete bool
	// contains filtered or unexported fields
}

func (*Group) String added in v0.0.3

func (g *Group) String() string

type Item

type Item interface {
	String() string
	// contains filtered or unexported methods
}

type Package

type Package struct {
	Name string
}

type StaticFiler added in v0.0.4

type StaticFiler interface {
	StaticFiles() []string
}

type User

type User struct {
	Name string

	// Primary group. If not specified, user name is used
	Group string

	Uid int

	// Supplemental groups
	Groups []string

	Gecos string

	Home  string
	Shell string

	// Password is the passord encrypted with libcrypt.
	// Password if blank will actually be set to "!". If "!", "!!", or "x" are found
	// in /etc/shadow, it will be translated to a blank password. If you want an actually
	// blank password (not safe) use BlankPassword: true (blank_password: true in yaml).
	Password      string
	BlankPassword bool `duck:"blank_password"`

	// If UidPrimary (yaml: uid_primary) is true, the uid is treated as the primary identifier.
	// Behavior:
	//		UidPrimary true: usermod -l (name) is used if you change the name of the user
	//    UidPrimary false: usermod -u (uid) is used if you change the uid of the user
	UidPrimary bool `duck:"uid_primary"`

	Delete bool
	// contains filtered or unexported fields
}

func (*User) String added in v0.0.3

func (u *User) String() string

type Validator added in v0.0.4

type Validator interface {
	Validate() error
}

Directories

Path Synopsis
cmd
package rio is an abstraction for IO operations that may be performed locally, or remotely via golang.org/x/crypto/ssh.
package rio is an abstraction for IO operations that may be performed locally, or remotely via golang.org/x/crypto/ssh.

Jump to

Keyboard shortcuts

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