Documentation ¶
Index ¶
- func Adapter() (name, atype, address string)
- func AdapterName() string
- func GetMonitorAddress() string
- func Init(configFile string) error
- func ServiceFromID(srvID structs.ServiceID) (nsrv structs.NService, err error)
- func ServicesAll() (*structs.NServices, error)
- func ServicesArea(area string) (*structs.NServices, error)
- func ShowConfigData() string
- func SplitMID(mid string) (*Area, *Provider, error)
- type AdapterData
- type Area
- type ConfigData
- type Provider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Adapter ¶
func Adapter() (name, atype, address string)
Adapter returns the adapter configuration.
func GetMonitorAddress ¶
func GetMonitorAddress() string
GetMonitorAddress returns the Telemetry Address from the config file.
func ServiceFromID ¶
ServiceFromID returns the NService data for the specified ServiceID.
func ServicesAll ¶
ServicesAll returns a list of ALL services.
func ServicesArea ¶
ServicesArea returns a list of all services available for the specified Area.
Types ¶
type AdapterData ¶
type AdapterData struct { Name string `json:"name"` Type string `json:"type"` Address string `json:"address"` }
AdapterData contains all of the config data.
type Area ¶
Area is a Service Area. It contains an index list of all of the Service Providers for this Area.
type ConfigData ¶
type ConfigData struct { Loaded bool Adapter AdapterData `json:"adapter"` Monitor struct { Address string `json:"address"` } `json:"monitor"` Categories []string `json:"serviceCategories"` Areas map[string]*Area `json:"serviceAreas"` // contains filtered or unexported fields }
ConfigData is a list of all the Service Areas. It contains an indexed list of all the Service Areas. The index is the *lowercase* area name.
func (*ConfigData) Load ¶
func (pd *ConfigData) Load(file []byte) error
Load loads the specified byte slice into the ConfigData structures.
func (ConfigData) String ¶
func (pd ConfigData) String() string
String returns the represeentation of the ConfigData custom type.
type Provider ¶
type Provider struct { ID int // Name string `json:"name"` URL string `json:"url"` APIVersion string `json:"apiVersion"` Key string `json:"key"` ResponseType string `json:"responseType"` Services []*structs.NService `json:"services"` }
Provider is the data for each Service Provider. It contains an index list of all of the Services provided by this Provider.
func MIDProvider ¶
MIDProvider returns the Provider data for the specified MidAdpID.
func RouteProvider ¶
RouteProvider returns the Provider data for the specified NRoute.