common

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2023 License: Apache-2.0 Imports: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByObjectName

func ByObjectName[O ObjectPtr[E], E any]() func(O) string

func CleanupSocketIfExists

func CleanupSocketIfExists(address string) error

CleanupSocketIfExists deletes any leftover socket at the given address, if any.

If the file at the given address is no socket, an error is returned.

Types

type ObjectGetter

type ObjectGetter[O ObjectPtr[E], E any, K ObjectKey] struct {
	// contains filtered or unexported fields
}

func NewObjectGetter

func NewObjectGetter[K ObjectKey, O ObjectPtr[E], E any](gr schema.GroupResource, keyFunc func(O) K, opts ...ObjectGetterOption[O, E, K]) (*ObjectGetter[O, E, K], error)

func (*ObjectGetter[O, E, K]) Get

func (r *ObjectGetter[O, E, K]) Get(key K) (O, error)

type ObjectGetterOption

type ObjectGetterOption[O ObjectPtr[E], E any, K ObjectKey] interface {
	ApplyToObjectGetter(o *ObjectGetterOptions[O, E, K])
}

func ObjectSlice

func ObjectSlice[K ObjectKey, O ObjectPtr[E], E any](objs []E) ObjectGetterOption[O, E, K]

type ObjectGetterOptions

type ObjectGetterOptions[O ObjectPtr[E], E any, K ObjectKey] struct {
	// contains filtered or unexported fields
}

func (*ObjectGetterOptions[O, E, K]) ApplyOptions

func (o *ObjectGetterOptions[O, E, K]) ApplyOptions(opts []ObjectGetterOption[O, E, K])

type ObjectKey

type ObjectKey interface {
	comparable
}

type ObjectPtr

type ObjectPtr[E any] interface {
	client.Object
	*E
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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