sources

package
v0.1.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Pack

func Pack(sourceInfo *SourceInfo) ([]byte, error)

Pack ...

Types

type FileSource

type FileSource struct {
	Source
	// contains filtered or unexported fields
}

func NewFileSource

func NewFileSource(prefix string) (*FileSource, error)

func (*FileSource) Read

func (c *FileSource) Read(key string) (*SourceInfo, error)

type FileSourceOptions

type FileSourceOptions struct {
	Prefix string `name:"file.prefix" desc:"The basepath for images."`
}

type MinioOptions

type MinioOptions struct {
	Endpoint string   `name:"minio.endpoint" desc:"The Minio endpoint to use."`
	Bucket   string   `name:"minio.bucket" desc:"The Minio bucket to use."`
	UseSSL   bool     `name:"minio.usessl" desc:"Use ssl for Minio."`
	Rewrites []string `name:"minio.rewrites" desc:"An ordered list of rewrite rules, eg. ':key::/new/:key/path'."`
}

type MinioSource

type MinioSource struct {
	Source
	Client         *minio.Client
	Opts           MinioOptions
	RewriteHandler *middleware.RewriteHandler
}

func NewMinioSource

func NewMinioSource(opts MinioOptions) (*MinioSource, error)

func (*MinioSource) Read

func (c *MinioSource) Read(key string) (*SourceInfo, error)

type Source

type Source interface {
	Read(key string) (*SourceInfo, error)
}

type SourceInfo

type SourceInfo struct {
	Payload      []byte
	LastModified string
	ETag         string
}

SourceInfo ...

func ReadFromSources

func ReadFromSources(sources []Source, key string) (*SourceInfo, error)

func Unpack

func Unpack(b []byte) (*SourceInfo, error)

Unpack ...

type SourceOptions

type SourceOptions struct {
	Sources []string `name:"sources" default:"file" desc:"An ordered list of sources, eg. 'minio' or 'minio file'."`

	MinioOptions
	FileSourceOptions
}

Jump to

Keyboard shortcuts

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