Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrImpossibleMultipart = errors.New("Can't handle multi upload")
ErrImpossibleMultipart is issued if there is no viable backend to store file
var ErrReplicationIndicator = errors.New("Replication required")
ErrReplicationIndicator signals backends where object has to be replicated
var ErrRequestCanceled = fmt.Errorf("Request canceled")
ErrRequestCanceled is returned if request was canceled
Functions ¶
This section is empty.
Types ¶
type BackendResponse ¶
BackendResponse is alias of storage.types.BackendResponse
type BasePicker ¶
type BasePicker struct {
// contains filtered or unexported fields
}
BasePicker contains common methods of pickers
func (*BasePicker) SendSyncLog ¶
func (bp *BasePicker) SendSyncLog(*SyncSender)
SendSyncLog implements picker interface
type Cluster ¶
Cluster stores information about cluster backends
type ClusterStorage ¶
type ClusterStorage interface { GetShard(name string) (NamedShardClient, error) MergeShards(name string, clusters ...NamedShardClient) NamedShardClient }
ClusterStorage is basic cluster storage interface
type MultiPartRoundTripper ¶
type MultiPartRoundTripper struct {
// contains filtered or unexported fields
}
MultiPartRoundTripper handles the multipart upload. If multipart upload is detected, it delegates the request to the backend selected using the active backends hash ring, otherwise the cluster round tripper is used to handle the operation in standard fashion
func (MultiPartRoundTripper) Cancel ¶
func (multiPartRoundTripper MultiPartRoundTripper) Cancel() error
Cancel Client interface
func (*MultiPartRoundTripper) Do ¶
func (multiPartRoundTripper *MultiPartRoundTripper) Do(request *http.Request) <-chan BackendResponse
Do performs backend request
type NamedCluster ¶
type NamedCluster interface { http.RoundTripper Name() string Backends() []*Backend }
NamedCluster interface
type NamedShardClient ¶
type NamedShardClient interface { http.RoundTripper Name() string Backends() []*StorageClient }
NamedShardClient interface
type ObjectResponsePicker ¶
type ObjectResponsePicker struct { BasePicker // contains filtered or unexported fields }
ObjectResponsePicker chooses first successful or one of failure response from chan of `BackendResponse`s
func (*ObjectResponsePicker) Pick ¶
func (orp *ObjectResponsePicker) Pick() (*http.Response, error)
Pick returns first successful response, discards others
func (*ObjectResponsePicker) SendSyncLog ¶
func (orp *ObjectResponsePicker) SendSyncLog(syncLog *SyncSender)
SendSyncLog implements picker interface
type ReplicationClient ¶
type ReplicationClient struct { Backends []*backend.Backend // contains filtered or unexported fields }
ReplicationClient is multiple endpoints client
func (*ReplicationClient) Cancel ¶
func (rc *ReplicationClient) Cancel() error
Cancel requests in progress
func (*ReplicationClient) Do ¶
func (rc *ReplicationClient) Do(request *http.Request) <-chan BackendResponse
Do send request to all given backends
type RequestDispatcher ¶
type RequestDispatcher struct { Backends []*backend.Backend // contains filtered or unexported fields }
RequestDispatcher passes requests and responses to matching replicators and response pickers
func NewRequestDispatcher ¶
func NewRequestDispatcher(backends []*backend.Backend, syncLog *SyncSender) *RequestDispatcher
NewRequestDispatcher creates RequestDispatcher instance
type ShardClient ¶
ShardClient stores information about cluster backends
func (*ShardClient) Backends ¶
func (c *ShardClient) Backends() []*StorageClient
Backends get http.RoundTripper slice
type StorageClient ¶
StorageClient is alias of storage.types.StorageClient
type Storages ¶
type Storages struct { ShardClients map[string]NamedShardClient Backends map[string]*StorageClient // contains filtered or unexported fields }
Storages config
func InitStorages ¶
func InitStorages(transport http.RoundTripper, clustersConf config.ShardsMap, storagesMap config.StoragesMap, syncLog *SyncSender) (*Storages, error)
InitStorages setups storages
func (*Storages) GetShard ¶
func (st *Storages) GetShard(name string) (NamedShardClient, error)
GetShard gets cluster by name or nil if cluster with given name was not found
func (*Storages) MergeShards ¶
func (st *Storages) MergeShards(name string, clusters ...NamedShardClient) NamedShardClient
MergeShards extends Clusters list of Storages by cluster made of joined clusters backends and returns it. If cluster of given name is already defined returns previously defined cluster instead.
type SyncSender ¶
SyncSender filters and writes inconsistencies to synclog