resource

package
v0.0.0-alpha9 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2023 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APTPackage

type APTPackage struct{}

APTPackage resource manages files.

func (APTPackage) ConfigureAll

func (ap APTPackage) ConfigureAll(
	ctx context.Context, hst host.Host, actionNameStateMap map[resource.Action]map[resource.Name]resource.State,
) error

func (APTPackage) GetStates

func (ap APTPackage) GetStates(
	ctx context.Context, hst host.Host, names []resource.Name,
) (map[resource.Name]resource.State, error)

func (APTPackage) ValidateName

func (ap APTPackage) ValidateName(name resource.Name) error

type APTPackageState

type APTPackageState struct {
	// Package version
	Version string `yaml:"version"`
}

APTPackageState is State for APTPackage

func (APTPackageState) ValidateAndUpdate

func (aps APTPackageState) ValidateAndUpdate(ctx context.Context, hst host.Host) (resource.State, error)

type File

type File struct{}

File resource manages files.

func (File) Configure

func (f File) Configure(
	ctx context.Context, hst host.Host, name resource.Name, state resource.State,
) error

func (File) Destroy

func (f File) Destroy(ctx context.Context, hst host.Host, name resource.Name) error

func (File) GetState

func (f File) GetState(ctx context.Context, hst host.Host, name resource.Name) (resource.State, error)

func (File) ValidateName

func (f File) ValidateName(name resource.Name) error

type FileState

type FileState struct {
	// Contents of the file
	Content string `yaml:"content"`
	// File permissions
	Perm os.FileMode `yaml:"perm"`
	// User ID owner of the file
	Uid uint32 `yaml:"uid"`
	// User name owner of the file
	User string `yaml:"user"`
	// Group ID owner of the file
	Gid uint32 `yaml:"gid"`
	// Group name owner of the file
	Group string `yaml:"group"`
}

FileState for File

func (FileState) ValidateAndUpdate

func (fs FileState) ValidateAndUpdate(ctx context.Context, hst host.Host) (resource.State, error)

Jump to

Keyboard shortcuts

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