Documentation ¶
Index ¶
- Constants
- func EnableDebugLogs()
- func FilterSlice[T any](slice *[]T, predicate func(T) bool)
- func SetPackagesConfiguration(install func([]string) (Status, []string), list func(), update *CommandPromise)
- func SetServiceFunction(f func(string, string) (Status, error))
- type BytesValue
- type CommandPromise
- type FilePromise
- func (f *FilePromise) Contents(contents any) *FilePromise
- func (f *FilePromise) DirectoriesPermissions(p *Permissions) *FilePromise
- func (f *FilePromise) IfRepaired(p ...Promise) Promise
- func (f *FilePromise) Permissions(p *Permissions) *FilePromise
- func (f *FilePromise) Promise() Promise
- func (f *FilePromise) Resolve()
- func (f *FilePromise) Template(contents any) *FilePromise
- type IntValue
- type PackagePromise
- type Permissions
- type Promise
- type ServicePromise
- type Status
- type StringValue
- type StringsListValue
- type TemplateValue
- type Value
- type VariablePromise
Constants ¶
const ( PROMISED = iota BROKEN KEPT REPAIRED )
Variables ¶
This section is empty.
Functions ¶
func EnableDebugLogs ¶
func EnableDebugLogs()
func SetPackagesConfiguration ¶
func SetPackagesConfiguration(install func([]string) (Status, []string), list func(), update *CommandPromise)
----- Public ----------------------------------------------------------------
Types ¶
type BytesValue ¶
type BytesValue struct {
// contains filtered or unexported fields
}
----- BytesValue ------------------------------------------------------------
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 { Status Status Stdout bytes.Buffer Stderr bytes.Buffer // contains filtered or unexported fields }
func Command ¶
func Command(cmd string, args ...string) *CommandPromise
----- Public ----------------------------------------------------------------
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()
type FilePromise ¶
type FilePromise struct {
// contains filtered or unexported fields
}
----- Public ----------------------------------------------------------------
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
We want to satisfy the Promise interface
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) Template ¶
func (f *FilePromise) Template(contents any) *FilePromise
type IntValue ¶
type IntValue struct {
// contains filtered or unexported fields
}
----- IntValue --------------------------------------------------------------
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()
type Permissions ¶
type Permissions struct {
// contains filtered or unexported fields
}
func ModeUserGroup ¶
func ModeUserGroup(mode, user, group interface{}) *Permissions
type Promise ¶
type ServicePromise ¶
type ServicePromise struct {
// contains filtered or unexported fields
}
func Service ¶
func Service(names ...string) *ServicePromise
func (*ServicePromise) IfRepaired ¶
func (s *ServicePromise) IfRepaired(ps ...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
type StringValue ¶
type StringValue struct {
// contains filtered or unexported fields
}
----- StringValue -----------------------------------------------------------
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
}
----- StringsListValue ------------------------------------------------------
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
}
----- Public ----------------------------------------------------------------
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 VariablePromise ¶
type VariablePromise struct {
// contains filtered or unexported fields
}
func AppendVariable ¶
func AppendVariable(name string, values ...string) *VariablePromise
----- Public ----------------------------------------------------------------
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
We want VariablePromise to satisfy the Value interface
func (VariablePromise) Int ¶
func (s VariablePromise) Int() (int, error)
func (VariablePromise) String ¶
func (s VariablePromise) String() string