manta

package module
Version: v0.0.0-...-c0ac332 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2013 License: BSD-2-Clause Imports: 18 Imported by: 0

README

manta

Joyent Manta client for Go

installation

go get github.com/davecheney/manta/...

usage

See godoc.org/github.com/davecheney/manta

roadmap / todo

Documentation

Overview

Manta implements a client for the Joyent Manta API. http://apidocs.joyent.com/manta/index.html.

Included in the package is an incomplete implementation of the CLI Utilities. http://apidocs.joyent.com/manta/commands-reference.html

Index

Constants

This section is empty.

Variables

View Source
var (
	MANTA_USER   string
	MANTA_URL    string
	MANTA_KEY_ID string
)

Functions

func Flags

func Flags() *flag.FlagSet

Flags returns a flag.FlagSet containing the shared flags required for DefaultClient.

Types

type Client

type Client struct {
	User  string
	KeyId string
	Key   string
	Url   string
	// contains filtered or unexported fields
}

Client is a Manta client. Client is not safe for concurrent use.

func DefaultClient

func DefaultClient() *Client

DefaultClient returns a Client instance configured from the default Manta environment variables.

func (*Client) Do

func (c *Client) Do(method, path string, r io.Reader) (*http.Response, error)

Do executes a method request and returns the response.

func (*Client) Get

func (c *Client) Get(path string) (*http.Response, error)

Get executes a GET request and returns the response.

func (*Client) NewRequest

func (c *Client) NewRequest(method, path string, r io.Reader) (*http.Request, error)

NewRequest is similar to http.NewRequest except it appends path to the API endpoint this client is configured for.

func (*Client) Put

func (c *Client) Put(path string, r io.Reader) (*http.Response, error)

Put executes a PUT request and returns the response.

func (*Client) SignRequest

func (c *Client) SignRequest(req *http.Request) error

SignRequest signs the 'date' field of req.

type Signer

type Signer interface {
	// Sign returns raw signature for the given data. This method
	// will apply the hash specified for the keytype to the data.
	Sign(data []byte) ([]byte, error)
}

A Signer is can create signatures that verify against a public key.

Source Files

Directories

Path Synopsis
mget - download an object from Manta.
mget - download an object from Manta.
mls - list directory contents.
mls - list directory contents.
mput - create an object http://apidocs.joyent.com/manta/mput.html
mput - create an object http://apidocs.joyent.com/manta/mput.html

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL