Documentation ¶
Overview ¶
Package memory provides in-memory backends for neighbor and route stores.
Index ¶
- type NeighborIndex
- type NeighborsBackend
- func (b *NeighborsBackend) CountNeighborsAt(ctx context.Context, sourceID string) (int, error)
- func (b *NeighborsBackend) GetNeighborsAt(ctx context.Context, sourceID string) (api.Neighbors, error)
- func (b *NeighborsBackend) GetNeighborsMapAt(ctx context.Context, sourceID string) (map[string]*api.Neighbor, error)
- func (b *NeighborsBackend) SetNeighbors(ctx context.Context, sourceID string, neighbors api.Neighbors) error
- type RoutesBackend
- func (r *RoutesBackend) CountRoutesAt(ctx context.Context, sourceID string) (uint, uint, error)
- func (r *RoutesBackend) FindByNeighbors(ctx context.Context, query []*api.NeighborQuery, filters *api.SearchFilters) (api.LookupRoutes, error)
- func (r *RoutesBackend) FindByPrefix(ctx context.Context, prefix string, filters *api.SearchFilters, limit uint) (api.LookupRoutes, error)
- func (r *RoutesBackend) SetRoutes(ctx context.Context, sourceID string, routes api.LookupRoutes) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NeighborIndex ¶
NeighborIndex is a mapping of a neighborID to a Neighbor
type NeighborsBackend ¶
type NeighborsBackend struct {
// contains filtered or unexported fields
}
NeighborsBackend is an in-memory backend implementation for the neighbors store.
func NewNeighborsBackend ¶
func NewNeighborsBackend() *NeighborsBackend
NewNeighborsBackend instanciates a new in memory neighbors backend.
func (*NeighborsBackend) CountNeighborsAt ¶
CountNeighborsAt retrievs the number of neighbors at this source.
func (*NeighborsBackend) GetNeighborsAt ¶
func (b *NeighborsBackend) GetNeighborsAt( ctx context.Context, sourceID string, ) (api.Neighbors, error)
GetNeighborsAt retrieves all neighbors for a source identified by its ID.
func (*NeighborsBackend) GetNeighborsMapAt ¶
func (b *NeighborsBackend) GetNeighborsMapAt( ctx context.Context, sourceID string, ) (map[string]*api.Neighbor, error)
GetNeighborsMapAt retrieves all neighbors for a source identified by its ID and returns a map.
func (*NeighborsBackend) SetNeighbors ¶
func (b *NeighborsBackend) SetNeighbors( ctx context.Context, sourceID string, neighbors api.Neighbors, ) error
SetNeighbors replaces the current list of neighbors for a given routeserver source.
type RoutesBackend ¶
type RoutesBackend struct {
// contains filtered or unexported fields
}
RoutesBackend implements an in memory backend for the routes store.
func NewRoutesBackend ¶
func NewRoutesBackend() *RoutesBackend
NewRoutesBackend creates a new instance
func (*RoutesBackend) CountRoutesAt ¶
CountRoutesAt returns the number of filtered and imported routes and implements the RoutesStoreBackend interface.
func (*RoutesBackend) FindByNeighbors ¶
func (r *RoutesBackend) FindByNeighbors( ctx context.Context, query []*api.NeighborQuery, filters *api.SearchFilters, ) (api.LookupRoutes, error)
FindByNeighbors will return the prefixes for a list of neighbors identified by ID.
func (*RoutesBackend) FindByPrefix ¶
func (r *RoutesBackend) FindByPrefix( ctx context.Context, prefix string, filters *api.SearchFilters, limit uint, ) (api.LookupRoutes, error)
FindByPrefix will return the prefixes matching a pattern
func (*RoutesBackend) SetRoutes ¶
func (r *RoutesBackend) SetRoutes( ctx context.Context, sourceID string, routes api.LookupRoutes, ) error
SetRoutes implements the RoutesStoreBackend interface function for setting all routes of a source identified by ID.