local_file

package
v0.0.0-...-841f565 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const Type = "local_file"

Type is the string value of the Target type

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	Artifact *Artifact
	Target   *Target
	Logger   logz.FieldLogger
}

Action is the executor for writing a local file to disk

func (Action) Execute

func (a Action) Execute(_ context.Context) error

Execute runs the action and produces a local_file.Artifact

func (*Action) UseLogger

func (a *Action) UseLogger(logger logz.FieldLogger)

UseLogger injects a logger into the target's action

type Artifact

type Artifact struct {
	ark.RawArtifact  `mapstructure:",squash"`
	RenderedFilePath string `json:"renderedFilePath" mapstructure:"renderedFilePath"`
}

Artifact the result of a successful actions.LocalFile

func (Artifact) Cacheable

func (a Artifact) Cacheable() bool

Cacheable always returns false because the contents of a generated file might change depending on the configuration provided to the target at runtime

func (Artifact) LocallyCached

func (a Artifact) LocallyCached(_ context.Context) (bool, error)

LocallyCached always returns false because the target is not cacheable

func (Artifact) Pull

func (a Artifact) Pull(_ context.Context) error

Pull does nothing

func (Artifact) Push

func (a Artifact) Push(_ context.Context) error

Push does not do anything

func (Artifact) RemotelyCached

func (a Artifact) RemotelyCached(_ context.Context) (bool, error)

RemotelyCached always returns false because the target is not cacheable

type Target

type Target struct {
	ark.RawTarget `mapstructure:",squash"`
	Filename      string `json:"filename" mapstructure:"filename"`
	Content       string `json:"content" mapstructure:"content"`
}

Target expresses an intention to write a file to disk

func (*Target) Produce

func (t *Target) Produce(checksum hash.Hash) (ark.Artifact, error)

Produce should produce Artifact

func (*Target) Validate

func (t *Target) Validate() error

Validate checks if the Target fields are valid

Jump to

Keyboard shortcuts

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