providers

package
v0.0.0-...-302834b Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidURI          = errors.New("Spefified URI is invalid for this provider")
	ErrFeatureNotSupported = errors.New("Feature not supported")
)
View Source
var ErrFileNotFound = errors.New("File not found")

Functions

This section is empty.

Types

type Capability

type Capability uint8
const (
	CapBasic Capability = 1 << iota
	CapShare
	CapAutoChecksum
)

func (Capability) Has

func (c Capability) Has(test Capability) bool

type CloudProvider

type CloudProvider interface {
	Capabilities() Capability
	DeleteFile(relativeName string) error
	GetChecksumMethod() hash.Hash
	GetFile(relativeName string) (File, error)
	ListFiles() ([]File, error)
	Name() string
	PutFile(File) (File, error)
	Share(relativeName string) (string, error)
}

type CloudProviderInitFunc

type CloudProviderInitFunc func(string) (CloudProvider, error)

type File

type File interface {
	Info() FileInfo
	Checksum(hash.Hash) (string, error)
	Content() (io.ReadCloser, error)
}

type FileInfo

type FileInfo struct {
	RelativeName string
	LastModified time.Time
	Checksum     string // Expected to be present on CapAutoChecksum
	Size         uint64
}

func (*FileInfo) Equal

func (f *FileInfo) Equal(other *FileInfo) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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