utils

package
v0.0.74 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2025 License: Apache-2.0 Imports: 16 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 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 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