cdn

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hash

type Hash interface {
	FromFile(path string) (string, error)
}

type Option

type Option func(space *Space)

func StageDirectory

func StageDirectory(stageDirectory string) Option

func WithHash

func WithHash(hash Hash) Option

type QShellUploader

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

func NewQShellUploader

func NewQShellUploader(bucket string, opts ...QShellUploaderOption) *QShellUploader

func (*QShellUploader) Upload

func (qs *QShellUploader) Upload(directory string, prefix string) []error

type QShellUploaderOption

type QShellUploaderOption func(*QShellUploader)

func IgnoreSuffixes

func IgnoreSuffixes(suffixes ...string) QShellUploaderOption

func Local added in v0.2.1

func Local() QShellUploaderOption

type Runner added in v0.2.1

type Runner interface {
	Run(name string, args ...string)
}

type Space

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

func NewSpace

func NewSpace(uploader Uploader, prefix string, options ...Option) *Space

NewSpace creates a new cdn space that used to upload files.

func (*Space) Push

func (space *Space) Push() []error

func (*Space) Stage

func (space *Space) Stage(localFile string) (cdnPath string, err error)

Stage put one local file to the stage area and return the final cnd path the file will finally upload to.

type Uploader

type Uploader interface {
	Upload(path string, prefix string) []error
}

Jump to

Keyboard shortcuts

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