Documentation
¶
Index ¶
- Constants
- func CreatePersistentVolumeClaimName(deploymentName, role, id string) string
- func CreatePodHostName(deploymentName, role, id string) string
- func FixupResourceName(name string) string
- func PrefixResourceError(prefix string, err error) error
- func PrefixResourceErrorFunc(prefix string, f func() error) error
- func PrefixResourceErrors(prefix string, errs ...error) error
- func RenderResourceName(in string, keys map[string]string) string
- func StripArangodPrefix(id string) string
- func Validate[T any](in T) error
- func ValidateAPIPath(path string) error
- func ValidateAnyNotNil[T any](msg string, obj ...*T) error
- func ValidateExclusiveFields(in any, expected int, fields ...string) error
- func ValidateImage(image string) error
- func ValidateInterfaceList[T ValidateInterface](in []T) error
- func ValidateInterfaceMap[T ValidateInterface](in map[string]T) error
- func ValidateList[T any](in []T, validator func(T) error, checks ...func(in []T) error) error
- func ValidateMap[T any](in map[string]T, validator func(string, T) error, ...) error
- func ValidateOptional[T any](in *T, validator func(T) error) error
- func ValidateOptionalInterface[T ValidateInterface](in T) error
- func ValidateOptionalInterfacePath[T ValidateInterface](path string, in T) error
- func ValidateOptionalPath[T any](path string, in *T, validator func(T) error) error
- func ValidateOptionalResourceName(name string) error
- func ValidatePullPolicy(in core.PullPolicy) error
- func ValidateRequired[T any](in *T, validator func(T) error) error
- func ValidateRequiredInterface[T ValidateInterface](in T) error
- func ValidateRequiredInterfacePath[T ValidateInterface](path string, in T) error
- func ValidateRequiredPath[T any](path string, in *T, validator func(T) error) error
- func ValidateResourceName(name string) error
- func ValidateResourceNamePointer(name *string) error
- func ValidateServiceType(st core.ServiceType) error
- func ValidateUID(uid types.UID) error
- func WithErrors(errs ...error) error
- type MergedErrors
- type ResourceError
- type ValidateInterface
Constants ¶
const ( // Arango constants ArangoPort = 8529 ArangoSyncMasterPort = 8629 ArangoSyncWorkerPort = 8729 ArangoExporterPort = 9101 ArangoExporterStatusEndpoint = "/_api/version" ArangoExporterClusterHealthEndpoint = "/_admin/cluster/health" ArangoExporterInternalEndpoint = "/_admin/metrics" ArangoExporterInternalEndpointV2 = "/_admin/metrics/v2" ArangoExporterUsageEndpoint = "/_admin/usage-metrics" ArangoExporterDefaultEndpoint = "/metrics" ArangoSyncStatusEndpoint = "/_api/version" // K8s constants ClusterIPNone = "None" TopologyKeyHostname = "kubernetes.io/hostname" NodeArchAffinityLabel = "kubernetes.io/arch" NodeArchAffinityLabelBeta = "beta.kubernetes.io/arch" // Pod constants ServerContainerName = "server" ExporterContainerName = "exporter" OperatorContainerName = "operator" ArangodVolumeName = "arangod-data" TlsKeyfileVolumeName = "tls-keyfile" ClientAuthCAVolumeName = "client-auth-ca" ClusterJWTSecretVolumeName = "cluster-jwt" MasterJWTSecretVolumeName = "master-jwt" LifecycleVolumeName = "lifecycle" FoxxAppEphemeralVolumeName = "ephemeral-apps" TMPEphemeralVolumeName = "ephemeral-tmp" ArangoDTimezoneVolumeName = "arangod-timezone" RocksdbEncryptionVolumeName = "rocksdb-encryption" ExporterJWTVolumeName = "exporter-jwt" ArangodVolumeMountDir = "/data" RocksDBEncryptionVolumeMountDir = "/secrets/rocksdb/encryption" TLSKeyfileVolumeMountDir = "/secrets/tls" TLSSNIKeyfileVolumeMountDir = "/secrets/sni" ClientAuthCAVolumeMountDir = "/secrets/client-auth/ca" ClusterJWTSecretVolumeMountDir = "/secrets/cluster/jwt" ExporterJWTVolumeMountDir = "/secrets/exporter/jwt" MasterJWTSecretVolumeMountDir = "/secrets/master/jwt" // Security constants DefaultRunAsUser = 1000 DefaultRunAsGroup = 2000 DefaultFSGroup = 3000 ServerPortName = "server" ExporterPortName = "exporter" )
const (
ServiceTypeNone core.ServiceType = "None"
)
Variables ¶
This section is empty.
Functions ¶
func CreatePersistentVolumeClaimName ¶
CreatePersistentVolumeClaimName returns the name of the persistent volume claim for a member with a given id in a deployment with a given name.
func CreatePodHostName ¶
CreatePodHostName returns the hostname of the pod for a member with a given id in a deployment with a given name.
func FixupResourceName ¶
FixupResourceName ensures that the given name complies with kubernetes name requirements. If the name is too long or contains invalid characters, it will be adjusted and a hash will be added.
func PrefixResourceError ¶
PrefixResourceError creates new prefixed error. If error is already prefixed then current key is appended
func PrefixResourceErrorFunc ¶
PrefixResourceErrorFunc creates new prefixed error from func output. If error is already prefixed then current key is appended
func PrefixResourceErrors ¶
PrefixResourceErrors creates new prefixed errors. If error is already prefixed then current key is appended
func StripArangodPrefix ¶
StripArangodPrefix removes well know arangod ID prefixes from the given id.
func ValidateAPIPath ¶
ValidateAPIPath validates if it is valid API Path
func ValidateAnyNotNil ¶
ValidateAnyNotNil Validates if any of the specified objects is not nil
func ValidateExclusiveFields ¶
ValidateExclusiveFields check if fields are defined in exclusive way
func ValidateImage ¶
ValidateImage Validates if provided image is valid
func ValidateInterfaceList ¶
func ValidateInterfaceList[T ValidateInterface](in []T) error
ValidateInterfaceList Validates object if is not nil with path
func ValidateInterfaceMap ¶
func ValidateInterfaceMap[T ValidateInterface](in map[string]T) error
ValidateInterfaceMap Validates object if is not nil with path
func ValidateList ¶
ValidateList validates all elements on the list
func ValidateMap ¶
func ValidateMap[T any](in map[string]T, validator func(string, T) error, checks ...func(in map[string]T) error) error
ValidateMap validates all elements on the list
func ValidateOptional ¶
ValidateOptional Validates object if is not nil
func ValidateOptionalInterface ¶
func ValidateOptionalInterface[T ValidateInterface](in T) error
ValidateOptionalInterface Validates object if is not nil
func ValidateOptionalInterfacePath ¶
func ValidateOptionalInterfacePath[T ValidateInterface](path string, in T) error
ValidateOptionalInterfacePath Validates object if is not nil with path
func ValidateOptionalPath ¶
ValidateOptionalPath Validates object if is not nil
func ValidateOptionalResourceName ¶
ValidateOptionalResourceName validates a kubernetes resource name. If not empty and not valid, an error is returned.
func ValidatePullPolicy ¶
func ValidatePullPolicy(in core.PullPolicy) error
ValidatePullPolicy Validates core.PullPolicy
func ValidateRequired ¶
ValidateRequired Validates object and required not nil value
func ValidateRequiredInterface ¶
func ValidateRequiredInterface[T ValidateInterface](in T) error
ValidateRequiredInterface Validates object if is not nil
func ValidateRequiredInterfacePath ¶
func ValidateRequiredInterfacePath[T ValidateInterface](path string, in T) error
ValidateRequiredInterfacePath Validates object if is not nil with path
func ValidateRequiredPath ¶
ValidateRequiredPath Validates object and required not nil value
func ValidateResourceName ¶
ValidateResourceName validates a kubernetes resource name. If not valid, an error is returned. See https://kubernetes.io/docs/concepts/overview/working-with-objects/names/
func ValidateResourceNamePointer ¶
ValidateResourceNamePointer validates a kubernetes resource name. If not valid, an error is returned.
func ValidateServiceType ¶
func ValidateServiceType(st core.ServiceType) error
ValidateServiceType checks that service type is supported
func ValidateUID ¶
ValidateUID validates if it is valid Kubernetes UID
Types ¶
type MergedErrors ¶
type MergedErrors struct {
// contains filtered or unexported fields
}
func (MergedErrors) Error ¶
func (m MergedErrors) Error() string
func (MergedErrors) Errors ¶
func (m MergedErrors) Errors() []error
type ResourceError ¶
func (ResourceError) Error ¶
func (p ResourceError) Error() string
Error return string representation of error
type ValidateInterface ¶
type ValidateInterface interface {
Validate() error
}