creator

package
v2.52.2 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ValidationError = &microerror.Error{
	Kind: "validationError",
}

Functions

func IsValidationError

func IsValidationError(err error) bool

IsValidationError asserts validationError.

Types

type Creator

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

func NewCreator

func NewCreator(config CreatorConfig) *Creator

NewCreator returns new creator object

func (*Creator) Create

func (c *Creator) Create() error

Create creates or prints the file system structure. On creating it also executes post modifiers, which is not done on printing.

TBD: maybe run post modifiers on printing as well.

type CreatorConfig

type CreatorConfig struct {
	DryRun        bool
	FsObjects     []*FsObject
	Path          string
	PostModifiers map[string]modifier.Modifier
	PreValidators map[string]func(*afero.Afero, string) error
	Stdout        io.Writer
}

type FsObject

type FsObject struct {
	Data         []byte
	Permission   os.FileMode
	RelativePath string
}

func NewFsObject

func NewFsObject(path string, data []byte, perm os.FileMode) *FsObject

NewFsObject returns new file system object

Jump to

Keyboard shortcuts

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