storage

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package storage provides Registry interface and its REST implementation for storing miner api objects.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewREST

func NewREST(optsGetter generic.RESTOptionsGetter) (*REST, *StatusREST, error)

NewREST returns a RESTStorage object that will work against miners.

Types

type MinerStorage

type MinerStorage struct {
	Miner  *REST
	Status *StatusREST
}

MinerStorage includes storage for chains and all sub resources.

func NewStorage

func NewStorage(optsGetter generic.RESTOptionsGetter) (MinerStorage, error)

NewStorage returns new instance of MinerStorage.

type REST

type REST struct {
	*genericregistry.Store
}

REST implements a RESTStorage for miners.

func (*REST) Categories

func (r *REST) Categories() []string

Categories implements the CategoriesProvider interface. Returns a list of categories a resource is part of.

func (*REST) ShortNames

func (r *REST) ShortNames() []string

ShortNames implements the ShortNamesProvider interface. Returns a list of short names for a resource.

type StatusREST

type StatusREST struct {
	// contains filtered or unexported fields
}

StatusREST implements the REST endpoint for changing the status of a miner.

func (*StatusREST) ConvertToTable

func (r *StatusREST) ConvertToTable(ctx context.Context, object runtime.Object, tableOptions runtime.Object) (*metav1.Table, error)

func (*StatusREST) Destroy

func (r *StatusREST) Destroy()

Destroy cleans up resources on shutdown.

func (*StatusREST) Get

func (r *StatusREST) Get(ctx context.Context, name string, options *metav1.GetOptions) (runtime.Object, error)

Get retrieves the object from the storage. It is required to support Patch.

func (*StatusREST) GetResetFields

func (r *StatusREST) GetResetFields() map[fieldpath.APIVersion]*fieldpath.Set

GetResetFields implements rest.ResetFieldsStrategy.

func (*StatusREST) New

func (r *StatusREST) New() runtime.Object

New returns empty Chain object.

func (*StatusREST) Update

func (r *StatusREST) Update(
	ctx context.Context,
	name string,
	objInfo rest.UpdatedObjectInfo,
	createValidation rest.ValidateObjectFunc,
	updateValidation rest.ValidateObjectUpdateFunc,
	forceAllowCreate bool,
	options *metav1.UpdateOptions,
) (runtime.Object, bool, error)

Update alters the status subset of an object.

Jump to

Keyboard shortcuts

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