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 EmailAuth
- type EmailAuthData
- type EmailConfig
- type EmailSender
- 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"` Email EmailAuth `json:"email"` 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 EmailAuth ¶
type EmailAuth struct { AuthFile string `json:"auth"` Auth EmailAuthData }
EmailAuth contains the file path and EmailAuthData.
type EmailAuthData ¶
type EmailAuthData struct { common.JSONConfig Account string `json:"account"` Password string `json:"password"` Server string `json:"server"` Port int `json:"port"` }
EmailAuthData contains the config and keys to access the server used to send emails.
func GetEmailAuth ¶
func GetEmailAuth() EmailAuthData
GetEmailAuth returns the full path and filename of the Email Auth data.
func (EmailAuthData) String ¶
func (r EmailAuthData) String() string
type EmailConfig ¶
type EmailConfig struct { To []string `json:"to"` From []string `json:"from"` Subject string `json:"subject"` TemplateFile string `json:"template"` // contains filtered or unexported fields }
EmailConfig contains the data used to send email to a Provider. It also includes the parsed email template used to format all emails sent to this Provider.
func (EmailConfig) Address ¶
func (r EmailConfig) Address() (to, from []string, subject string)
Address returns the EmailConfig parameters necessary to send an email.
func (EmailConfig) String ¶
func (r EmailConfig) String() string
func (EmailConfig) Template ¶
func (r EmailConfig) Template() (tmpl *template.Template)
Template returns a pointer to the parsed Template object.
type EmailSender ¶
type EmailSender interface { Address() (to, from []string, subject string) Template() (tmpl *template.Template) }
EmailSender is an interface to the EmailConfig information.
type Provider ¶
type Provider struct { ID int // Name string `json:"name"` Email *EmailConfig `json:"email"` 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 ServiceID.
func RouteProvider ¶
RouteProvider returns the Provider data for the specified NRoute.