store

package
v0.0.0-...-c756989 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const Version = "Version"

Version is the metadata field name

Variables

View Source
var (
	// ErrNotModified is returned when the stored version is the same as provided
	ErrNotModified = errors.New("not modified")

	// ErrVersionConflict when it's trying to update a file with an old version
	ErrVersionConflict = errors.New("version conflict")

	// ErrInvalidVersion when the stored version is missing or invalid
	ErrInvalidVersion = errors.New("invalid version")

	// ErrNotFound when the file is not found
	ErrNotFound = errors.New("not found")
)

Functions

func NewStore

func NewStore(bucket, key, region string, logger *log.Logger) *store

NewStore creates a new store using the provided key and bucket

Types

type Store

type Store interface {

	// GetCurrentVersion retrieves the version stored.
	GetCurrentVersion() (time.Time, error)

	// Get retrieves the file
	Get(time.Time, io.Writer) (time.Time, error)

	// SafePut overwrites the file if the new version is newer than the stored one.
	SafePut(time.Time, int64, io.ReadSeeker) error

	// Overwrite overwrites the version stored.
	Overwrite(int64, io.ReadSeeker) error
}

Store retrieves and updates the TODO list

Jump to

Keyboard shortcuts

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