arangod

package
v0.0.0-...-d3ccc4f Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2018 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

func IsDBServerEmpty(ctx context.Context, id string, client driver.Client) error

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

func IsKeyNotFound(err error) bool

IsKeyNotFound returns true if the given error is (or is caused by) a KeyNotFoundError.

func IsNotLeader

func IsNotLeader(err error) (string, bool)

IsNotLeader returns true if the given error is (or is caused by) a NotLeaderError.

func IsSameEndpoint_

func IsSameEndpoint_(a, b string) bool

IsSameEndpoint returns true when the 2 given endpoints refer to the same server.

func RemoveServerFromCluster

func RemoveServerFromCluster(ctx context.Context, conn driver.Connection, id driver.ServerID) error

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

func WithRequireAuthentication(ctx context.Context) context.Context

WithRequireAuthentication prepares a context that when given to functions in this file will fail when authentication is not available.

func WithSkipAuthentication

func WithSkipAuthentication(ctx context.Context) context.Context

WithSkipAuthentication prepares a context that when given to functions in this file will avoid creating any authentication for arango clients.

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.

func (NotLeaderError) Error

func (e NotLeaderError) Error() string

Error implements error.

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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