Documentation
¶
Index ¶
- Variables
- func SetSyntheticWatchableInterval(interval time.Duration)
- func UnsafeGet(object any, field string) any
- func UnsafeSet(object any, field string, value any)
- type ByOptionsLister
- type Indexer
- func (i *Indexer) AddIndexers(newIndexers cache.Indexers) error
- func (i *Indexer) AfterUpsert(key string, obj any, tx transaction.Client) error
- func (i *Indexer) ByIndex(indexName, indexedValue string) ([]any, error)
- func (i *Indexer) GetIndexers() cache.Indexers
- func (i *Indexer) Index(indexName string, obj any) (result []any, err error)
- func (i *Indexer) IndexKeys(indexName, indexedValue string) ([]string, error)
- func (i *Indexer) ListIndexFuncValues(name string) []string
- type Informer
- type ListOptionIndexer
- type QueryInfo
- type Store
- type SyntheticWatcher
Constants ¶
This section is empty.
Variables ¶
var (
ErrInvalidColumn = errors.New("supplied column is invalid")
)
Functions ¶
func SetSyntheticWatchableInterval ¶ added in v0.5.7
SetSyntheticWatchableInterval - call this function to override the default interval time of 5 seconds
Types ¶
type ByOptionsLister ¶
type ByOptionsLister interface {
ListByOptions(ctx context.Context, lo *sqltypes.ListOptions, partitions []partition.Partition, namespace string) (*unstructured.UnstructuredList, int, string, error)
}
type Indexer ¶
type Indexer struct {
Store
// contains filtered or unexported fields
}
Indexer is a SQLite-backed cache.Indexer which builds upon Store adding an index table
func NewIndexer ¶
NewIndexer returns a cache.Indexer backed by SQLite for objects of the given example type
func (*Indexer) AddIndexers ¶
AddIndexers adds more indexers to this Store. If you call this after you already have data in the Store, the results are undefined.
func (*Indexer) AfterUpsert ¶
AfterUpsert updates indices of an object
func (*Indexer) ByIndex ¶
ByIndex returns the stored objects whose set of indexed values for the named index includes the given indexed value
func (*Indexer) GetIndexers ¶
GetIndexers returns the indexers
func (*Indexer) Index ¶
Index returns a list of items that match the given object on the index function
func (*Indexer) IndexKeys ¶
IndexKeys returns a list of the Store keys of the objects whose indexed values in the given index include the given indexed value
func (*Indexer) ListIndexFuncValues ¶
ListIndexFuncValues wraps safeListIndexFuncValues and panics in case of I/O errors
type Informer ¶
type Informer struct {
ByOptionsLister
}
Informer is a SQLite-backed cache.SharedIndexInformer that can execute queries on listprocessor structs
func NewInformer ¶
func NewInformer(ctx context.Context, client dynamic.ResourceInterface, fields [][]string, transform cache.TransformFunc, gvk schema.GroupVersionKind, db db.Client, shouldEncrypt bool, namespaced bool, watchable bool) (*Informer, error)
NewInformer returns a new SQLite-backed Informer for the type specified by schema in unstructured.Unstructured form using the specified client
func (*Informer) ListByOptions ¶
func (i *Informer) ListByOptions(ctx context.Context, lo *sqltypes.ListOptions, partitions []partition.Partition, namespace string) (*unstructured.UnstructuredList, int, string, error)
ListByOptions returns objects according to the specified list options and partitions. Specifically:
- an unstructured list of resources belonging to any of the specified partitions
- the total number of resources (returned list might be a subset depending on pagination options in lo)
- a continue token, if there are more pages after the returned one
- an error instead of all of the above if anything went wrong
type ListOptionIndexer ¶
type ListOptionIndexer struct {
*Indexer
// contains filtered or unexported fields
}
ListOptionIndexer extends Indexer by allowing queries based on ListOption
func NewListOptionIndexer ¶
func NewListOptionIndexer(ctx context.Context, fields [][]string, s Store, namespaced bool) (*ListOptionIndexer, error)
NewListOptionIndexer returns a SQLite-backed cache.Indexer of unstructured.Unstructured Kubernetes resources of a certain GVK ListOptionIndexer is also able to satisfy ListOption queries on indexed (sub)fields. Fields are specified as slices (e.g. "metadata.resourceVersion" is ["metadata", "resourceVersion"])
func (*ListOptionIndexer) ListByOptions ¶
func (l *ListOptionIndexer) ListByOptions(ctx context.Context, lo *sqltypes.ListOptions, partitions []partition.Partition, namespace string) (*unstructured.UnstructuredList, int, string, error)
ListByOptions returns objects according to the specified list options and partitions. Specifically:
- an unstructured list of resources belonging to any of the specified partitions
- the total number of resources (returned list might be a subset depending on pagination options in lo)
- a continue token, if there are more pages after the returned one
- an error instead of all of the above if anything went wrong
type QueryInfo ¶ added in v0.5.4
type QueryInfo struct {
// contains filtered or unexported fields
}
QueryInfo is a helper-struct that is used to represent the core query and parameters when converting a filter from the UI into a sql query
type Store ¶
type Store interface {
db.Client
cache.Store
GetByKey(key string) (item any, exists bool, err error)
GetName() string
RegisterAfterUpsert(f func(key string, obj any, tx transaction.Client) error)
RegisterAfterDelete(f func(key string, tx transaction.Client) error)
GetShouldEncrypt() bool
GetType() reflect.Type
}
type SyntheticWatcher ¶ added in v0.5.7
type SyntheticWatcher struct {
// contains filtered or unexported fields
}
func (*SyntheticWatcher) Done ¶ added in v0.5.7
func (rw *SyntheticWatcher) Done() <-chan struct{}
func (*SyntheticWatcher) ResultChan ¶ added in v0.5.7
func (rw *SyntheticWatcher) ResultChan() <-chan watch.Event
ResultChan implements k8s.io/apimachinery/pkg/watch.Interface.
func (*SyntheticWatcher) Stop ¶ added in v0.5.7
func (rw *SyntheticWatcher) Stop()
Stop implements k8s.io/apimachinery/pkg/watch.Interface.