plugin

package
v1.4.0 Latest Latest
Warning

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

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

Documentation

Overview

Package plugin for caching directories using given backends

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ArchiveFormat    string
	Backend          string
	CacheKeyTemplate string
	RemoteRoot       string
	LocalRoot        string

	// Modes
	Debug   bool
	Rebuild bool
	Restore bool

	// Optional
	SkipSymlinks            bool
	Override                bool
	CompressionLevel        int
	StorageOperationTimeout time.Duration

	Mount []string

	// Backend
	S3         s3.Config
	FileSystem filesystem.Config
	SFTP       sftp.Config
	Azure      azure.Config
	GCS        gcs.Config
}

Config plugin-specific parameters and secrets.

func (*Config) HandleMount added in v1.4.0

func (c *Config) HandleMount(fsys fs.FS) error

HandleMount runs prior to Rebuild and Restoring of caches to handle unique paths such as double-star globs.

type Error

type Error string

Error recognized error from plugin.

func (Error) Error

func (e Error) Error() string

Error is a sentinel plugin error.

func (Error) Unwrap

func (e Error) Unwrap() error

Unwrap unwraps underlying error.

type Plugin

type Plugin struct {
	Metadata metadata.Metadata
	Config   Config
	// contains filtered or unexported fields
}

Plugin stores metadata about current plugin.

func New

func New(logger log.Logger) *Plugin

New creates a new plugin.

func (*Plugin) Exec

func (p *Plugin) Exec() error

Exec entry point of Plugin, where the magic happens.

Jump to

Keyboard shortcuts

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