tablemgr

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupRoutingManager

func SetupRoutingManager(lifecycle fx.Lifecycle, logger *zerolog.Logger, routingTableMgr RoutingTableManager) error

Types

type BadConfigError added in v0.2.1

type BadConfigError struct {
	Wrapped error
}

func (*BadConfigError) Error added in v0.2.1

func (e *BadConfigError) Error() string

type DefaultRoutingTableManager

type DefaultRoutingTableManager struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*DefaultRoutingTableManager) AddFragment added in v0.9.0

func (r *DefaultRoutingTableManager) AddFragment(ctx context.Context, tid tenant.Id, fragmentConfig route.PluginConfig) error

func (*DefaultRoutingTableManager) AddRoute

func (r *DefaultRoutingTableManager) AddRoute(ctx context.Context, routeConfig *route.Config) error

func (*DefaultRoutingTableManager) GetAllFiltersStatus added in v0.2.1

func (r *DefaultRoutingTableManager) GetAllFiltersStatus(ctx context.Context) (map[string]plugin.FilterStatus, error)

func (*DefaultRoutingTableManager) GetAllFragments added in v0.9.0

func (r *DefaultRoutingTableManager) GetAllFragments(ctx context.Context) ([]route.PluginConfig, error)

func (*DefaultRoutingTableManager) GetAllReceiversStatus added in v0.2.1

func (r *DefaultRoutingTableManager) GetAllReceiversStatus(ctx context.Context) (map[string]plugin.ReceiverStatus, error)

func (*DefaultRoutingTableManager) GetAllRegisteredRoutes

func (r *DefaultRoutingTableManager) GetAllRegisteredRoutes() ([]route.Config, error)

func (*DefaultRoutingTableManager) GetAllRoutes

func (r *DefaultRoutingTableManager) GetAllRoutes(ctx context.Context) ([]route.Config, error)

func (*DefaultRoutingTableManager) GetAllSendersStatus added in v0.2.1

func (r *DefaultRoutingTableManager) GetAllSendersStatus(ctx context.Context) (map[string]plugin.SenderStatus, error)

func (*DefaultRoutingTableManager) GetAllTenantFragments added in v0.9.0

func (r *DefaultRoutingTableManager) GetAllTenantFragments(ctx context.Context, tid tenant.Id) ([]route.PluginConfig, error)

func (*DefaultRoutingTableManager) GetAllTenantRoutes

func (r *DefaultRoutingTableManager) GetAllTenantRoutes(ctx context.Context, tenantId tenant.Id) ([]route.Config, error)

func (*DefaultRoutingTableManager) GetFragment added in v0.9.0

func (r *DefaultRoutingTableManager) GetFragment(ctx context.Context, tid tenant.Id, fragmentId string) (route.PluginConfig, error)

func (*DefaultRoutingTableManager) GetRoute

func (r *DefaultRoutingTableManager) GetRoute(ctx context.Context, tid tenant.Id, routeId string) (*route.Config, error)

func (*DefaultRoutingTableManager) IsSynchronized

func (r *DefaultRoutingTableManager) IsSynchronized() (bool, error)

func (*DefaultRoutingTableManager) RegisterAllRoutes

func (r *DefaultRoutingTableManager) RegisterAllRoutes() error

func (*DefaultRoutingTableManager) RemoveFragment added in v0.9.0

func (r *DefaultRoutingTableManager) RemoveFragment(ctx context.Context, tid tenant.Id, fragmentId string) error

func (*DefaultRoutingTableManager) RemoveRoute

func (r *DefaultRoutingTableManager) RemoveRoute(ctx context.Context, tid tenant.Id, routeId string) error

func (*DefaultRoutingTableManager) RouteEvent added in v1.1.0

func (r *DefaultRoutingTableManager) RouteEvent(ctx context.Context, tid tenant.Id, routeId string, payload interface{}) (string, error)

func (*DefaultRoutingTableManager) StartGlobalSyncChecker

func (r *DefaultRoutingTableManager) StartGlobalSyncChecker()

func (*DefaultRoutingTableManager) SyncItem

func (r *DefaultRoutingTableManager) SyncItem(ctx context.Context, tid tenant.Id, routeId string, add bool) error

func (*DefaultRoutingTableManager) SynchronizeAllRoutes

func (r *DefaultRoutingTableManager) SynchronizeAllRoutes() (int, error)

func (*DefaultRoutingTableManager) UnregisterAllRoutes

func (r *DefaultRoutingTableManager) UnregisterAllRoutes() error

type InternalStorageError added in v0.2.1

type InternalStorageError struct {
	Wrapped error
}

func (*InternalStorageError) Error added in v0.2.1

func (e *InternalStorageError) Error() string

type LiveRouteWrapper

type LiveRouteWrapper struct {
	sync.Mutex
	Route       *route.Route
	Sender      sender.Sender
	Receiver    receiver.Receiver
	FilterChain *filter.Chain
	Config      route.Config
	RefCnt      int32
}

func NewLiveRouteWrapper

func NewLiveRouteWrapper(routeConfig route.Config) *LiveRouteWrapper

func (*LiveRouteWrapper) AddRouteReference

func (lrw *LiveRouteWrapper) AddRouteReference() int

func (*LiveRouteWrapper) GetReferenceCount

func (lrw *LiveRouteWrapper) GetReferenceCount() int

func (*LiveRouteWrapper) Register

func (*LiveRouteWrapper) RemoveRouteReference

func (lrw *LiveRouteWrapper) RemoveRouteReference() int

func (*LiveRouteWrapper) Unregister

type RouteNotFoundError added in v0.2.1

type RouteNotFoundError struct {
	Id string
}

func (*RouteNotFoundError) Error added in v0.2.1

func (e *RouteNotFoundError) Error() string

type RouteRegistrationError added in v0.2.1

type RouteRegistrationError struct {
	Wrapped error
}

func (*RouteRegistrationError) Error added in v0.2.1

func (e *RouteRegistrationError) Error() string

type RouteValidationError added in v0.2.1

type RouteValidationError struct {
	Wrapped error
}

func (*RouteValidationError) Error added in v0.2.1

func (e *RouteValidationError) Error() string

type RoutingTableGlobalSyncer

type RoutingTableGlobalSyncer interface {
	// StartGlobalSyncChecker
	StartGlobalSyncChecker()
	// RegisterAllRoutes
	RegisterAllRoutes() error
	// UnregisterAllRoutes
	UnregisterAllRoutes() error
	// SynchronizeAllRoutes
	SynchronizeAllRoutes() (int, error)
	// IsSynchronized
	IsSynchronized() (bool, error)
	// GetAllRegisteredRoutes gets all routes that are currently registered and running on ears instance
	GetAllRegisteredRoutes() ([]route.Config, error)
}

type RoutingTableManager

type RoutingTableManager interface {
	RoutingTableGlobalSyncer // routing table manager delegates to routing table global syncer for startup and tear down
	syncer.LocalSyncer       // to sync routing table upon receipt of an update notification for a single route
	// AddRoute adds a route to live routing table and runs it and also stores the route in the persistence layer
	AddRoute(ctx context.Context, route *route.Config) error
	// RemoveRoute removes a route from a live routing table and stops it and also removes the route from the persistence layer
	RemoveRoute(ctx context.Context, tenantId tenant.Id, routeId string) error
	// GetRoute gets a single route by its ID from persistence layer
	GetRoute(ctx context.Context, tenantId tenant.Id, routeId string) (*route.Config, error)
	// GetAllTenantRoutes gets all routes for a tenant from persistence layer
	GetAllTenantRoutes(ctx context.Context, tenantId tenant.Id) ([]route.Config, error)
	// GetAllRoutes gets all routes from persistence layer
	GetAllRoutes(ctx context.Context) ([]route.Config, error)
	// GetAllSenders gets all senders currently present in the system
	GetAllSendersStatus(ctx context.Context) (map[string]plugin.SenderStatus, error)
	// GetAllReceivers gets all receivers currently present in the system
	GetAllReceiversStatus(ctx context.Context) (map[string]plugin.ReceiverStatus, error)
	// GetAllFilters gets all filters currently present in the system
	GetAllFiltersStatus(ctx context.Context) (map[string]plugin.FilterStatus, error)
	// GetAllFragments gets all fragments currently present in the system
	GetAllFragments(ctx context.Context) ([]route.PluginConfig, error)
	// GetAllTenantFragments gets all fragments for a tenant
	GetAllTenantFragments(ctx context.Context, tenantId tenant.Id) ([]route.PluginConfig, error)
	// GetFragment gets a single fragment
	GetFragment(ctx context.Context, tenantId tenant.Id, fragmentId string) (route.PluginConfig, error)
	// DeleteFragment delete a fragment by its name
	RemoveFragment(ctx context.Context, tenantId tenant.Id, fragmentId string) error
	// AddFragment adds a new fragment
	AddFragment(ctx context.Context, tid tenant.Id, fragmentConfig route.PluginConfig) error
	// Send test event to route
	RouteEvent(ctx context.Context, tid tenant.Id, routeId string, payload interface{}) (string, error)
}

A RoutingTableManager supports modifying and querying an EARS routing table

func NewRoutingTableManager

func NewRoutingTableManager(pluginMgr plugin.Manager, storageMgr route.RouteStorer, fragmentMgr fragments.FragmentStorer, tableSyncer syncer.DeltaSyncer, logger *zerolog.Logger, config config.Config) RoutingTableManager

Jump to

Keyboard shortcuts

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