Documentation ¶
Index ¶
- Variables
- func AddFinalizer(obj client.Object) bool
- func GVKToString(gvk schema.GroupVersionKind, suppressDotSuffix bool) string
- func HasFinalizer(obj client.Object) bool
- func ParseSimpleJSONPath(path string) []string
- func Ptr[T any](value T) *T
- func RemoveFinalizer(obj client.Object) bool
- type BasicQueue
- type ErrorList
- type Queue
Constants ¶
This section is empty.
Variables ¶
var ErrQueueEmpty = errors.New("queue is empty")
Functions ¶
func AddFinalizer ¶
AddFinalizer adds a k8syncer finalizer to the object, if it doesn't already have one. Returns true if the finalizers changed.
func GVKToString ¶
func GVKToString(gvk schema.GroupVersionKind, suppressDotSuffix bool) string
GVKToString reverts a GroupVersionKind back to a string in the format <resource>.<version>.<group> If suppressDotSuffix is set to true, the trailing dot will be cut off if the group is empty.
func HasFinalizer ¶
HasFinalizer returns true if the given object has a k8syncer finalizer.
func ParseSimpleJSONPath ¶
ParseSimpleJSONPath splits a string into single fields. '.' is used as separator. To include '.' in a field, escape it with a preceding '\'. To have a field end on '\', escape the final '\' with an additional '\'. Note that escaping happens only for '\' which directly precede a '.'. Examples: a.b.c => a b c a\.b.c => a.b c a\\.b.c => a\ b c a\a.b.c\ => a\a b c\
func RemoveFinalizer ¶
RemoveFinalizer removes all k8syncer finalizers from the object. Returns true if the finalizers changed.
Types ¶
type BasicQueue ¶
type BasicQueue[T any] struct { // contains filtered or unexported fields }
func (*BasicQueue[T]) Clear ¶
func (q *BasicQueue[T]) Clear()
Clear removes all elements from the queue.
func (*BasicQueue[T]) Peek ¶
func (q *BasicQueue[T]) Peek() (T, error)
Peek returns the first element without removing it. Returns an error if the queue is empty.
func (*BasicQueue[T]) Poll ¶
func (q *BasicQueue[T]) Poll() (T, error)
Poll returns the first element and removes it from the queue. Returns an error if the queue is empty.
func (*BasicQueue[T]) Push ¶
func (q *BasicQueue[T]) Push(elems ...T)
Push adds the given elements to the queue in the given order.
func (*BasicQueue[T]) Size ¶
func (q *BasicQueue[T]) Size() int
Size returns the amount of elements currently in the queue.
type ErrorList ¶
type ErrorList struct {
Errs []error
}
func NewErrorList ¶
type Queue ¶
type Queue[T any] interface { // Size returns the amount of elements currently in the queue. Size() int // Peek returns the first element without removing it. // Returns an error if the queue is empty. Peek() (T, error) // Poll returns the first element and removes it from the queue. // Returns an error if the queue is empty. Poll() (T, error) // Push adds the given elements to the queue in the given order. Push(...T) // Clear removes all elements from the queue. Clear() }