installer

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2023 License: MPL-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunAsUnixID

func RunAsUnixID(f func() error, id UnixID) error

func WritePath

func WritePath(dst service.FilePath, src string, wr FileWriter) error

func WritePathPrivileged

func WritePathPrivileged(dst service.FilePath, src string, wr FileWriter) error

Types

type Copies

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

func NewCopies

func NewCopies(repo repo.Repo, repl Template) Copies

func (Copies) Run

func (c Copies) Run(log *slog.Logger, srv *service.Service) error

type CopyWriter

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

func NewCopyWriter

func NewCopyWriter(repl Template) *CopyWriter

func (*CopyWriter) GobDecode

func (w *CopyWriter) GobDecode(data []byte) error

func (*CopyWriter) GobEncode

func (w *CopyWriter) GobEncode() ([]byte, error)

func (*CopyWriter) LoadSource

func (w *CopyWriter) LoadSource(src string) error

func (*CopyWriter) WriteDestination

func (w *CopyWriter) WriteDestination(dst string) error

type FileWriter

type FileWriter interface {
	LoadSource(src string) error
	WriteDestination(dst string) error
}

type Finalization

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

func NewFinalization

func NewFinalization(repl Template) Finalization

func (Finalization) Run

func (f Finalization) Run(log *slog.Logger, srv *service.Service) error

type Installer

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

func New

func New(repository repo.Repo, options ...Option) Installer

func (*Installer) Install

func (inst *Installer) Install(srv *service.Service) error

type List

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

func NewList

func NewList() List

func NewListCached

func NewListCached(cache io.ReadWriter) (List, error)

func (*List) Contains

func (il *List) Contains(name string) bool

func (*List) Insert

func (il *List) Insert(name string) error

func (*List) Size

func (il *List) Size() int

type OSPackages

type OSPackages struct{}

func (OSPackages) Run

func (OSPackages) Run(log *slog.Logger, srv *service.Service) error

type Option

type Option func(*Installer)

func WithCommonVars

func WithCommonVars(vars map[string]string) Option

func WithList

func WithList(li List) Option

func WithVarSolvers

func WithVarSolvers(solvs map[service.VarKind]repo.VarSolver) Option

type Setup

type Setup struct{}

func (Setup) Run

func (Setup) Run(log *slog.Logger, srv *service.Service) error

type Step

type Step interface {
	Run(*slog.Logger, *service.Service) error
}

type SymlinkWriter

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

func NewSymlinkWriter

func NewSymlinkWriter() *SymlinkWriter

func (*SymlinkWriter) GobDecode

func (w *SymlinkWriter) GobDecode(data []byte) error

func (*SymlinkWriter) GobEncode

func (w *SymlinkWriter) GobEncode() ([]byte, error)

func (*SymlinkWriter) LoadSource

func (w *SymlinkWriter) LoadSource(src string) error

func (*SymlinkWriter) WriteDestination

func (w *SymlinkWriter) WriteDestination(dst string) error
type Symlinks struct {
	// contains filtered or unexported fields
}
func NewSymlinks(repo repo.Repo, repl Template) Symlinks

func (Symlinks) Run

func (s Symlinks) Run(log *slog.Logger, srv *service.Service) error

type Template

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

func NewTemplate

func NewTemplate(serviceName string, vars repo.Variables) Template

func (*Template) GobDecode

func (t *Template) GobDecode(data []byte) error

func (Template) GobEncode

func (t Template) GobEncode() ([]byte, error)

func (Template) Replace

func (t Template) Replace(r io.Reader, w io.Writer) error

func (Template) ReplaceString

func (t Template) ReplaceString(s string, w io.Writer) error

func (Template) ReplaceStringToString

func (t Template) ReplaceStringToString(s string) (string, error)

type UnixID

type UnixID struct {
	UID uint32
	GID uint32
}

func PathOwner

func PathOwner(path string) (UnixID, error)

func PathOwnerFS

func PathOwnerFS(sys fs.FS, path string) (UnixID, error)

Jump to

Keyboard shortcuts

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