utils

package
v0.0.109 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormathBasicAuth

func FormathBasicAuth(ui *url.Userinfo) string

func Identity

func Identity() (string, error)

func IsHTTPResponseError

func IsHTTPResponseError(resp *http.Response, err error) (bool, error)

IsHTTPResponseError checks if the response/error indicates a failure and returns an error with context

func IsNetworkError added in v0.0.46

func IsNetworkError(err error) (bool, error)

IsNetworkError checks if the request error indicates a failure and returns an error with context

func ListAll added in v0.0.107

func ListAll(store cache.Store, labelSelector labels.Selector, annotationSelector labels.Selector, appendFn cache.AppendFunc) error

ListAll lists items in the store matching the given selector, calling appendFn on each one.

func ListAllByNamespace added in v0.0.107

func ListAllByNamespace(indexer cache.Indexer, namespace string, labelSelector labels.Selector, annotationSelector labels.Selector, appendFn cache.AppendFunc) error

ListAllByNamespace lists items in the given namespace in the store matching the given selector, calling appendFn on each one. If a blank namespace (NamespaceAll) is specified, this delegates to ListAll().

func ParseBasicAuth

func ParseBasicAuth(auth string) *url.Userinfo

func SetBlobTerminalPhase added in v0.0.29

func SetBlobTerminalPhase(blob *v1alpha1.Blob, phase v1alpha1.BlobPhase)

SetBlobTerminalPhase sets the blob phase to a terminal state (Succeeded or Failed) and records the completion time. The completion time is only set if it hasn't been set before, ensuring it reflects the first time the blob reached a terminal state. This prevents the completion time from being updated if a blob transitions between terminal states.

func SetChunkTerminalPhase added in v0.0.29

func SetChunkTerminalPhase(chunk *v1alpha1.Chunk, phase v1alpha1.ChunkPhase)

SetChunkTerminalPhase sets the chunk phase to a terminal state (Succeeded or Failed) and records the completion time. The completion time is only set if it hasn't been set before, ensuring it reflects the first time the chunk reached a terminal state. This prevents the completion time from being updated if a chunk transitions between terminal states.

func UpdateResourceStatusWithRetry added in v0.0.25

func UpdateResourceStatusWithRetry[T object[T]](
	ctx context.Context,
	client client[T],
	latest T,
	modifier func(T) T,
) (T, error)

Types

type ResourceIndexer added in v0.0.107

type ResourceIndexer[T runtime.Object] struct {
	// contains filtered or unexported fields
}

ResourceIndexer wraps an indexer, resource, and optional namespace for a given type. This is intended for use by listers (generated by lister-gen) only.

func NewResourceIndexer added in v0.0.107

func NewResourceIndexer[T runtime.Object](indexer cache.Indexer, resource schema.GroupResource, namespace string) ResourceIndexer[T]

New returns a new instance of a lister (resource indexer) wrapping the given indexer and resource for the specified type. This is intended for use by listers (generated by lister-gen) only.

func (ResourceIndexer[T]) Get added in v0.0.107

func (l ResourceIndexer[T]) Get(name string) (T, error)

Get retrieves the resource from the index for a given name.

func (ResourceIndexer[T]) List added in v0.0.107

func (l ResourceIndexer[T]) List(labelSelector labels.Selector, annotationSelector labels.Selector) (ret []T, err error)

List lists all resources in the indexer matching the given selector.

type UserValue

type UserValue struct {
	Name     string
	Password string
	Groups   []string
}

func (*UserValue) Set

func (d *UserValue) Set(s string) error

func (*UserValue) String

func (d *UserValue) String() string

func (*UserValue) Type

func (d *UserValue) Type() string

type UsersValue

type UsersValue struct {
	Users []UserValue
}

func (*UsersValue) Set

func (d *UsersValue) Set(s string) error

func (*UsersValue) String

func (d *UsersValue) String() string

func (*UsersValue) Type

func (d *UsersValue) Type() string

Jump to

Keyboard shortcuts

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