read

package
v3.30.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrIncludedTaskfilesCantHaveDotenvs is returned when a included Taskfile contains dotenvs
	ErrIncludedTaskfilesCantHaveDotenvs = errors.New("task: Included Taskfiles can't have dotenv declarations. Please, move the dotenv declaration to the main Taskfile")
)

Functions

func Dotenv added in v3.5.0

func Dotenv(c compiler.Compiler, tf *taskfile.Taskfile, dir string) (*taskfile.Vars, error)

func Taskfile

func Taskfile(
	node Node,
	insecure bool,
	download bool,
	offline bool,
	tempDir string,
	l *logger.Logger,
) (*taskfile.Taskfile, error)

Taskfile reads a Taskfile for a given directory Uses current dir when dir is left empty. Uses Taskfile.yml or Taskfile.yaml when entrypoint is left empty

func Taskvars

func Taskvars(dir string) (*taskfile.Vars, error)

Taskvars reads a Taskvars for a given directory

Types

type BaseNode added in v3.30.0

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

BaseNode is a generic node that implements the Parent() and Optional() methods of the NodeReader interface. It does not implement the Read() method and it designed to be embedded in other node types so that this boilerplate code does not need to be repeated.

func NewBaseNode added in v3.30.0

func NewBaseNode(opts ...NodeOption) *BaseNode

func (*BaseNode) Optional added in v3.30.0

func (node *BaseNode) Optional() bool

func (*BaseNode) Parent added in v3.30.0

func (node *BaseNode) Parent() Node

type Cache added in v3.30.0

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

func NewCache added in v3.30.0

func NewCache(dir string) (*Cache, error)

type FileNode added in v3.30.0

type FileNode struct {
	*BaseNode
	Dir        string
	Entrypoint string
}

A FileNode is a node that reads a taskfile from the local filesystem.

func NewFileNode added in v3.30.0

func NewFileNode(uri string, opts ...NodeOption) (*FileNode, error)

func (*FileNode) Location added in v3.30.0

func (node *FileNode) Location() string

func (*FileNode) Read added in v3.30.0

func (node *FileNode) Read(ctx context.Context) ([]byte, error)

func (*FileNode) Remote added in v3.30.0

func (node *FileNode) Remote() bool

type HTTPNode added in v3.30.0

type HTTPNode struct {
	*BaseNode
	URL *url.URL
}

An HTTPNode is a node that reads a Taskfile from a remote location via HTTP.

func NewHTTPNode added in v3.30.0

func NewHTTPNode(uri string, insecure bool, opts ...NodeOption) (*HTTPNode, error)

func (*HTTPNode) Location added in v3.30.0

func (node *HTTPNode) Location() string

func (*HTTPNode) Read added in v3.30.0

func (node *HTTPNode) Read(ctx context.Context) ([]byte, error)

func (*HTTPNode) Remote added in v3.30.0

func (node *HTTPNode) Remote() bool

type Node added in v3.30.0

type Node interface {
	Read(ctx context.Context) ([]byte, error)
	Parent() Node
	Location() string
	Optional() bool
	Remote() bool
}

func NewNode added in v3.30.0

func NewNode(
	uri string,
	insecure bool,
	opts ...NodeOption,
) (Node, error)

type NodeOption added in v3.30.0

type NodeOption func(*BaseNode)

func WithOptional added in v3.30.0

func WithOptional(optional bool) NodeOption

func WithParent added in v3.30.0

func WithParent(parent Node) NodeOption

Jump to

Keyboard shortcuts

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