Documentation ¶
Index ¶
- Constants
- func DelayLoader[T interface{}](loader agencyCache.StateLoader[T], delay time.Duration) agencyCache.StateLoader[T]
- func GetAgencyKey(parts ...string) string
- func GetAgencyState[T interface{}](ctx context.Context, connection conn.Connection) (T, error)
- func InvalidateOnErrorLoader[T interface{}](loader agencyCache.StateLoader[T]) agencyCache.StateLoader[T]
- func NewSimpleStateLoader[T interface{}]() agencyCache.StateLoader[T]
- func RefreshLoader[T interface{}](loader agencyCache.StateLoader[T], delay time.Duration) agencyCache.StateLoader[T]
- func RetryLoader[T interface{}](loader agencyCache.StateLoader[T], retries int) agencyCache.StateLoader[T]
- func StaticLeaderDiscovery(in conn.Connection) agencyCache.LeaderDiscovery
- func TimeoutLoader[T interface{}](loader agencyCache.StateLoader[T], timeout time.Duration) agencyCache.StateLoader[T]
- type Cache
- type Config
- type Connections
- type Health
- type ReadRequest
Constants ¶
View Source
const ( ArangoKey = "arango" ArangoDBKey = "arangodb" PlanKey = "Plan" CurrentKey = "Current" TargetKey = "Target" CurrentMaintenanceServers = "MaintenanceServers" CurrentServersKnown = "ServersKnown" TargetHotBackupKey = "HotBackup" PlanCollectionsKey = "Collections" PlanDatabasesKey = "Databases" SupervisionKey = "Supervision" SupervisionMaintenanceKey = "Maintenance" TargetJobToDoKey = "ToDo" TargetJobPendingKey = "Pending" TargetJobFailedKey = "Failed" TargetJobFinishedKey = "Finished" TargetCleanedServersKey = "CleanedServers" ArangoSyncKey = "arangosync" ArangoSyncStateKey = "synchronizationState" ArangoSyncStateIncomingKey = "incoming" ArangoSyncStateIncomingStateKey = "state" ArangoSyncStateOutgoingKey = "outgoing" ArangoSyncStateOutgoingTargetsKey = "targets" )
Variables ¶
This section is empty.
Functions ¶
func DelayLoader ¶
func DelayLoader[T interface{}](loader agencyCache.StateLoader[T], delay time.Duration) agencyCache.StateLoader[T]
func GetAgencyKey ¶
func GetAgencyState ¶
func GetAgencyState[T interface{}](ctx context.Context, connection conn.Connection) (T, error)
func InvalidateOnErrorLoader ¶
func InvalidateOnErrorLoader[T interface{}](loader agencyCache.StateLoader[T]) agencyCache.StateLoader[T]
func NewSimpleStateLoader ¶
func NewSimpleStateLoader[T interface{}]() agencyCache.StateLoader[T]
func RefreshLoader ¶
func RefreshLoader[T interface{}](loader agencyCache.StateLoader[T], delay time.Duration) agencyCache.StateLoader[T]
func RetryLoader ¶
func RetryLoader[T interface{}](loader agencyCache.StateLoader[T], retries int) agencyCache.StateLoader[T]
func StaticLeaderDiscovery ¶
func StaticLeaderDiscovery(in conn.Connection) agencyCache.LeaderDiscovery
func TimeoutLoader ¶
func TimeoutLoader[T interface{}](loader agencyCache.StateLoader[T], timeout time.Duration) agencyCache.StateLoader[T]
Types ¶
type Cache ¶
type Cache interface { Reload(ctx context.Context, size int, clients Connections) (uint64, error) // Deprecated: Use Apply instead. // It can cause Read/Write error when state is reloaded. Data() (state.State, bool) // Apply applies a function to the current state. Returns true if function was applied Apply(f func(state.State)) bool DataDB() (state.DB, bool) CommitIndex() uint64 // Health returns true when healthy object is available. Health() (Health, bool) // ShardsInSyncMap returns last in sync state of shards. If no state is available, false is returned. ShardsInSyncMap() (state.ShardsSyncStatus, bool) }
func NewAgencyCache ¶
func NewSingleCache ¶
func NewSingleCache() Cache
type Config ¶
type Config struct { LeaderId string `json:"leaderId"` CommitIndex uint64 `json:"commitIndex"` Configuration struct { ID string `json:"id"` } `json:"configuration"` }
func GetAgencyConfig ¶
type Connections ¶
type Connections map[string]conn.Connection
type Health ¶
type Health interface { // Healthy return nil when environment is considered as healthy. Healthy() error // Serving return nil when environment is considered as responsive, but not fully healthy. Serving() error // LeaderID returns a leader ID or empty string if a leader is not known. LeaderID() string CollectMetrics(m metrics.PushMetric) }
Health describes interface to check healthy of the environment.
type ReadRequest ¶
type ReadRequest [][]string
func GetAgencyReadRequest ¶
func GetAgencyReadRequest(elements ...[]string) ReadRequest
func GetAgencyReadRequestFields ¶
func GetAgencyReadRequestFields() ReadRequest
Source Files ¶
Click to show internal directories.
Click to hide internal directories.