gonf

package
v2.0.0-...-93b22a8 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 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), list func(), update *CommandPromise)

----- Public ----------------------------------------------------------------

func SetServiceFunction

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

----- 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 --------------------------------------------------------------

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()

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()
}

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 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
}

----- 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 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

----- 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

Jump to

Keyboard shortcuts

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