Documentation ¶
Index ¶
- Variables
- func CleanNumberOfServers(ctx context.Context, conn driver.Connection) error
- func CreateArangodClient(ctx context.Context, cli typedCore.CoreV1Interface, ...) (driver.Client, error)
- func CreateArangodDatabaseClient(ctx context.Context, cli typedCore.CoreV1Interface, ...) (driver.Client, error)
- func CreateArangodImageIDClient(ctx context.Context, deployment k8sutil.APIObject, ip string) (driver.Client, error)
- func GroupsWithLicenseV2() api.ServerGroups
- func IsDBServerEmpty(ctx context.Context, id string, client driver.Client) error
- func IsKeyNotFound(err error) bool
- func IsNotLeader(err error) (string, bool)
- func IsSameEndpoint_(a, b string) bool
- func IsServerAvailable(ctx context.Context, c driver.Client) (bool, error)
- func RemoveServerFromCluster(ctx context.Context, conn driver.Connection, id driver.ServerID) error
- func SetNumberOfServers(ctx context.Context, conn driver.Connection, noCoordinators, noDBServers *int) error
- func WithRequireAuthentication(ctx context.Context) context.Context
- func WithSkipAuthentication(ctx context.Context) context.Context
- type NotLeaderError
- type NumberOfServers
Constants ¶
This section is empty.
Variables ¶
var (
KeyNotFoundError = errors.New("Key not found")
)
Functions ¶
func CleanNumberOfServers ¶
func CleanNumberOfServers(ctx context.Context, conn driver.Connection) error
CleanNumberOfServers removes the server count
func CreateArangodClient ¶
func CreateArangodClient(ctx context.Context, cli typedCore.CoreV1Interface, apiObject *api.ArangoDeployment, group api.ServerGroup, id string) (driver.Client, error)
CreateArangodClient creates a go-driver client for a specific member in the given group.
func CreateArangodDatabaseClient ¶
func CreateArangodDatabaseClient(ctx context.Context, cli typedCore.CoreV1Interface, apiObject *api.ArangoDeployment, shortTimeout bool) (driver.Client, error)
CreateArangodDatabaseClient creates a go-driver client for accessing the entire cluster (or single server).
func CreateArangodImageIDClient ¶
func CreateArangodImageIDClient(ctx context.Context, deployment k8sutil.APIObject, ip string) (driver.Client, error)
CreateArangodImageIDClient creates a go-driver client for an ArangoDB instance running in an Image-ID pod.
func GroupsWithLicenseV2 ¶
func GroupsWithLicenseV2() api.ServerGroups
func IsDBServerEmpty ¶
IsDBServerEmpty checks if the dbserver identified by the given ID no longer has any data on it. The given driver must have all coordinators as endpoints. The functions returns an error when the check could not be completed or the dbserver is not empty, or nil when the dbserver is found to be empty.
func IsKeyNotFound ¶
IsKeyNotFound returns true if the given error is (or is caused by) a KeyNotFoundError.
func IsNotLeader ¶
IsNotLeader returns true if the given error is (or is caused by) a NotLeaderError.
func IsSameEndpoint_ ¶
IsSameEndpoint returns true when the 2 given endpoints refer to the same server.
func IsServerAvailable ¶
IsServerAvailable returns true when server is available. In active fail-over mode one of the server should be available.
func RemoveServerFromCluster ¶
RemoveServerFromCluster tries to remove a coordinator or DBServer from the cluster.
func SetNumberOfServers ¶
func SetNumberOfServers(ctx context.Context, conn driver.Connection, noCoordinators, noDBServers *int) error
SetNumberOfServers updates the number of servers the cluster has.
func WithRequireAuthentication ¶
WithRequireAuthentication prepares a context that when given to functions in this file will fail when authentication is not available.
Types ¶
type NotLeaderError ¶
type NotLeaderError struct {
Leader string // Endpoint of the current leader
}
NotLeaderError indicates the response of an agent when it is not the leader of the agency.
type NumberOfServers ¶
type NumberOfServers struct { Coordinators *int `json:"numberOfCoordinators,omitempty"` DBServers *int `json:"numberOfDBServers,omitempty"` }
NumberOfServers is the JSON structure return for the numberOfServers API call.
func GetNumberOfServers ¶
func GetNumberOfServers(ctx context.Context, conn driver.Connection) (NumberOfServers, error)
GetNumberOfServers fetches the number of servers the cluster wants to have.
func (NumberOfServers) GetCoordinators ¶
func (n NumberOfServers) GetCoordinators() int
GetCoordinators returns Coordinators if not nil, otherwise 0.
func (NumberOfServers) GetDBServers ¶
func (n NumberOfServers) GetDBServers() int
GetDBServers returns DBServers if not nil, otherwise 0.