storage

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2018 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileStorage

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

func NewFileStorage

func NewFileStorage(pathTpl string, compress bool, logger *logrus.Logger) (*FileStorage, error)

func (*FileStorage) Begin

func (f *FileStorage) Begin(ctx context.Context) (Tx, error)

type GitStorage

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

func NewGitStorage

func NewGitStorage(ctx context.Context, conf *GitStorageConfig, logger *logrus.Logger) (*GitStorage, error)

func (*GitStorage) Begin

func (g *GitStorage) Begin(ctx context.Context) (Tx, error)

type GitStorageConfig

type GitStorageConfig struct {
	// Local repository path
	RepositoryPath string
	URL            string
	Pull           bool
	Username       string
	Password       string
	PemBytes       []byte

	// Name of the remote to be pulled. If empty, uses the default.
	RemoteName string
	// Remote branch to clone. If empty, uses HEAD.
	ReferenceName string
	Push          bool
	// RefSpecs specify what destination ref to update with what source
	// object. A refspec with empty src can be used to delete a reference.
	RefSpecs []string

	// Target path template relative to work tree
	DestinationPath string

	Summary string

	// Author name
	Name string
	// Author email
	Email         string
	CommitMessage string
	// contains filtered or unexported fields
}

type NewStorageFunc

type NewStorageFunc func(context.Context, config.Options, *logrus.Logger) (Storage, error)

type Storage

type Storage interface {
	Begin(ctx context.Context) (Tx, error)
}

func NewStorage

func NewStorage(ctx context.Context, name string, options config.Options, logger *logrus.Logger) (Storage, error)

type Tx

type Tx interface {
	Add(ctx context.Context, metadata devices.Metadata) (WriteCloserWithError, error)
	Timestamp() time.Time
	Commit(ctx context.Context) error
}

type WriteCloserWithError added in v0.1.1

type WriteCloserWithError interface {
	io.WriteCloser
	CloseWithError(err error) error
}

Jump to

Keyboard shortcuts

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