objstore

package
v0.0.0-...-c1097c7 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPathNotFound   = errors.New("PathNotFound")
	ErrBucketNotFound = errors.New("BucketNotFound")
)

Functions

func Base

func Base(path string) string

func Dir

func Dir(path string) string

func Join

func Join(parts ...string) string

Types

type Client

type Client struct {
	Host   string // Default from environment: SB_OBJSTORE_HOST
	Key    string // Default from environment: SB_OBJSTORE_KEY
	Secret string // Default from environment: SB_OBJSTORE_SECRET
	EncKey []byte // Default from environment: SB_OBJSTORE_ENC_KEY
	// contains filtered or unexported fields
}

func (*Client) Connect

func (cl *Client) Connect() (err error)

func (*Client) Copy

func (cl *Client) Copy(bucket, srcPath, dstPath string) error

func (*Client) Delete

func (cl *Client) Delete(bucket string, rPaths ...string) error

func (*Client) Get

func (cl *Client) Get(bucket, rPath string) (io.ReadCloser, error)

func (*Client) GetDirTarGZ

func (cl *Client) GetDirTarGZ(bucket, rPath, lPath string) error

func (*Client) GetFile

func (cl *Client) GetFile(bucket, rPath, lPath string) error

func (*Client) GetFileGZ

func (cl *Client) GetFileGZ(bucket, rPath, lPath string) error

func (*Client) GetGZ

func (cl *Client) GetGZ(bucket, rPath string) (io.ReadCloser, error)

GetGZ: like Get, but decompresses the data stream.

func (*Client) List

func (cl *Client) List(
	bucket,
	prefix string,
	recursive bool,
) (
	[]FileInfo,
	error,
)

func (*Client) ListBaseNames

func (cl *Client) ListBaseNames(bucket, prefix string) ([]string, error)

func (*Client) ListNames

func (cl *Client) ListNames(bucket, prefix string) ([]string, error)

func (*Client) Put

func (cl *Client) Put(r io.Reader, bucket, rPath string) error

func (*Client) PutBytes

func (cl *Client) PutBytes(buf []byte, bucket, rPath string) error

func (*Client) PutDirTarGZ

func (cl *Client) PutDirTarGZ(lPath, bucket, rPath string) error

func (*Client) PutFile

func (cl *Client) PutFile(lPath, bucket, rPath string) (err error)

func (*Client) PutFileGZ

func (cl *Client) PutFileGZ(lPath, bucket, rPath string) error

func (*Client) PutGZ

func (cl *Client) PutGZ(r io.Reader, bucket, rPath string) error

PutGZ: Like Put, but compresses the data stream before sending.

func (*Client) PutNC

func (cl *Client) PutNC(r io.Reader, bucket, rPath string) error

func (*Client) PutNCFileGZ

func (cl *Client) PutNCFileGZ(lPath, bucket, rPath string) error

func (*Client) PutNCGZ

func (cl *Client) PutNCGZ(r io.Reader, bucket, rPath string) error

PutGZ: Like PutNC, but compresses the data stream before sending.

func (*Client) Stat

func (cl *Client) Stat(bucket, rPath string) (FileInfo, error)

type FileInfo

type FileInfo struct {
	Name    string    // Full path to the object.
	ModTime time.Time // Modification time.
	Size    int64     // Size in storage.
}

Jump to

Keyboard shortcuts

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