lib

package
v2.11.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2023 License: MIT Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	AccessKey string
	SecretKey string

	SourcePath string
	BucketName string

	// To have multiple sites in one bucket.
	BucketPath string
	RegionName string

	// When set, will invalidate the CDN cache(s) for the updated files.
	CDNDistributionIDs Strings

	// When set, will override the default AWS endpoint.
	EndpointURL string

	// Optional configFile
	ConfigFile string

	NumberOfWorkers int
	MaxDelete       int
	ACL             string
	PublicReadACL   bool
	Verbose         bool
	Silent          bool
	Force           bool
	Try             bool
	Ignore          string
	IgnoreRE        *regexp.Regexp // compiled version of Ignore

	// CLI state
	PrintVersion bool

	// Print help
	Help bool
	// contains filtered or unexported fields
}

Config configures a deployment.

func ConfigFromArgs added in v2.9.0

func ConfigFromArgs(args []string) (*Config, error)

Parse the flags in the flag set from the provided (presumably commandline) args. Additional flags may be provided to parse from a config file and/or environment variables in that priority order. The Config needs to be initialized with Init before it's used.

func (*Config) Init added in v2.9.0

func (cfg *Config) Init() error

func (*Config) Usage added in v2.9.0

func (cfg *Config) Usage()

type DeployStats

type DeployStats struct {
	// Number of files deleted.
	Deleted uint64
	// Number of files on remote not present locally (-max-delete threshold reached)
	Stale uint64
	// Number of files uploaded.
	Uploaded uint64
	// Number of files skipped (i.e. not changed)
	Skipped uint64
}

DeployStats contains some simple stats about the deployment.

func Deploy

func Deploy(cfg *Config) (DeployStats, error)

Deploy deploys to the remote based on the given config.

func (DeployStats) FileCount

func (d DeployStats) FileCount() uint64

FileCount returns the total number of files both locally and remote.

func (DeployStats) FileCountChanged

func (d DeployStats) FileCountChanged() uint64

FileCountChanged returns the total number of files changed on server.

func (DeployStats) PercentageChanged

func (d DeployStats) PercentageChanged() float32

PercentageChanged returns the percentage of files that have changed.

func (DeployStats) Summary

func (d DeployStats) Summary() string

Summary returns formatted summary of the stats.

type Deployer

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

Deployer deploys.

type Strings added in v2.7.0

type Strings []string

func (*Strings) Set added in v2.7.0

func (i *Strings) Set(value string) error

func (*Strings) String added in v2.7.0

func (i *Strings) String() string

Jump to

Keyboard shortcuts

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