gonf

package
v2.0.0-...-8b9195e Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: EUPL-1.2 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PROMISED = iota
	BROKEN
	KEPT
	REPAIRED
)

Variables

This section is empty.

Functions

func EnableDebugLogs

func EnableDebugLogs()

func FilterSlice

func FilterSlice[T any](slice *[]T, predicate func(T) bool)

func SetPackagesConfiguration

func SetPackagesConfiguration(install func([]string) (Status, []string), update *CommandPromise)

func SetServiceFunction

func SetServiceFunction(f func(string, string) (Status, error))

func SetUsersConfiguration

func SetUsersConfiguration(useradd func(data UserData) (Status, error))

Types

type BytesValue

type BytesValue struct {
	// contains filtered or unexported fields
}

func (BytesValue) Bytes

func (b BytesValue) Bytes() []byte

func (BytesValue) Int

func (b BytesValue) Int() (int, error)

func (BytesValue) String

func (b BytesValue) String() string

type CommandPromise

type CommandPromise struct {
	Stdout bytes.Buffer
	Stderr bytes.Buffer
	// contains filtered or unexported fields
}

func Command

func Command(cmd string, args ...string) *CommandPromise

func CommandWithEnv

func CommandWithEnv(env []string, cmd string, args ...string) *CommandPromise

func (*CommandPromise) IfRepaired

func (c *CommandPromise) IfRepaired(p ...Promise) Promise

func (*CommandPromise) Promise

func (c *CommandPromise) Promise() Promise

func (*CommandPromise) Resolve

func (c *CommandPromise) Resolve()

func (CommandPromise) Status

func (c CommandPromise) Status() Status

type CustomPromise

type CustomPromise struct {
	// contains filtered or unexported fields
}

func MakeCustomPromise

func MakeCustomPromise(p Promise) *CustomPromise

func (*CustomPromise) IfRepaired

func (c *CustomPromise) IfRepaired(p ...Promise) Promise

func (*CustomPromise) Promise

func (c *CustomPromise) Promise() Promise

func (*CustomPromise) Resolve

func (c *CustomPromise) Resolve()

func (CustomPromise) Status

func (c CustomPromise) Status() Status

type FilePromise

type FilePromise struct {
	// contains filtered or unexported fields
}

func File

func File(filename any) *FilePromise

func (*FilePromise) Contents

func (f *FilePromise) Contents(contents any) *FilePromise

func (*FilePromise) DirectoriesPermissions

func (f *FilePromise) DirectoriesPermissions(p *Permissions) *FilePromise

func (*FilePromise) IfRepaired

func (f *FilePromise) IfRepaired(p ...Promise) Promise

func (*FilePromise) Permissions

func (f *FilePromise) Permissions(p *Permissions) *FilePromise

func (*FilePromise) Promise

func (f *FilePromise) Promise() Promise

func (*FilePromise) Resolve

func (f *FilePromise) Resolve()

func (FilePromise) Status

func (f FilePromise) Status() Status

func (*FilePromise) Template

func (f *FilePromise) Template(contents any) *FilePromise

type IntValue

type IntValue struct {
	// contains filtered or unexported fields
}

func (IntValue) Bytes

func (i IntValue) Bytes() []byte

func (IntValue) Int

func (i IntValue) Int() (int, error)

func (IntValue) String

func (i IntValue) String() string

type PackagePromise

type PackagePromise struct {
	// contains filtered or unexported fields
}

func Package

func Package(names ...string) *PackagePromise

func (*PackagePromise) IfRepaired

func (p *PackagePromise) IfRepaired(ps ...Promise) Promise

func (*PackagePromise) Promise

func (p *PackagePromise) Promise() Promise

func (*PackagePromise) Resolve

func (p *PackagePromise) Resolve()

func (PackagePromise) Status

func (p PackagePromise) Status() Status

type Permissions

type Permissions struct {
	// contains filtered or unexported fields
}

func ModeUserGroup

func ModeUserGroup(mode, user, group interface{}) *Permissions

type Promise

type Promise interface {
	IfRepaired(...Promise) Promise
	Promise() Promise
	Resolve()
	Status() Status
}

type ServicePromise

type ServicePromise struct {
	// contains filtered or unexported fields
}

func Service

func Service(names ...string) *ServicePromise

func (*ServicePromise) IfRepaired

func (s *ServicePromise) IfRepaired(p ...Promise) Promise

func (*ServicePromise) Promise

func (s *ServicePromise) Promise() Promise

func (*ServicePromise) Resolve

func (s *ServicePromise) Resolve()

func (*ServicePromise) State

func (s *ServicePromise) State(states ...string) *ServicePromise

func (ServicePromise) Status

func (s ServicePromise) Status() Status

type Status

type Status int

func Resolve

func Resolve() (status Status)

func (Status) String

func (s Status) String() string

type StringValue

type StringValue struct {
	// contains filtered or unexported fields
}

func (StringValue) Bytes

func (s StringValue) Bytes() []byte

func (StringValue) Int

func (s StringValue) Int() (int, error)

func (StringValue) String

func (s StringValue) String() string

type StringsListValue

type StringsListValue struct {
	// contains filtered or unexported fields
}

func (*StringsListValue) Append

func (s *StringsListValue) Append(v ...string)

func (StringsListValue) Bytes

func (s StringsListValue) Bytes() []byte

func (StringsListValue) Int

func (s StringsListValue) Int() (int, error)

func (StringsListValue) String

func (s StringsListValue) String() string

type TemplateValue

type TemplateValue struct {
	// contains filtered or unexported fields
}

func (*TemplateValue) Bytes

func (t *TemplateValue) Bytes() []byte

func (TemplateValue) Int

func (t TemplateValue) Int() (int, error)

func (TemplateValue) String

func (t TemplateValue) String() string

type UserData

type UserData struct {
	HomeDir string
	Name    string
	System  bool
}

type UserPromise

type UserPromise struct {
	// contains filtered or unexported fields
}

func User

func User(data UserData) *UserPromise

func (*UserPromise) IfRepaired

func (u *UserPromise) IfRepaired(p ...Promise) Promise

func (*UserPromise) Promise

func (u *UserPromise) Promise() Promise

func (*UserPromise) Resolve

func (u *UserPromise) Resolve()

func (UserPromise) Status

func (u UserPromise) Status() Status

type Value

type Value interface {
	Bytes() []byte
	Int() (int, error)
	String() string
}

type VariablePromise

type VariablePromise struct {
	// contains filtered or unexported fields
}

func AppendVariable

func AppendVariable(name string, values ...string) *VariablePromise

func Default

func Default(name string, value string) *VariablePromise

func Variable

func Variable(name string, value string) *VariablePromise

func (VariablePromise) Bytes

func (s VariablePromise) Bytes() []byte

func (VariablePromise) Int

func (s VariablePromise) Int() (int, error)

func (VariablePromise) String

func (s VariablePromise) String() string

Jump to

Keyboard shortcuts

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