storage

package
v0.1.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init() error

Types

type Artifact

type Artifact struct {
	// Key for storing or retrieving artifact from cache.
	Key string `yaml:"key"`

	// Path to retrieve or dump artifact on host.
	HostPath string `yaml:"host-path"`

	// Path to push or pull artifact to or from
	// in Act instance.
	Path string `yaml:"path"`
}

`Artifact` represents a possible input or output from an Act run. Inputs will be pushed into the Act instance before any scenes are executed, and Outputs will be cached locally after all steps have completed successfully.

func (*Artifact) IsDir

func (a *Artifact) IsDir(artifact []byte) (bool, error)

func (*Artifact) Name

func (a *Artifact) Name() (string, error)

Get unique name of the artifact. If both a `key and `host-path` are provided in the playthrough file, then an error is returned.

func (*Artifact) Unwrap

func (a *Artifact) Unwrap(artifact []byte) error

Unwrap a tarred artifact and dump to the configured `host-path`. An error will be returned if an error occurs when unwrapping the artifact and dumping to the given location on the host.

func (*Artifact) Wrap

func (a *Artifact) Wrap() ([]byte, error)

Wrap an artifact inside a tar archive pulled from the configured `host-path`. An error is returned if an error occurs when wrapping the artifact pulled from the given location on the host. Returns an artifact wrapped in a tarball.

type Cache

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

func NewCache

func NewCache(name string) (c Cache, err error)

func (*Cache) Flush

func (c *Cache) Flush() error

Flush out caches after successful completion of playthrough.

func (*Cache) GetArtifact

func (c *Cache) GetArtifact(key string) ([]byte, error)

func (*Cache) GetInstanceIds

func (c *Cache) GetInstanceIds() ([]string, error)

func (*Cache) PutArtifact

func (c *Cache) PutArtifact(key string, artifact []byte) error

func (*Cache) PutInstanceId

func (c *Cache) PutInstanceId(id string) error

Jump to

Keyboard shortcuts

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