Documentation ¶
Index ¶
- func GetAdapterID(MID string) (string, error)
- func GetAllActiveRoutes() structs.NRoutes
- func GetAllRoutes() structs.NRoutes
- func GetAreaID(alias string) (string, error)
- func GetAreaRoutes(areaID string) (structs.NRoutes, error)
- func GetChAreaAdp() chan map[string][]string
- func GetChRouteUpd() chan map[structs.NRoute]bool
- func GetMonitorAddress() string
- func GetNetworkConfig() (address, protocol, certFile, keyFile string)
- func GetSearchRadius() (min, max int)
- func Init(configFile string) error
- func RoutesAll() (routes structs.NRoutes, err error)
- func RoutesArea(areaID string) (routes structs.NRoutes, err error)
- func RoutesMID(mid structs.ServiceID) (routes structs.NRoutes, err error)
- func RoutesRID(rid structs.ReportID) (routes structs.NRoutes, err error)
- func ValidateRID(rid structs.ReportID) bool
- type Adapter
- type Adapters
- type AdpRPCer
- type AdpStartup
- type Area
- type RPCCallMgr
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAdapterID ¶
GetAdapterID retrieves the AdapterID from a MID.
func GetAllActiveRoutes ¶
GetAllActiveRoutes returns a list of Routes that have been returned by the Service Cache queries - hence all "active" routes.
func GetAllRoutes ¶
GetAllRoutes returns a list of all configured routes.
func GetAreaID ¶
GetAreaID returns the AreaID for a Area (City) name, using the aliases in the config.json file.
func GetAreaRoutes ¶
GetAreaRoutes returns a list of Routes (structs.NRoutes) for the specified Area.
func GetChAreaAdp ¶
GetChAreaAdp returns the channel used to update the areaAdapters index.
func GetChRouteUpd ¶
GetChRouteUpd returns the channel used to update the Route Data indexed by AreaID (received from Services).
func GetMonitorAddress ¶
func GetMonitorAddress() string
GetMonitorAddress returns the Monitor Address.
func GetNetworkConfig ¶
func GetNetworkConfig() (address, protocol, certFile, keyFile string)
GetNetworkConfig returns the network configuration for the Engine.
func GetSearchRadius ¶
func GetSearchRadius() (min, max int)
GetSearchRadius returns the Min and Max Search Radius values.
func RoutesAll ¶
RoutesAll returns all routes from all CONFIG'ured adapters. This call does not use the Services cache for this list - it uses the config.json file.
func RoutesArea ¶
RoutesArea returns the route list for an AreaID (i.e. City).
func ValidateRID ¶
ValidateRID verifies the ReportID is routable.
Types ¶
type Adapter ¶
type Adapter struct { ID string // Type string `json:"type"` Address string `json:"address"` Startup AdpStartup `json:"startup"` // contains filtered or unexported fields }
Adapter represents an active Adapter.
func GetAdapter ¶
GetAdapter retrieves a pointer to the Adapter from a ID.
func GetAreaAdapters ¶
GetAreaAdapters returns a list of the Adapters that provide services to the specified Area.
func (*Adapter) Call ¶
Call invokes the RPC Client.Call() function (see https://golang.org/pkg/net/rpc/#Client)
type Adapters ¶
type Adapters struct { AuxProgs auxiliaryProgs `json:"auxiliary"` Network struct { Address string `json:"address"` Protocol string `json:"protocol"` CertFile string `json:"certFile"` KeyFile string `json:"keyFile"` } `json:"network"` Monitor struct { Address string `json:"address"` } `json:"monitor"` General struct { SearchRadiusMin int `json:"searchRadiusMin"` SearchRadiusMax int `json:"searchRadiusMax"` } `json:"general"` Adapters map[string]*Adapter `json:"adapters"` // Index: AdpID Areas map[string]*Area `json:"areas"` // Index: AreaID sync.RWMutex // contains filtered or unexported fields }
Adapters is the list of all active Adapters.
type AdpRPCer ¶
type AdpRPCer interface { AdpID() string Connected() bool Call(serviceMethod string, args interface{}, reply interface{}) error }
AdpRPCer is an interface to the Adapter RPC status and Client.
type AdpStartup ¶
type AdpStartup struct { Autostart bool `json:"autostart"` Dir string `json:"dir"` Cmd string `json:"cmd"` Args []string `json:"args"` }
AdpStartup represents the startup data for an adapter.
type RPCCallMgr ¶
type RPCCallMgr struct {
// contains filtered or unexported fields
}
RPCCallMgr manages the RPC call(s) to service a request.
func NewRPCCallMgr ¶
func NewRPCCallMgr(reqmgr requester) (*RPCCallMgr, error)
NewRPCCallMgr returns a RPCCallMgr instance, with routes as per the requester interface.
func (RPCCallMgr) String ¶
func (r RPCCallMgr) String() string
-------------------------------- String ---------------------------------