manager

package
v0.0.0-...-6c8496d Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

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 IsMeshNotFound(err error) bool

func MeshNotFound

func MeshNotFound(meshName string) error

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 ConflictRetry struct {
	BaseBackoff   time.Duration
	MaxTimes      uint
	JitterPercent uint
}

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 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

Jump to

Keyboard shortcuts

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