Documentation ¶
Index ¶
- Variables
- func ErrorResourceAlreadyExists(rt model.ResourceType, name, mesh string) error
- func ErrorResourceConflict(rt model.ResourceType, name, mesh string) error
- func ErrorResourceNotFound(rt model.ResourceType, name, mesh string) error
- func ErrorResourcePreconditionFailed(rt model.ResourceType, name, mesh string) error
- func IsResourceConflict(err error) bool
- func IsResourceNotFound(err error) bool
- func IsResourcePreconditionFailed(err error) bool
- type ClosableResourceStore
- type CreateOptions
- type CreateOptionsFunc
- type DeleteAllOptions
- type DeleteAllOptionsFunc
- type DeleteOptions
- type DeleteOptionsFunc
- type GetOptions
- type GetOptionsFunc
- type ListFilterFunc
- type ListOptions
- type ListOptionsFunc
- type ResourceStore
- type UpdateOptions
- type UpdateOptionsFunc
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 IsResourceNotFound ¶
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 CreateBy ¶
func CreateBy(key core_model.ResourceKey) CreateOptionsFunc
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 ¶
func NewDeleteOptions ¶
func NewDeleteOptions(fs ...DeleteOptionsFunc) *DeleteOptions
type DeleteOptionsFunc ¶
type DeleteOptionsFunc func(*DeleteOptions)
func DeleteBy ¶
func DeleteBy(key core_model.ResourceKey) DeleteOptionsFunc
func DeleteByKey ¶
func DeleteByKey(name, mesh string) DeleteOptionsFunc
type GetOptions ¶
func NewGetOptions ¶
func NewGetOptions(fs ...GetOptionsFunc) *GetOptions
func (*GetOptions) HashCode ¶
func (g *GetOptions) HashCode() string
type GetOptionsFunc ¶
type GetOptionsFunc func(*GetOptions)
func GetBy ¶
func GetBy(key core_model.ResourceKey) GetOptionsFunc
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 ¶
type ResourceStore interface { Create(context.Context, model.Resource, ...CreateOptionsFunc) error Update(context.Context, model.Resource, ...UpdateOptionsFunc) error Delete(context.Context, model.Resource, ...DeleteOptionsFunc) error Get(context.Context, model.Resource, ...GetOptionsFunc) error List(context.Context, model.ResourceList, ...ListOptionsFunc) error }
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 ¶
func NewUpdateOptions ¶
func NewUpdateOptions(fs ...UpdateOptionsFunc) *UpdateOptions
type UpdateOptionsFunc ¶
type UpdateOptionsFunc func(*UpdateOptions)
func ModifiedAt ¶
func ModifiedAt(modificationTime time.Time) UpdateOptionsFunc
Click to show internal directories.
Click to hide internal directories.