client

package
v0.0.0-...-2f3b49c Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2018 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const PostQuorumTimeoutMs = 100

Variables

View Source
var NilContainerInfo = &ContainerInfo{}

NilContainerInfo is useful for testing.

Functions

This section is empty.

Types

type ContainerInfo

type ContainerInfo struct {
	ReadACL            string
	WriteACL           string
	SyncKey            string
	ObjectCount        int64
	ObjectBytes        int64
	Metadata           map[string]string
	SysMetadata        map[string]string
	StoragePolicyIndex int
}

ContainerInfo is persisted in memcache via JSON; so this needs to continue to have public fields.

type ProxyClient

type ProxyClient interface {
	PutAccount(account string, headers http.Header) *http.Response
	PostAccount(account string, headers http.Header) *http.Response
	GetAccount(account string, options map[string]string, headers http.Header) *http.Response
	HeadAccount(account string, headers http.Header) *http.Response
	DeleteAccount(account string, headers http.Header) *http.Response
	PutContainer(account string, container string, headers http.Header) *http.Response
	PostContainer(account string, container string, headers http.Header) *http.Response
	GetContainer(account string, container string, options map[string]string, headers http.Header) *http.Response
	GetContainerInfo(account string, container string) (*ContainerInfo, error)
	SetContainerInfo(account string, container string, resp *http.Response) (*ContainerInfo, error)
	HeadContainer(account string, container string, headers http.Header) *http.Response
	DeleteContainer(account string, container string, headers http.Header) *http.Response
	PutObject(account string, container string, obj string, headers http.Header, src io.Reader) *http.Response
	PostObject(account string, container string, obj string, headers http.Header) *http.Response
	GetObject(account string, container string, obj string, headers http.Header) *http.Response
	HeadObject(account string, container string, obj string, headers http.Header) *http.Response
	DeleteObject(account string, container string, obj string, headers http.Header) *http.Response
	// ObjectRingFor returns the object ring for the given account/container or
	// a response as to why the ring could not be returned.
	ObjectRingFor(account string, container string) (ring.Ring, *http.Response)
	ContainerRing() ring.Ring
}

ProxyClient is similar to github.com/troubling/nectar.Client except it also accepts an account parameter to its operations. This is meant to be used by the proxy server.

type ProxyDirectClient

type ProxyDirectClient struct {
	AccountRing   ring.Ring
	ContainerRing ring.Ring

	Logger srv.LowLevelLogger
	// contains filtered or unexported fields
}

func NewProxyDirectClient

func NewProxyDirectClient(policyList conf.PolicyList, cnf srv.ConfigLoader, logger srv.LowLevelLogger, certFile, keyFile string) (*ProxyDirectClient, error)

func (*ProxyDirectClient) DeleteAccount

func (c *ProxyDirectClient) DeleteAccount(account string, headers http.Header) *http.Response

func (*ProxyDirectClient) DeleteContainer

func (c *ProxyDirectClient) DeleteContainer(account string, container string, headers http.Header) *http.Response

func (*ProxyDirectClient) DeleteObject

func (c *ProxyDirectClient) DeleteObject(account string, container string, obj string, headers http.Header, mc ring.MemcacheRing, lc map[string]*ContainerInfo) *http.Response

func (*ProxyDirectClient) GetAccount

func (c *ProxyDirectClient) GetAccount(account string, options map[string]string, headers http.Header) *http.Response

func (*ProxyDirectClient) GetContainer

func (c *ProxyDirectClient) GetContainer(account string, container string, options map[string]string, headers http.Header) *http.Response

func (*ProxyDirectClient) GetContainerInfo

func (c *ProxyDirectClient) GetContainerInfo(account string, container string, mc ring.MemcacheRing, lc map[string]*ContainerInfo) (*ContainerInfo, error)

func (*ProxyDirectClient) GetObject

func (c *ProxyDirectClient) GetObject(account string, container string, obj string, headers http.Header, mc ring.MemcacheRing, lc map[string]*ContainerInfo) *http.Response

func (*ProxyDirectClient) GrepObject

func (c *ProxyDirectClient) GrepObject(account string, container string, obj string, search string, mc ring.MemcacheRing, lc map[string]*ContainerInfo) *http.Response

func (*ProxyDirectClient) HeadAccount

func (c *ProxyDirectClient) HeadAccount(account string, headers http.Header) *http.Response

func (*ProxyDirectClient) HeadContainer

func (c *ProxyDirectClient) HeadContainer(account string, container string, headers http.Header) *http.Response

func (*ProxyDirectClient) HeadObject

func (c *ProxyDirectClient) HeadObject(account string, container string, obj string, headers http.Header, mc ring.MemcacheRing, lc map[string]*ContainerInfo) *http.Response

func (*ProxyDirectClient) ObjectRingFor

func (c *ProxyDirectClient) ObjectRingFor(account string, container string, mc ring.MemcacheRing, lc map[string]*ContainerInfo) (ring.Ring, *http.Response)

func (*ProxyDirectClient) PostAccount

func (c *ProxyDirectClient) PostAccount(account string, headers http.Header) *http.Response

func (*ProxyDirectClient) PostContainer

func (c *ProxyDirectClient) PostContainer(account string, container string, headers http.Header) *http.Response

func (*ProxyDirectClient) PostObject

func (c *ProxyDirectClient) PostObject(account string, container string, obj string, headers http.Header, mc ring.MemcacheRing, lc map[string]*ContainerInfo) *http.Response

func (*ProxyDirectClient) PutAccount

func (c *ProxyDirectClient) PutAccount(account string, headers http.Header) *http.Response

func (*ProxyDirectClient) PutContainer

func (c *ProxyDirectClient) PutContainer(account string, container string, headers http.Header) *http.Response

func (*ProxyDirectClient) PutObject

func (c *ProxyDirectClient) PutObject(account string, container string, obj string, headers http.Header, src io.Reader, mc ring.MemcacheRing, lc map[string]*ContainerInfo) *http.Response

func (*ProxyDirectClient) SetContainerInfo

func (c *ProxyDirectClient) SetContainerInfo(account, container string, mc ring.MemcacheRing, lc map[string]*ContainerInfo, resp *http.Response) (*ContainerInfo, error)

Jump to

Keyboard shortcuts

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