storage

package
v0.0.0-...-722e16d Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2015 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoStorage = errors.New("No storage defined")
	ErrNotFound  = errors.New("HTTP 404")
	ErrRange     = errors.New("HTTP 416: Invalid Range")
	Err5xx       = errors.New("HTTP 5xx")
)

Functions

func Get

func Get(requestURI string, offset int64) (rd io.ReadCloser, err error)

Grabs the data stored in requestURI. The requestURI is resolved using the `STORAGE_BASE_URL` as the base.

Retries transient errors `retries` number of times.

Usage:

requestURI := "1/2/3?X-Amz-Algorithm=...&..."
reader, err := storage.Get(requestURI, 0)

func Put

func Put(requestURI string, reader io.Reader) (err error)

Stores the given reader onto the underlying blob storage with the given requestURI. The requestURI is resolved using the `STORAGE_BASE_URL` as the base.

Retries transient errors `retries` number of times.

Usage:

reader := strings.NewReader("hello")
requestURI := "1/2/3?X-Amz-Algorithm=...&..."
err := storage.Put(requestURI, reader)

Types

This section is empty.

Jump to

Keyboard shortcuts

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