Documentation
¶
Overview ¶
Package sqlpartition implements a store which converts a request to partitions based on the user's rbac for the resource. For example, a user may request all items of resource A, but only have permissions for resource A in namespaces x,y,z. The partitions will then store that information and be passed to the next store.
Index ¶
- type Partitioner
- type SchemaColumnSetter
- type Store
- func (s *Store) ByID(apiOp *types.APIRequest, schema *types.APISchema, id string) (types.APIObject, error)
- func (s *Store) Create(apiOp *types.APIRequest, schema *types.APISchema, data types.APIObject) (types.APIObject, error)
- func (s *Store) Delete(apiOp *types.APIRequest, schema *types.APISchema, id string) (types.APIObject, error)
- func (s *Store) List(apiOp *types.APIRequest, schema *types.APISchema) (types.APIObjectList, error)
- func (s *Store) Update(apiOp *types.APIRequest, schema *types.APISchema, data types.APIObject, ...) (types.APIObject, error)
- func (s *Store) Watch(apiOp *types.APIRequest, schema *types.APISchema, wr types.WatchRequest) (chan types.APIEvent, error)
- type UnstructuredStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Partitioner ¶
type Partitioner interface {
All(apiOp *types.APIRequest, schema *types.APISchema, verb, id string) ([]cachepartition.Partition, error)
Store() UnstructuredStore
}
Partitioner is an interface for interacting with partitions.
type SchemaColumnSetter ¶
type Store ¶
type Store struct {
Partitioner Partitioner
// contains filtered or unexported fields
}
Store implements types.proxyStore for partitions.
func NewStore ¶
func NewStore(store UnstructuredStore, asl accesscontrol.AccessSetLookup) *Store
NewStore creates a types.proxyStore implementation with a partitioner
func (*Store) ByID ¶
func (s *Store) ByID(apiOp *types.APIRequest, schema *types.APISchema, id string) (types.APIObject, error)
ByID looks up a single object by its ID.
func (*Store) Create ¶
func (s *Store) Create(apiOp *types.APIRequest, schema *types.APISchema, data types.APIObject) (types.APIObject, error)
Create creates a single object in the store.
func (*Store) Delete ¶
func (s *Store) Delete(apiOp *types.APIRequest, schema *types.APISchema, id string) (types.APIObject, error)
Delete deletes an object from a store.
func (*Store) List ¶
func (s *Store) List(apiOp *types.APIRequest, schema *types.APISchema) (types.APIObjectList, error)
List returns a list of objects across all applicable partitions. If pagination parameters are used, it returns a segment of the list.
type UnstructuredStore ¶
type UnstructuredStore interface {
ByID(apiOp *types.APIRequest, schema *types.APISchema, id string) (*unstructured.Unstructured, []types.Warning, error)
Create(apiOp *types.APIRequest, schema *types.APISchema, data types.APIObject) (*unstructured.Unstructured, []types.Warning, error)
Update(apiOp *types.APIRequest, schema *types.APISchema, data types.APIObject, id string) (*unstructured.Unstructured, []types.Warning, error)
Delete(apiOp *types.APIRequest, schema *types.APISchema, id string) (*unstructured.Unstructured, []types.Warning, error)
ListByPartitions(apiOp *types.APIRequest, schema *types.APISchema, partitions []partition.Partition) (*unstructured.UnstructuredList, int, string, error)
WatchByPartitions(apiOp *types.APIRequest, schema *types.APISchema, wr types.WatchRequest, partitions []partition.Partition) (chan watch.Event, error)
}
UnstructuredStore is like types.Store but deals in k8s unstructured objects instead of apiserver types. This interface exists in order for store to be mocked in tests
Directories
¶
| Path | Synopsis |
|---|---|
|
Package listprocessor contains methods for filtering, sorting, and paginating lists of objects.
|
Package listprocessor contains methods for filtering, sorting, and paginating lists of objects. |