Documentation
¶
Overview ¶
Package conf is the configuration package for SMS notification
Index ¶
- Variables
- type Options
- type Provider
- type ProviderType
- func (d ProviderType) MarshalJSON() (b []byte, err error)
- func (d ProviderType) MarshalYAML() (interface{}, error)
- func (d ProviderType) ProviderType(name string) ProviderType
- func (d ProviderType) String() string
- func (d *ProviderType) UnmarshalJSON(b []byte) (err error)
- func (d *ProviderType) UnmarshalYAML(unmarshal func(interface{}) error) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ProviderMap = map[ProviderType]string{ Yunpian: "yunpian", Twilio: "twilio", Nexmo: "nexmo", Unknown: "unknown", }
ProviderMap is the map of [provider, name]
View Source
var ProviderTypeMap = global.ReverseMap(ProviderMap)
ProviderTypeMap is the map of provider [name, provider]
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct { base.DefaultNotify `yaml:",inline"` ProviderType ProviderType `` /* 173-byte string literal not displayed */ Mobile string `` /* 150-byte string literal not displayed */ From string `yaml:"from,omitempty" json:"from,omitempty" jsonschema:"title=From,description=The sender of the notification message"` Key string `yaml:"key" json:"key" jsonschema:"title=Key,description=The key of the SMS provider"` Secret string `yaml:"secret,omitempty" json:"secret,omitempty" jsonschema:"title=Secret,description=The secret of the SMS provider"` URL string `yaml:"url,omitempty" json:"url,omitempty" jsonschema:"format=uri,title=URL,description=The URL of the SMS provider"` Sign string `yaml:"sign,omitempty" json:"sign,omitempty" jsonschema:"title=Sign,description=The sign of the SMS provider"` }
Options implements the configuration for native client
type ProviderType ¶
type ProviderType int
ProviderType is the sms provider
const ( Unknown ProviderType = iota Yunpian Twilio Nexmo )
The Provider Type of different sms provider
func (ProviderType) MarshalJSON ¶
func (d ProviderType) MarshalJSON() (b []byte, err error)
MarshalJSON is marshal the provider
func (ProviderType) MarshalYAML ¶
func (d ProviderType) MarshalYAML() (interface{}, error)
MarshalYAML is marshal the provider type
func (ProviderType) ProviderType ¶
func (d ProviderType) ProviderType(name string) ProviderType
ProviderType convert the string to ProviderType
func (ProviderType) String ¶
func (d ProviderType) String() string
String convert the DriverType to string
func (*ProviderType) UnmarshalJSON ¶
func (d *ProviderType) UnmarshalJSON(b []byte) (err error)
UnmarshalJSON is Unmarshal the provider type
func (*ProviderType) UnmarshalYAML ¶
func (d *ProviderType) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML is unmarshal the provider type
Click to show internal directories.
Click to hide internal directories.