objstore: github.com/SphereSoftware/objstore/cluster Index | Files

package cluster

import "github.com/SphereSoftware/objstore/cluster"


Package Files

client.go events.go manager.go


var (
    RangeStop   = errors.New("stop")
    ForEachStop = RangeStop
var ErrNotFound = errors.New("not found")

type ClusterManager Uses

type ClusterManager interface {
    ListNodes() ([]*NodeInfo, error)
    Announce(ctx context.Context, nodeID string, event *EventAnnounce) error
    GetObject(ctx context.Context, nodeID string, id string) (io.ReadCloser, error)
    Sync(ctx context.Context, nodeID string,
        list journal.FileMetaList) (added, deleted journal.FileMetaList, err error)

func NewClusterManager Uses

func NewClusterManager(cli *PrivateClient, nodeID string) ClusterManager

type EventAnnounce Uses

type EventAnnounce struct {
    Type EventType `json:"type"`

    FileMeta   *journal.FileMeta `json:"meta"`
    OpaqueData []byte            `json:"data"`

type EventType Uses

type EventType int
const (
    EventUnknown      EventType = 0
    EventFileAdded    EventType = 1
    EventFileDeleted  EventType = 2
    EventOpaqueData   EventType = 3
    EventStopAnnounce EventType = 999

type NodeInfo Uses

type NodeInfo struct {
    ID    string `json:"id"`
    Addr  string `json:"addr"`
    VAddr string `json:"vaddr"`

type NodeIter Uses

type NodeIter func(id, addr, vaddr string) error

type PrivateClient Uses

type PrivateClient struct {
    // contains filtered or unexported fields

func NewPrivateClient Uses

func NewPrivateClient(router astranet.AstraNet) *PrivateClient

NewPrivateClient initializes a new client for the virtual network. Obtain router handle from an initialized private API server.

func (*PrivateClient) ForEachNode Uses

func (p *PrivateClient) ForEachNode(iterFunc NodeIter) error

func (*PrivateClient) GET Uses

func (p *PrivateClient) GET(ctx context.Context, nodeID, path string, body io.Reader) (*http.Response, error)

func (*PrivateClient) POST Uses

func (p *PrivateClient) POST(ctx context.Context, nodeID, path string, body io.Reader) (*http.Response, error)

type SyncResponse Uses

type SyncResponse struct {
    Added   journal.FileMetaList `json:"list_added"`
    Deleted journal.FileMetaList `json:"list_deleted"`

Package cluster imports 13 packages (graph). Updated 2017-09-27. Refresh now. Tools for package owners. This is an inactive package (no imports and no commits in at least two years).