Documentation ¶
Index ¶
- Constants
- Variables
- func NewDirectClient(account string, cnf srv.ConfigLoader, certFile, keyFile string, ...) (nectar.Client, error)
- func NewTransport(tracer opentracing.Tracer, rt http.RoundTripper, enableHTTPTrace bool) (http.RoundTripper, error)
- type ContainerInfo
- type ProxyClient
- type RequestClient
- type TracingClient
Constants ¶
View Source
const PostQuorumTimeoutMs = 100
Variables ¶
View Source
var ContainerNotFound = errors.New("Container Not Found")
View Source
var ErrValidTracerRequired = errors.New("valid tracer required")
ErrValidTracerRequired error
View Source
var NilContainerInfo = &ContainerInfo{}
NilContainerInfo is used for testing.
Functions ¶
func NewDirectClient ¶
func NewDirectClient(account string, cnf srv.ConfigLoader, certFile, keyFile string, logger srv.LowLevelLogger) (nectar.Client, error)
func NewTransport ¶
func NewTransport(tracer opentracing.Tracer, rt http.RoundTripper, enableHTTPTrace bool) (http.RoundTripper, error)
NewTransport returns a new Opentracing instrumented http RoundTripper
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 { NewRequestClient(mc ring.MemcacheRing, lc map[string]*ContainerInfo, logger srv.LowLevelLogger) RequestClient Close() error }
ProxyClient is the factory for RequestClients, and manages any persistent/shared client resources.
func NewProxyClient ¶
func NewProxyClient(policyList conf.PolicyList, cnf srv.ConfigLoader, logger srv.LowLevelLogger, certFile, keyFile, readAffinity, writeAffinity, writeAffinityCount string, serverconf conf.Config) (ProxyClient, error)
type RequestClient ¶
type RequestClient interface { PutAccount(ctx context.Context, account string, headers http.Header) *http.Response PostAccount(ctx context.Context, account string, headers http.Header) *http.Response GetAccountRaw(ctx context.Context, account string, options map[string]string, headers http.Header) *http.Response HeadAccount(ctx context.Context, account string, headers http.Header) *http.Response DeleteAccount(ctx context.Context, account string, headers http.Header) *http.Response PutContainer(ctx context.Context, account string, container string, headers http.Header) *http.Response PostContainer(ctx context.Context, account string, container string, headers http.Header) *http.Response GetContainerRaw(ctx context.Context, account string, container string, options map[string]string, headers http.Header) *http.Response GetContainerInfo(ctx context.Context, account string, container string) (*ContainerInfo, error) SetContainerInfo(ctx context.Context, account string, container string, resp *http.Response) (*ContainerInfo, error) HeadContainer(ctx context.Context, account string, container string, headers http.Header) *http.Response DeleteContainer(ctx context.Context, account string, container string, headers http.Header) *http.Response PutObject(ctx context.Context, account string, container string, obj string, headers http.Header, src io.Reader) *http.Response PostObject(ctx context.Context, account string, container string, obj string, headers http.Header) *http.Response GetObject(ctx context.Context, account string, container string, obj string, headers http.Header) *http.Response HeadObject(ctx context.Context, account string, container string, obj string, headers http.Header) *http.Response DeleteObject(ctx context.Context, 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(ctx context.Context, account string, container string) (ring.Ring, *http.Response) ContainerRing() ring.Ring AccountRing() ring.Ring SetUserAgent(string) }
RequestClient is similar to github.com/troubling/nectar.Client, but its calls accept a context and it is scoped to a specific API request.
type TracingClient ¶
TracingClient holds a opentracing instrumented HTTP Client.
func NewTracingClient ¶
func NewTracingClient(tracer opentracing.Tracer, httpClient *http.Client, enableHTTPTrace bool) (*TracingClient, error)
NewTracingClient returns an HTTP Client adding Opentracing instrumentation around an embedded standard Go http.Client.
Click to show internal directories.
Click to hide internal directories.