Documentation ¶
Index ¶
- Variables
- func CreateArangodAgencyClient(ctx context.Context, cli corev1.CoreV1Interface, ...) (agency.Agency, error)
- func CreateArangodClient(ctx context.Context, cli corev1.CoreV1Interface, ...) (driver.Client, error)
- func CreateArangodDatabaseClient(ctx context.Context, cli corev1.CoreV1Interface, ...) (driver.Client, error)
- func CreateArangodImageIDClient(ctx context.Context, deployment k8sutil.APIObject, role, id string) (driver.Client, error)
- 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 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 CleanoutJobStatus
- type NotLeaderError
- type NumberOfServers
Constants ¶
This section is empty.
Variables ¶
var (
KeyNotFoundError = errors.New("Key not found")
)
Functions ¶
func CreateArangodAgencyClient ¶
func CreateArangodAgencyClient(ctx context.Context, cli corev1.CoreV1Interface, apiObject *api.ArangoDeployment) (agency.Agency, error)
CreateArangodAgencyClient creates a go-driver client for accessing the agents of the given deployment.
func CreateArangodClient ¶
func CreateArangodClient(ctx context.Context, cli corev1.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 corev1.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, role, id string) (driver.Client, error)
CreateArangodImageIDClient creates a go-driver client for an ArangoDB instance running in an Image-ID pod.
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 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 CleanoutJobStatus ¶
type CleanoutJobStatus struct {
// contains filtered or unexported fields
}
CleanoutJobStatus is a strongly typed status of an agency cleanout-server-job.
func CleanoutServerJobStatus ¶
func CleanoutServerJobStatus(ctx context.Context, jobID string, client driver.Client, agencyClient agency.Agency) (CleanoutJobStatus, error)
CleanoutServerJobStatus checks the status of a cleanout-server job with given ID.
func (CleanoutJobStatus) IsFailed ¶
func (s CleanoutJobStatus) IsFailed() bool
IsFailed returns true when the job is failed
func (CleanoutJobStatus) IsFinished ¶
func (s CleanoutJobStatus) IsFinished() bool
IsFinished returns true when the job is finished
func (CleanoutJobStatus) Reason ¶
func (s CleanoutJobStatus) Reason() string
Reason returns the reason for the current state.
func (CleanoutJobStatus) String ¶
func (s CleanoutJobStatus) String() string
String returns a string representation of the given state.
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.