shared

package
v0.0.0-...-97deb8b Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2025 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const LocalBinDir = "/usr/bin/arangodb_operator"

Variables

This section is empty.

Functions

func DiscoverOperatorPod

func DiscoverOperatorPod(binary string) (string, error)

func ExecuteCommandInPod

func ExecuteCommandInPod(ctx context.Context, k kclient.Client, container, podName, namespace string,
	command []string, stdin io.Reader, stdout io.Writer, stderr io.Writer) error

ExecuteCommandInPod executes command in pod with the given pod name and namespace.

func WithDefinitions

func WithDefinitions[T meta.Object](ctx context.Context, logger zerolog.Logger, client kclient.Client, files chan<- File, item T) error

func WithGVRPrefix

func WithGVRPrefix(files chan<- File, t reflect.Type) (chan<- File, func())

func WithItem

func WithItem[T meta.Object](ctx context.Context, logger zerolog.Logger, client kclient.Client, files chan<- File, item T, iterators ...IterateOverItemsFunc[T]) error

func WithPrefix

func WithPrefix(files chan<- File, f string, args ...any) (chan<- File, func())

func WithSlash

func WithSlash(files chan<- File) (chan<- File, func())

Types

type ArangoOperatorExecFunc

type ArangoOperatorExecFunc func(logger zerolog.Logger, args ...string) ([]byte, []byte, error)

func DiscoverExecFunc

func DiscoverExecFunc() (ArangoOperatorExecFunc, error)

func LocalExecFunc

func LocalExecFunc(binary string) (ArangoOperatorExecFunc, error)

func RemoteExecFunc

func RemoteExecFunc(binary, pod, container string) (ArangoOperatorExecFunc, error)

func RemoteOperatorExecFunc

func RemoteOperatorExecFunc(binary string) (ArangoOperatorExecFunc, error)

type DataFunc

type DataFunc func() ([]byte, error)

func GenerateDataFuncP1

func GenerateDataFuncP1[P1 any](call func(p1 P1) ([]byte, error), p1 P1) DataFunc

func GenerateDataFuncP2

func GenerateDataFuncP2[P1, P2 any](call func(p1 P1, p2 P2) ([]byte, error), p1 P1, p2 P2) DataFunc

type Extract

type Extract[T meta.Object] func(ctx context.Context, client kclient.Client, namespace string) ([]T, error)

type Factory

type Factory interface {
	Name() string
	Generate(logger zerolog.Logger, files chan<- File) error
	Enabled() bool
}

func NewFactory

func NewFactory(name string, enabled bool, gens ...GenFunc) Factory

type FactoryGen

type FactoryGen interface {
	AddSection(name string) FactoryGen

	Register(name string, enabled bool, gens GenFunc) FactoryGen

	Extend(in func(f FactoryGen)) FactoryGen

	Get() []Factory
}

func NewFactoryGen

func NewFactoryGen() FactoryGen

type File

type File interface {
	Path() string
	Write() ([]byte, error)
}

func NewFile

func NewFile(path string, write DataFunc) File

func NewJSONFile

func NewJSONFile[T interface{}](path string, write func() ([]T, error)) File

func NewYAMLFile

func NewYAMLFile[T interface{}](path string, write func() ([]T, error)) File

type GenFunc

type GenFunc func(logger zerolog.Logger, files chan<- File) error

func WithKubernetesItems

func WithKubernetesItems[T meta.Object](extract Extract[T], iterators ...IterateOverItemsFunc[T]) GenFunc

type IterateOverItemsFunc

type IterateOverItemsFunc[T meta.Object] func(ctx context.Context, logger zerolog.Logger, client kclient.Client, files chan<- File, item T) error

func WithModification

func WithModification[T meta.Object](in IterateOverItemsFunc[T], mods ...util.ModR[T]) IterateOverItemsFunc[T]

Jump to

Keyboard shortcuts

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