Documentation ¶
Index ¶
- Variables
- func DeleteAllResources(manager ResourceManager, ctx context.Context, list model.ResourceList, ...) error
- func IsMeshNotFound(err error) bool
- func MeshNotFound(meshName string) error
- func Upsert(ctx context.Context, manager ResourceManager, key model.ResourceKey, ...) error
- type ConflictRetry
- type CustomizableResourceManager
- type MeshNotFoundError
- type ReadOnlyResourceManager
- type ResourceManager
- type ResourceManagerWrapper
- type UpsertFunc
- type UpsertOpts
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrSkipUpsert = errors.New("don't do upsert")
Functions ¶
func DeleteAllResources ¶
func DeleteAllResources(manager ResourceManager, ctx context.Context, list model.ResourceList, fs ...store.DeleteAllOptionsFunc) error
func IsMeshNotFound ¶
func MeshNotFound ¶
func Upsert ¶
func Upsert(ctx context.Context, manager ResourceManager, key model.ResourceKey, resource model.Resource, fn func(resource model.Resource) error, fs ...UpsertFunc) error
Types ¶
type ConflictRetry ¶
type CustomizableResourceManager ¶
type CustomizableResourceManager interface { ResourceManager Customize(model.ResourceType, ResourceManager) ResourceManager(model.ResourceType) ResourceManager WrapAll(ResourceManagerWrapper) }
func NewCustomizableResourceManager ¶
func NewCustomizableResourceManager(defaultManager ResourceManager, customManagers map[model.ResourceType]ResourceManager) CustomizableResourceManager
type MeshNotFoundError ¶
type MeshNotFoundError struct {
Mesh string
}
func (*MeshNotFoundError) Error ¶
func (m *MeshNotFoundError) Error() string
type ReadOnlyResourceManager ¶
type ReadOnlyResourceManager interface { Get(context.Context, model.Resource, ...store.GetOptionsFunc) error List(context.Context, model.ResourceList, ...store.ListOptionsFunc) error }
func NewCachedManager ¶
func NewCachedManager(delegate ReadOnlyResourceManager, expirationTime time.Duration) (ReadOnlyResourceManager, error)
type ResourceManager ¶
type ResourceManager interface { ReadOnlyResourceManager Create(context.Context, model.Resource, ...store.CreateOptionsFunc) error Update(context.Context, model.Resource, ...store.UpdateOptionsFunc) error Delete(context.Context, model.Resource, ...store.DeleteOptionsFunc) error DeleteAll(context.Context, model.ResourceList, ...store.DeleteAllOptionsFunc) error }
func NewResourceManager ¶
func NewResourceManager(store store.ResourceStore) ResourceManager
type ResourceManagerWrapper ¶
type ResourceManagerWrapper = func(delegate ResourceManager) ResourceManager
type UpsertFunc ¶
type UpsertFunc func(opts *UpsertOpts)
func WithConflictRetry ¶
func WithConflictRetry(baseBackoff time.Duration, maxTimes uint, jitterPercent uint) UpsertFunc
func WithTransactions ¶
func WithTransactions(transactions store.Transactions) UpsertFunc
type UpsertOpts ¶
type UpsertOpts struct { ConflictRetry ConflictRetry Transactions store.Transactions }
func NewUpsertOpts ¶
func NewUpsertOpts(fs ...UpsertFunc) UpsertOpts
Click to show internal directories.
Click to hide internal directories.