nodes

package
v0.0.0-...-8460a57 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2023 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	// Description is used as the nodes identifier.
	Description string

	// The binary to run.
	// Defaults to 'bash'.
	Binary string

	// Arguments to pass when invoking the binary.
	// Each argument is templated.
	// Defaults to ["{{.Custom.script}}"] if .Script is not empty, [] otherwise.
	Arguments []string

	// A script to template and pass to .Binary.
	Script string

	// Input is passed to the process as stdin line by line.
	// Each line is templated.
	//
	// Useful when executing a binary that expects input (e.g. a password for authenticating).
	Input []string
}

Command executes command lines.

func (Command) Execute

func (sh Command) Execute(ctx tensile.Context) (any, error)

func (Command) Identifier

func (sh Command) Identifier() string

func (Command) Shape

func (sh Command) Shape() tensile.Shape

func (*Command) Validate

func (sh *Command) Validate() error

type CommandOutput

type CommandOutput struct {
	Result         int
	Stdout, Stderr string
}

type Dir

type Dir struct {
	Target string
	// contains filtered or unexported fields
}

func (Dir) AfterNodes

func (dir Dir) AfterNodes() []string

func (Dir) Execute

func (dir Dir) Execute(ctx tensile.Context) (any, error)

func (Dir) Identifier

func (dir Dir) Identifier() string

func (Dir) Shape

func (dir Dir) Shape() tensile.Shape

func (*Dir) Validate

func (dir *Dir) Validate() error

type File

type File struct {
	Target  string
	Content string
	// contains filtered or unexported fields
}

func (File) AfterNodes

func (file File) AfterNodes() []string

func (File) Execute

func (file File) Execute(ctx tensile.Context) (any, error)

func (File) Identifier

func (file File) Identifier() string

func (File) NeedsExecution

func (file File) NeedsExecution(ctx tensile.Context) (bool, error)

func (File) Shape

func (file File) Shape() tensile.Shape

func (*File) Validate

func (file *File) Validate() error
type Link struct {
	Target string
	Source string
	Type   LinkType
	// contains filtered or unexported fields
}

func (Link) AfterNodes

func (link Link) AfterNodes() []string

func (Link) Execute

func (link Link) Execute(ctx tensile.Context) (any, error)

func (Link) Identifier

func (link Link) Identifier() string

func (Link) NeedsExecution

func (link Link) NeedsExecution(ctx tensile.Context) (bool, error)

func (Link) Shape

func (link Link) Shape() tensile.Shape

func (*Link) Validate

func (link *Link) Validate() error

type LinkType

type LinkType string
const (
	Softlink LinkType = "soft"
	Hardlink LinkType = "hard"
)

type Log

type Log struct {
	Logger  *slog.Logger
	Message string
}

Log logs the given message on the given logger on the info level. If no logger is given the default slog logger is used.

func (Log) Execute

func (log Log) Execute(ctx tensile.Context) (any, error)

func (Log) Identifier

func (log Log) Identifier() string

func (Log) Shape

func (log Log) Shape() tensile.Shape

func (*Log) Validate

func (log *Log) Validate() error

type ParentDirs

type ParentDirs struct {
	ParentDirs []string
}

func NewParentDirs

func NewParentDirs(path string) *ParentDirs

func (ParentDirs) AfterNodes

func (parent ParentDirs) AfterNodes() []string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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