backends

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2021 License: Apache-2.0 Imports: 15 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	V3ioPathEnvironmentVariable       = "V3IO_API"
	V3ioUserEnvironmentVariable       = "V3IO_USERNAME"
	V3ioPasswordEnvironmentVariable   = "V3IO_PASSWORD"
	V3ioSessionKeyEnvironmentVariable = "V3IO_ACCESS_KEY"
)
View Source
const OriginalModeKey = "original_mode"
View Source
const OriginalModeS3Key = "X-Amz-Meta-Original_mode"
View Source
const OriginalMtimeKey = "original_mtime"
View Source
const OriginalMtimeS3Key = "X-Amz-Meta-Original_mtime"

Variables

This section is empty.

Functions

func CreateContainer

func CreateContainer(logger logger.Logger, addr, cont string, config *v3io.NewSessionInput, workers int) (v3io.Container, error)

func IsMatch

func IsMatch(task *ListDirTask, name string, mtime time.Time, size int64) bool

func ParseFilename added in v0.2.0

func ParseFilename(fullpath string, params *PathParams, forceDir bool) error

return is file, err

func SplitPath

func SplitPath(path string) (string, string)

func ValidFSTarget

func ValidFSTarget(filePath string) error

Types

type FSClient

type FSClient interface {
	ListDir(fileChan chan *FileDetails, task *ListDirTask, summary *ListSummary) error
	Reader(path string) (FSReader, error)
	Writer(path string, opts *FileMeta) (io.WriteCloser, error)
}

func GetNewClient

func GetNewClient(logger logger.Logger, params *PathParams) (FSClient, error)

func NewLocalClient

func NewLocalClient(logger logger.Logger, params *PathParams) (FSClient, error)

func NewS3Client

func NewS3Client(logger logger.Logger, params *PathParams) (FSClient, error)

func NewV3ioClient

func NewV3ioClient(logger logger.Logger, params *PathParams) (FSClient, error)

type FSReader added in v0.2.0

type FSReader interface {
	Read(p []byte) (n int, err error)
	Close() error
	Stat() (*FileMeta, error)
}

type FileDetails

type FileDetails struct {
	Key   string
	Mtime time.Time
	Mode  uint32
	Size  int64
}

type FileMeta added in v0.2.0

type FileMeta struct {
	Mtime time.Time
	Mode  uint32
	Attrs map[string]interface{}
}

type ListDirTask added in v0.2.0

type ListDirTask struct {
	Source    *PathParams
	Since     time.Time
	MinSize   int64
	MaxSize   int64
	Recursive bool
	InclEmpty bool
	Hidden    bool
	WithMeta  bool
	// contains filtered or unexported fields
}

type ListSummary

type ListSummary struct {
	TotalFiles int
	TotalBytes int64
}

type LocalClient

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

func (*LocalClient) ListDir

func (c *LocalClient) ListDir(fileChan chan *FileDetails, task *ListDirTask, summary *ListSummary) error

func (*LocalClient) Reader

func (c *LocalClient) Reader(path string) (FSReader, error)

func (*LocalClient) Writer

func (c *LocalClient) Writer(path string, opts *FileMeta) (io.WriteCloser, error)

type PathParams

type PathParams struct {
	Kind     string `json:"kind"`
	Endpoint string `json:"endpoint,omitempty"`
	Bucket   string `json:"bucket,omitempty"`
	Path     string `json:"path"`
	Tag      string `json:"tag,omitempty"`
	Secure   bool   `json:"secure,omitempty"`
	UserKey  string `json:"userKey,omitempty"`
	Secret   string `json:"secret,omitempty"`
	Token    string `json:"token,omitempty"`
	// contains filtered or unexported fields
}

func (*PathParams) String added in v0.2.0

func (p *PathParams) String() string

type V3ioClient

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

func (*V3ioClient) ListDir

func (c *V3ioClient) ListDir(fileChan chan *FileDetails, task *ListDirTask, summary *ListSummary) error

func (*V3ioClient) Reader

func (c *V3ioClient) Reader(path string) (FSReader, error)

func (*V3ioClient) Writer

func (c *V3ioClient) Writer(path string, opts *FileMeta) (io.WriteCloser, error)

type V3ioClientOpts

type V3ioClientOpts struct {
	WebApiEndpoint string `json:"webApiEndpoint"`
	Container      string `json:"container"`
	Username       string `json:"username,omitempty"`
	Password       string `json:"password,omitempty"`
	SessionKey     string `json:"sessionKey,omitempty"`
	// Logging level (for verbose output) - "debug" | "info" | "warn" | "error"
	LogLevel string `json:"logLevel,omitempty"`
}

Jump to

Keyboard shortcuts

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