routes

package
v0.0.0-...-ac41614 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SnapshotProcessing string = "processing"
	SnapshotFailed     string = "failed"
	SnapshotComplete   string = "completed"
	SnapshotMissing    string = "missing"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type APIEntry

type APIEntry struct {
	Prefix   string   `json:"prefix"`
	Key      string   `json:"key"`
	Context  string   `json:"context"`
	Siblings []string `json:"siblings"`
}

type BatchResult

type BatchResult struct {
	// Number of replicas that the batch was successfully applied to
	NApplied uint64 `json:"nApplied"`
	// Number of replicas in the replica set for this site
	Replicas uint64 `json:"replicas"`
	// Was write quorum achieved
	Quorum bool
	Patch  map[string]*SiblingSet `json:"patch"`
}

type ClusterEndpoint

type ClusterEndpoint struct {
	ClusterFacade ClusterFacade
}

func (*ClusterEndpoint) Attach

func (clusterEndpoint *ClusterEndpoint) Attach(router *mux.Router)

type ClusterFacade

type ClusterFacade interface {
	AddNode(ctx context.Context, nodeConfig NodeConfig) error
	RemoveNode(ctx context.Context, nodeID uint64) error
	ReplaceNode(ctx context.Context, nodeID uint64, replacementNodeID uint64) error
	DecommissionPeer(nodeID uint64) error
	Decommission() error
	LocalNodeID() uint64
	PeerAddress(nodeID uint64) PeerAddress
	AddRelay(ctx context.Context, relayID string) error
	RemoveRelay(ctx context.Context, relayID string) error
	MoveRelay(ctx context.Context, relayID string, siteID string) error
	AddSite(ctx context.Context, siteID string) error
	RemoveSite(ctx context.Context, siteID string) error
	Batch(siteID string, bucket string, updateBatch *UpdateBatch) (BatchResult, error)
	LocalBatch(partition uint64, siteID string, bucket string, updateBatch *UpdateBatch) (map[string]*SiblingSet, error)
	LocalMerge(partition uint64, siteID string, bucket string, patch map[string]*SiblingSet, broadcastToRelays bool) error
	Get(siteID string, bucket string, keys [][]byte) ([]*SiblingSet, error)
	LocalGet(partition uint64, siteID string, bucket string, keys [][]byte) ([]*SiblingSet, error)
	GetMatches(siteID string, bucket string, keys [][]byte) (SiblingSetIterator, error)
	LocalGetMatches(partition uint64, siteID string, bucket string, keys [][]byte) (SiblingSetIterator, error)
	AcceptRelayConnection(conn *websocket.Conn, header http.Header)
	ClusterNodes() []NodeConfig
	ClusterSettings() ClusterSettings
	PartitionDistribution() [][]uint64
	TokenAssignments() []uint64
	GetRelayStatus(ctx context.Context, relayID string) (RelayStatus, error)
	LocalGetRelayStatus(relayID string) (RelayStatus, error)
	LocalLogDump() (LogDump, error)
	ClusterSnapshot(ctx context.Context) (Snapshot, error)
	CheckLocalSnapshotStatus(snapshotId string) error
	WriteLocalSnapshot(snapshotId string, w io.Writer) error
}

type ClusterOverview

type ClusterOverview struct {
	Nodes                 []NodeConfig
	ClusterSettings       ClusterSettings
	PartitionDistribution [][]uint64
	TokenAssignments      []uint64
}

type InternalEntry

type InternalEntry struct {
	Prefix   string
	Key      string
	Siblings *SiblingSet
}

func (*InternalEntry) ToAPIEntry

func (entry *InternalEntry) ToAPIEntry() *APIEntry

type KubernetesEndpoint

type KubernetesEndpoint struct {
}

func (*KubernetesEndpoint) Attach

func (kubernetesEndpoint *KubernetesEndpoint) Attach(router *mux.Router)

type LogDump

type LogDump struct {
	BaseSnapshot    LogSnapshot
	Entries         []LogEntry
	CurrentSnapshot LogSnapshot
}

type LogDumpEndpoint

type LogDumpEndpoint struct {
	ClusterFacade ClusterFacade
}

func (*LogDumpEndpoint) Attach

func (logDumpEndpoint *LogDumpEndpoint) Attach(router *mux.Router)

type LogEntry

type LogEntry struct {
	Index   uint64
	Command ClusterCommand
}

type LogSnapshot

type LogSnapshot struct {
	Index uint64
	State ClusterState
}

type PartitionsEndpoint

type PartitionsEndpoint struct {
	ClusterFacade ClusterFacade
}

func (*PartitionsEndpoint) Attach

func (partitionsEndpoint *PartitionsEndpoint) Attach(router *mux.Router)

type ProfilerEndpoint

type ProfilerEndpoint struct {
}

func (*ProfilerEndpoint) Attach

func (profiler *ProfilerEndpoint) Attach(router *mux.Router)

type PrometheusEndpoint

type PrometheusEndpoint struct {
}

func (*PrometheusEndpoint) Attach

func (prometheusEndpoint *PrometheusEndpoint) Attach(router *mux.Router)

type RelaySettingsPatch

type RelaySettingsPatch struct {
	Site string `json:"site"`
}

type RelayStatus

type RelayStatus struct {
	Connected   bool
	ConnectedTo uint64
	Ping        time.Duration
	Site        string
}

type RelaysEndpoint

type RelaysEndpoint struct {
	ClusterFacade ClusterFacade
}

func (*RelaysEndpoint) Attach

func (relaysEndpoint *RelaysEndpoint) Attach(router *mux.Router)

type SitesEndpoint

type SitesEndpoint struct {
	ClusterFacade ClusterFacade
}

func (*SitesEndpoint) Attach

func (sitesEndpoint *SitesEndpoint) Attach(outerRouter *mux.Router)

type Snapshot

type Snapshot struct {
	UUID   string `json:"uuid"`
	Status string `json:"status"`
}

type SnapshotEndpoint

type SnapshotEndpoint struct {
	ClusterFacade ClusterFacade
}

func (*SnapshotEndpoint) Attach

func (snapshotEndpoint *SnapshotEndpoint) Attach(router *mux.Router)

type SyncEndpoint

type SyncEndpoint struct {
	ClusterFacade ClusterFacade
	Upgrader      websocket.Upgrader
}

func (*SyncEndpoint) Attach

func (syncEndpoint *SyncEndpoint) Attach(router *mux.Router)

Jump to

Keyboard shortcuts

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