storage

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2025 License: Apache-2.0 Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsRecoverableException added in v0.5.0

func IsRecoverableException(err error) bool

func LoadPlugins added in v0.6.0

func LoadPlugins(dir string) error

func NewRecoverableException added in v0.5.0

func NewRecoverableException(err error) error

func RegisterStorageFactoryFunc

func RegisterStorageFactoryFunc(name string, f NewStorageFactoryFunc)

Types

type ClusterResourceVersions added in v0.9.0

type ClusterResourceVersions struct {
	Resources map[string]interface{}
	Events    map[string]interface{}
}

type CollectionResourceStorage

type CollectionResourceStorage interface {
	Get(ctx context.Context, opts *internal.ListOptions) (*internal.CollectionResource, error)
}

type NewStorageFactoryFunc

type NewStorageFactoryFunc func(configPath string) (StorageFactory, error)

type ResourceStorage

type ResourceStorage interface {
	GetStorageConfig() *ResourceStorageConfig

	Get(ctx context.Context, cluster, namespace, name string, obj runtime.Object) error
	List(ctx context.Context, listObj runtime.Object, opts *internal.ListOptions) error
	Watch(ctx context.Context, options *internal.ListOptions) (watch.Interface, error)

	Create(ctx context.Context, cluster string, obj runtime.Object) error
	Update(ctx context.Context, cluster string, obj runtime.Object) error

	ConvertDeletedObject(obj interface{}) (runtime.Object, error)
	Delete(ctx context.Context, cluster string, obj runtime.Object) error

	RecordEvent(ctx context.Context, cluster string, event *corev1.Event) error
}

type ResourceStorageConfig

type ResourceStorageConfig struct {
	resourceconfig.ResourceConfig
}

type StorageFactory

type StorageFactory interface {
	// Currently only supports returning a union of verbs for all resources,
	// in the future it may be necessary to return verbs depending on different resources.
	GetSupportedRequestVerbs() []string

	PrepareCluster(cluster string) error

	GetResourceVersions(ctx context.Context, cluster string) (map[schema.GroupVersionResource]ClusterResourceVersions, error)
	GetCollectionResources(ctx context.Context) ([]*internal.CollectionResource, error)

	NewResourceStorage(config *ResourceStorageConfig) (ResourceStorage, error)
	NewCollectionResourceStorage(cr *internal.CollectionResource) (CollectionResourceStorage, error)

	CleanCluster(ctx context.Context, cluster string) error
	CleanClusterResource(ctx context.Context, cluster string, gvr schema.GroupVersionResource) error

	Shutdown() error
}

func NewStorageFactory

func NewStorageFactory(name, configPath string) (StorageFactory, error)

Directories

Path Synopsis
v2

Jump to

Keyboard shortcuts

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