Documentation ¶
Overview ¶
Package nectar defines client tools for Hummingbird.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CLI ¶
func CLI(args []string, fatal func(cli *CLIInstance, err error), fatalf func(cli *CLIInstance, frmt string, args ...interface{}), verbosef func(cli *CLIInstance, frmt string, args ...interface{}))
CLI runs a nectar command-line-interface with the given args (args[0] should have the name of the executable). The fatal, fatalf, and verbosef parameters may be nil for the defaults. The default fatal and fatalf functions will call os.Exit(1) after emitting error (or help) text.
Types ¶
type CLIInstance ¶
type CLIInstance struct { Arg0 string GlobalFlags *flag.FlagSet GlobalFlagVerbose *bool BenchDeleteFlags *flag.FlagSet BenchGetFlags *flag.FlagSet BenchHeadFlags *flag.FlagSet BenchMixedFlags *flag.FlagSet BenchPostFlags *flag.FlagSet BenchPutFlags *flag.FlagSet DownloadFlags *flag.FlagSet GetFlags *flag.FlagSet // contains filtered or unexported fields }
type Client ¶
type Client interface { GetURL() string PutAccount(headers map[string]string) *http.Response PostAccount(headers map[string]string) *http.Response // GetAccount reads the body of the response and converts it into a // []*ContainerRecord while also returning the response instance itself. GetAccount(marker string, endMarker string, limit int, prefix string, delimiter string, reverse bool, headers map[string]string) ([]*ContainerRecord, *http.Response) GetAccountRaw(marker string, endMarker string, limit int, prefix string, delimiter string, reverse bool, headers map[string]string) *http.Response HeadAccount(headers map[string]string) *http.Response DeleteAccount(headers map[string]string) *http.Response PutContainer(container string, headers map[string]string) *http.Response PostContainer(container string, headers map[string]string) *http.Response // GetContainer reads the body of the response and converts it into an // []*ObjectRecord while also returning the response instance itself. GetContainer(container string, marker string, endMarker string, limit int, prefix string, delimiter string, reverse bool, headers map[string]string) ([]*ObjectRecord, *http.Response) GetContainerRaw(container string, marker string, endMarker string, limit int, prefix string, delimiter string, reverse bool, headers map[string]string) *http.Response HeadContainer(container string, headers map[string]string) *http.Response DeleteContainer(container string, headers map[string]string) *http.Response PutObject(container string, obj string, headers map[string]string, src io.Reader) *http.Response PostObject(container string, obj string, headers map[string]string) *http.Response GetObject(container string, obj string, headers map[string]string) *http.Response HeadObject(container string, obj string, headers map[string]string) *http.Response DeleteObject(container string, obj string, headers map[string]string) *http.Response Raw(method, urlAfterAccount string, headers map[string]string, body io.Reader) *http.Response SetUserAgent(string) }
Client is an API interface to CloudFiles.
func NewClient ¶
func NewClient(tenant string, username string, password string, apikey string, region string, authurl string, private bool, overrideURLs []string) (Client, *http.Response)
NewClient creates a new end-user client. It authenticates immediately, and returns the error response if unable to.
func NewInsecureClient ¶
func NewInsecureClient(tenant string, username string, password string, apikey string, region string, authurl string, private bool) (Client, *http.Response)
NewInsecureClient creates a new end-user client with SSL verification turned off. It authenticates immediately, and returns the error response if unable to.
type ClientToken ¶
type ClientToken interface {
GetToken() string
}
ClientToken is an extension to the Client interface allowing the retrieval of the usually internal authentication token, usually for debugging purposes.
type ContainerRecord ¶
type ContainerRecord struct { Count int64 `json:"count"` Bytes int64 `json:"bytes"` Name string `json:"name"` }
ContainerRecord is an entry in an account listing.
Directories ¶
Path | Synopsis |
---|---|
Package main defines the nectar command line tool.
|
Package main defines the nectar command line tool. |
Package nectarutil contains tools for use with nectar.
|
Package nectarutil contains tools for use with nectar. |