copy

package
v0.67.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JoinIfNeeded

func JoinIfNeeded(parent *url.Resource, URI string) (result *url.Resource)

JoinIfNeeded routes parent resource with URI when needed

func NewModifier

func NewModifier(context *endly.Context, when *Matcher, replaceMap map[string]string, expand bool) (option.Modifier, error)

NewModifier return a new reader that can substitute content with state map, replacement data provided in replacement map.

Types

type Assets

type Assets map[string]string

Assets represents transfer assets

func (Assets) AsTransfer

func (t Assets) AsTransfer(base *Rule) []*Rule

AsTransfer converts map to transfer or transfers

type Matcher

type Matcher struct {
	*matcher.Basic
	UpdatedBefore string
	UpdatedAfter  string
}

Match represents transfer source matcher

func (Matcher) Matcher

func (m Matcher) Matcher() (match option.Match, err error)

Match return match handler or error

type Rule

type Rule struct {
	Matcher  *Matcher
	Compress bool `` //flag to compress asset before sending over wirte and to decompress (this option is only supported on scp or file proto)
	/* 133-byte string literal not displayed */
	Substitution
	Source *url.Resource `required:"true" description:"source asset or directory"`
	Dest   *url.Resource `required:"true" description:"destination asset or directory"`
}

Rule represents transfer rule

func New

func New(source, dest *url.Resource, compress, expand bool, replace map[string]string) *Rule

New creates a new transfer

func (Rule) Clone

func (r Rule) Clone() *Rule

func (*Rule) DestStorageOpts

func (r *Rule) DestStorageOpts(context *endly.Context, udfModifier option.Modifier) ([]storage.Option, error)

DestStorageOpts returns rule destination store options

func (*Rule) Init

func (r *Rule) Init() error

Init initialises transfer

func (*Rule) SourceStorageOpts

func (r *Rule) SourceStorageOpts(context *endly.Context) ([]storage.Option, error)

SourceStorageOpts returns rule source store options

func (*Rule) Validate

func (r *Rule) Validate() error

Validate checks if request is valid

type Substitution

type Substitution struct {
	Expand   bool              `description:"flag to substitute asset content with state keys"`
	Replace  map[string]string `description:"replacements map, if key if found in the conent it wil be replaced with corresponding value."`
	ExpandIf *Matcher          `description:"substitution source matcher"`
}

Substitution represents transfer data substitution

Jump to

Keyboard shortcuts

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