tablemgr

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 26, 2021 License: Apache-2.0 Imports: 16 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 DefaultRoutingTableManager

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

func (*DefaultRoutingTableManager) AddRoute

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

func (*DefaultRoutingTableManager) GetAllFilters

func (r *DefaultRoutingTableManager) GetAllFilters(ctx context.Context) (map[string]filter.Filterer, error)

func (*DefaultRoutingTableManager) GetAllReceivers

func (r *DefaultRoutingTableManager) GetAllReceivers(ctx context.Context) (map[string]receiver.Receiver, 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) GetAllSenders

func (r *DefaultRoutingTableManager) GetAllSenders(ctx context.Context) (map[string]sender.Sender, error)

func (*DefaultRoutingTableManager) GetAllTenantRoutes

func (r *DefaultRoutingTableManager) GetAllTenantRoutes(ctx context.Context, tenantId tenant.Id) ([]route.Config, 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) RemoveRoute

func (r *DefaultRoutingTableManager) RemoveRoute(ctx context.Context, tid tenant.Id, routeId 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 LiveRouteWrapper

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

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 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
	GetAllSenders(ctx context.Context) (map[string]sender.Sender, error)
	// GetAllReceivers gets all receivers currently present in the system
	GetAllReceivers(ctx context.Context) (map[string]receiver.Receiver, error)
	// GetAllFilters gets all filters currently present in the system
	GetAllFilters(ctx context.Context) (map[string]filter.Filterer, error)
}

A RoutingTableManager supports modifying and querying an EARS routing table

func NewRoutingTableManager

func NewRoutingTableManager(pluginMgr plugin.Manager, storageMgr route.RouteStorer, 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