Documentation
¶
Index ¶
- Constants
- Variables
- func Init()
- func RegisterLoader(configLoader ConfigLoader)
- func RegisterWatcher(w Watcher)
- func WhichCategory(name t.Category) (*t.SMSCategory, error)
- func WhichChannel(name t.Category) (t.Channel, error)
- func WhichTemplate(name t.Name) (*t.SMSTemplate, error)
- type ConfigLoader
- type SMSConfig
- type Watcher
Constants ¶
View Source
const ( CollSMSTemplate = "sms_template" CollSMSCategory = "sms_category" )
Variables ¶
View Source
var ( ErrTemplateNotFound = errors.New("template not found") ErrCategoryNotFound = errors.New("category not found") ErrTemplateNotAvailable = errors.New("template not available") //短信类别 LoadedCategories = make(map[t.Category]t.SMSCategory) //短信通道 LoadedChannels = make(map[t.Category]t.Channel) //短信模版 LoadedTemplates = make(map[t.Name]t.SMSTemplate) )
Functions ¶
func RegisterLoader ¶
func RegisterLoader(configLoader ConfigLoader)
func RegisterWatcher ¶
func RegisterWatcher(w Watcher)
func WhichCategory ¶
func WhichCategory(name t.Category) (*t.SMSCategory, error)
func WhichChannel ¶
WhichChannel returns a channel for given category
func WhichTemplate ¶
func WhichTemplate(name t.Name) (*t.SMSTemplate, error)
WhichTemplate returns the enabled template for given name
Types ¶
type ConfigLoader ¶
type ConfigLoader interface {
LoadCategory() []t.SMSCategory
LoadTemplate() []t.SMSTemplate
}
Click to show internal directories.
Click to hide internal directories.