storage

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InProgress

type InProgress struct {
	Bucket  string
	Timeout time.Duration
	Client  s3iface.S3API
	types.Storage
}

InProgress is an implementation of Storage which is intended to decorate the S3 implementation.

The decorator will check if a graph is in progress, and if so, will return types.ErrInProgress. On a successful Store operation, the decorator will remove the graph's "in progress" status.

func (*InProgress) Exists

func (s *InProgress) Exists(ctx context.Context, key string) (bool, error)

Exists returns true if the graph exists, but does not download the graph body.

If the graph is in the process of being created, an error will be returned of type types.ErrInProgress

func (*InProgress) Get

func (s *InProgress) Get(ctx context.Context, key string) (io.ReadCloser, error)

Get returns the graph for the given key.

If the graph is in the process of being created, an error will be returned of type types.ErrInProgress

type S3

type S3 struct {
	Bucket string
	Client s3iface.S3API
	// contains filtered or unexported fields
}

S3 implements the Storage interface and uses S3 as the backing store for graph

func (*S3) Exists

func (s *S3) Exists(ctx context.Context, key string) (bool, error)

Exists returns true if the graph exists, but does not download the graph body.

func (*S3) Get

func (s *S3) Get(ctx context.Context, key string) (io.ReadCloser, error)

Get returns the graph for the given key. The graph is returned as a gzipped payload. It is the caller's responsibility to call Close on the Reader when done.

func (*S3) Store

func (s *S3) Store(ctx context.Context, key string, data io.ReadCloser) error

Store stores the graph. It is the caller's responsibility to call Close on the Reader when done.

Jump to

Keyboard shortcuts

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