nectar

package module
v0.0.0-...-0e62d87 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2018 License: Apache-2.0 Imports: 20 Imported by: 9

README

Nectar

Nectar offers client tools for Hummingbird, a scalable, performant distributed object storage system written in Go that is also a drop in replacement for OpenStack Swift. Nectar should also work with any OpenStack Swift compatible system.

Go Docs

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.

func NewRand

func NewRand(seed int64) *rand.Rand

NewRand returns a rand.Rand that is threadsafe.

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
}

func (*CLIInstance) HelpFlags

func (cli *CLIInstance) HelpFlags(flags *flag.FlagSet) string

HelpFlags returns the formatted help text for the FlagSet given.

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.

type ObjectRecord

type ObjectRecord struct {
	Hash         string `json:"hash"`
	LastModified string `json:"last_modified"`
	Bytes        int    `json:"bytes"`
	Name         string `json:"name"`
	ContentType  string `json:"content_type"`
	Subdir       string `json:"subdir"`
}

*ObjectRecord is an entry in a container 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.

Jump to

Keyboard shortcuts

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