1
0
mirror of https://github.com/alice-lg/alice-lg.git synced 2024-05-11 05:55:03 +00:00

35 lines
1.0 KiB
Go
Raw Normal View History

2021-11-15 21:29:54 +01:00
// Package sources provides the base interface for all
// route server data source implementations.
2017-05-16 14:10:02 +02:00
package sources
2017-05-18 18:10:55 +02:00
import (
2021-11-19 19:08:59 +01:00
"errors"
2021-03-22 17:35:20 +01:00
"github.com/alice-lg/alice-lg/pkg/api"
2017-05-18 18:10:55 +02:00
)
2021-11-19 19:08:59 +01:00
// Source Errors
var (
// SourceNotFound indicates that a source could
// not be resolved by an identifier.
ErrSourceNotFound = errors.New("route server unknown")
// ErrSourceBusy is returned when a refresh is
// already in progress.
ErrSourceBusy = errors.New("source is busy")
)
2021-03-22 17:35:20 +01:00
// Source is a generic datasource for alice.
// All route server adapters implement this interface.
2017-05-16 14:10:02 +02:00
type Source interface {
ExpireCaches() int
2018-07-11 18:25:42 +02:00
Status() (*api.StatusResponse, error)
2021-10-15 17:24:37 +02:00
Neighbors() (*api.NeighborsResponse, error)
NeighborsStatus() (*api.NeighborsStatusResponse, error)
2021-03-22 17:35:20 +01:00
Routes(neighborID string) (*api.RoutesResponse, error)
RoutesReceived(neighborID string) (*api.RoutesResponse, error)
RoutesFiltered(neighborID string) (*api.RoutesResponse, error)
RoutesNotExported(neighborID string) (*api.RoutesResponse, error)
2018-07-11 18:25:42 +02:00
AllRoutes() (*api.RoutesResponse, error)
2017-05-16 14:10:02 +02:00
}