store

package
v0.0.0-...-c8a8185 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Providers = map[string]NewStoreFunc{}
)

Functions

func Archive

func Archive(ctx context.Context, entries EntryList) ([]byte, error)

func Bundle

func Bundle(ctx context.Context, loader bundle.DirectoryLoader) ([]byte, error)

func IsErrorCode

func IsErrorCode(err error, code int) bool

func NormalizePath

func NormalizePath(p string) string

func NotFoundError

func NotFoundError(format string, args ...interface{}) error

Types

type Entry

type Entry struct {
	Key   string `json:"key"`
	Value []byte `json:"value"`
	// contains filtered or unexported fields
}

Entry type implements os.FileInfo

func (*Entry) IsDir

func (e *Entry) IsDir() bool

func (*Entry) ModTime

func (e *Entry) ModTime() time.Time

func (*Entry) Mode

func (e *Entry) Mode() os.FileMode

func (*Entry) Name

func (e *Entry) Name() string

func (*Entry) Size

func (e *Entry) Size() int64

func (*Entry) Sys

func (e *Entry) Sys() interface{}

type EntryList

type EntryList []*Entry

func (EntryList) Len

func (e EntryList) Len() int

func (EntryList) Less

func (e EntryList) Less(i, j int) bool

func (EntryList) Swap

func (e EntryList) Swap(i, j int)

type Err

type Err struct {
	Code   int    `json:"code"`
	Status string `json:"status"`
	Detail string `json:"detail"`
}

func ParseError

func ParseError(err error) (e *Err, parseErr error)

func (*Err) Error

func (e *Err) Error() string

type Manifest

type Manifest struct {
	Revision string   `json:"revision"`
	Roots    []string `json:"roots"`
}

type NewStoreFunc

type NewStoreFunc func(opts *Options) (Store, error)

type Options

type Options struct {
	Name   string
	Config interface{}
	Logger logger.Logger
}

type Store

type Store interface {
	Connect(ctx context.Context) (err error)
	Disconnect(ctx context.Context) (err error)
	Bundle(ctx context.Context) ([]byte, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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