resources

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package resources contains utility functions for serving resources.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheGetter

type CacheGetter[O any] interface {
	Getter[O]
}

CacheGetter is an interface for getting resources that are cached.

type ConvertFunc

type ConvertFunc[O any, T runtime.Object, S ~[]T] func(objs S) O

ConvertFunc converts a list of resources to a single resource.

type DynamicGetter

type DynamicGetter[O any] interface {
	Getter[O]
	Starter
	Synced
}

DynamicGetter is an interface for getting resources.

func NewDynamicGetter

func NewDynamicGetter[O any, T runtime.Object, L runtime.Object](syncer Syncer[T, L], convertFunc ConvertFunc[O, T, []T]) DynamicGetter[O]

NewDynamicGetter returns a new Getter that returns the latest list of resources.

type Getter

type Getter[O any] interface {
	Get() O
	Version() string
}

Getter is an interface for getting resources.

func NewFilter

func NewFilter[O any, T any](getter Getter[T], filterFunc func(T) O) Getter[O]

NewFilter returns a new Getter that returns the given list.

func NewStaticGetter

func NewStaticGetter[T any](data T) Getter[T]

NewStaticGetter returns a new Getter that returns the given list.

type Starter

type Starter interface {
	Start(ctx context.Context) error
}

Starter is an interface for starting resources.

type Synced

type Synced interface {
	Sync() <-chan struct{}
}

Synced is an interface for getting resources that are synced.

type Syncer

type Syncer[T runtime.Object, L runtime.Object] interface {
	UpdateStatus(ctx context.Context, obj T, opts metav1.UpdateOptions) (T, error)
	List(ctx context.Context, opts metav1.ListOptions) (L, error)
	Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
}

Syncer is an interface for syncing resources.

Jump to

Keyboard shortcuts

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