store

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorInvalidOffset = errors.New("invalid offset")

Functions

func ErrorResourceAlreadyExists

func ErrorResourceAlreadyExists(rt model.ResourceType, name, mesh string) error

func ErrorResourceConflict

func ErrorResourceConflict(rt model.ResourceType, name, mesh string) error

func ErrorResourceNotFound

func ErrorResourceNotFound(rt model.ResourceType, name, mesh string) error

func ErrorResourcePreconditionFailed

func ErrorResourcePreconditionFailed(rt model.ResourceType, name, mesh string) error

func IsResourceConflict

func IsResourceConflict(err error) bool

func IsResourceNotFound

func IsResourceNotFound(err error) bool

func IsResourcePreconditionFailed

func IsResourcePreconditionFailed(err error) bool

Types

type ClosableResourceStore

type ClosableResourceStore interface {
	ResourceStore
	io.Closer
}

func NewStrictResourceStore

func NewStrictResourceStore(c ResourceStore) ClosableResourceStore

type CreateOptions

type CreateOptions struct {
	Name         string
	Mesh         string
	CreationTime time.Time
	Owner        core_model.Resource
}

func NewCreateOptions

func NewCreateOptions(fs ...CreateOptionsFunc) *CreateOptions

type CreateOptionsFunc

type CreateOptionsFunc func(*CreateOptions)

func CreateByKey

func CreateByKey(name, mesh string) CreateOptionsFunc

func CreateWithOwner

func CreateWithOwner(owner core_model.Resource) CreateOptionsFunc

func CreatedAt

func CreatedAt(creationTime time.Time) CreateOptionsFunc

type DeleteAllOptions

type DeleteAllOptions struct {
	Mesh string
}

func NewDeleteAllOptions

func NewDeleteAllOptions(fs ...DeleteAllOptionsFunc) *DeleteAllOptions

type DeleteAllOptionsFunc

type DeleteAllOptionsFunc func(*DeleteAllOptions)

func DeleteAllByMesh

func DeleteAllByMesh(mesh string) DeleteAllOptionsFunc

type DeleteOptions

type DeleteOptions struct {
	Name string
	Mesh string
}

func NewDeleteOptions

func NewDeleteOptions(fs ...DeleteOptionsFunc) *DeleteOptions

type DeleteOptionsFunc

type DeleteOptionsFunc func(*DeleteOptions)

func DeleteByKey

func DeleteByKey(name, mesh string) DeleteOptionsFunc

type GetOptions

type GetOptions struct {
	Name    string
	Mesh    string
	Version string
}

func NewGetOptions

func NewGetOptions(fs ...GetOptionsFunc) *GetOptions

func (*GetOptions) HashCode

func (g *GetOptions) HashCode() string

type GetOptionsFunc

type GetOptionsFunc func(*GetOptions)

func GetByKey

func GetByKey(name, mesh string) GetOptionsFunc

func GetByVersion

func GetByVersion(version string) GetOptionsFunc

type ListFilterFunc

type ListFilterFunc func(rs core_model.Resource) bool

type ListOptions

type ListOptions struct {
	Mesh       string
	PageSize   int
	PageOffset string
	FilterFunc ListFilterFunc
}

func NewListOptions

func NewListOptions(fs ...ListOptionsFunc) *ListOptions

func (*ListOptions) Filter

func (l *ListOptions) Filter(rs core_model.Resource) bool

Filter returns true if the item passes the filtering criteria

func (*ListOptions) HashCode

func (l *ListOptions) HashCode() string

type ListOptionsFunc

type ListOptionsFunc func(*ListOptions)

func ListByFilterFunc added in v1.8.1

func ListByFilterFunc(filterFunc ListFilterFunc) ListOptionsFunc

func ListByMesh

func ListByMesh(mesh string) ListOptionsFunc

func ListByPage

func ListByPage(size int, offset string) ListOptionsFunc

type ResourceStore

func NewCustomizableResourceStore

func NewCustomizableResourceStore(defaultStore ResourceStore, customStores map[model.ResourceType]ResourceStore) ResourceStore

func NewPaginationStore

func NewPaginationStore(delegate ResourceStore) ResourceStore

The Pagination Store is handling only the pagination functionality in the List. This is an in-memory operation and offloads this from the persistent stores (k8s, postgres etc.) Two reasons why this is needed: * There is no filtering + pagination on the native K8S database * On Postgres, we keep the object in a column as a string. We would have to use JSON column type and convert it to native SQL queries.

The in-memory filtering has been tested with 10,000 Dataplanes and proved to be fast enough, although not that efficient.

type UpdateOptions

type UpdateOptions struct {
	ModificationTime time.Time
}

func NewUpdateOptions

func NewUpdateOptions(fs ...UpdateOptionsFunc) *UpdateOptions

type UpdateOptionsFunc

type UpdateOptionsFunc func(*UpdateOptions)

func ModifiedAt

func ModifiedAt(modificationTime time.Time) UpdateOptionsFunc

Jump to

Keyboard shortcuts

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