g

package
v0.0.0-...-24b6552 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 31, 2017 License: Apache-2.0 Imports: 5 Imported by: 4

Documentation

Index

Constants

View Source
const (
	VERSION = "sdpv0.0.4"
)

v0.0.2 changes:send mail by smtp, set acount in config,add 99u msg ,phone by nexmo api v0.0.3 changes:im replace response msg with task_id,use new go-utils im.go sdpv0.0.4 go-utils rewrite sendmail, add record phone alarm group, fix bug of TransContent

Variables

View Source
var (
	ConfigFile string
)

Functions

func ParseConfig

func ParseConfig(cfg string)

Types

type AcountConfig

type AcountConfig struct {
	IM     *IMConfig     `json:"im"`
	Phone  *PhoneConfig  `json:"phone"`
	Mail   *MailConfig   `json:"mail"`
	Wechat *WechatConfig `json:"wechat"`
}

type GlobalConfig

type GlobalConfig struct {
	Debug  bool          `json:"debug"`
	Http   *HttpConfig   `json:"http"`
	Redis  *RedisConfig  `json:"redis"`
	Queue  *QueueConfig  `json:"queue"`
	Worker *WorkerConfig `json:"worker"`
	Acount *AcountConfig `json:"acount"`
	Hosts  *HostsConfig  `json:"hosts"`
}

func Config

func Config() *GlobalConfig

type HostsConfig

type HostsConfig struct {
	Api_url  string `json:"api"`
	Interval int    `json:"interval"`
}

type HttpConfig

type HttpConfig struct {
	Enabled bool   `json:"enabled"`
	Listen  string `json:"listen"`
}

type IMConfig

type IMConfig struct {
	Uri        string `json:"uri"`
	Password   string `json:"password"`
	Group      string `json:"group,omitempty"`
	PhoneGroup string `json:"phonegroup,omitempty"`
}

group用来记录发送历史,为99U群号,所有发送历史都会汇总发到该群组(通过逗号分割)

type MailConfig

type MailConfig struct {
	Server   string `json:"server"`
	User     string `json:"user"`
	Password string `json:"password"`
}

type PhoneConfig

type PhoneConfig struct {
	Key      string `json:"key"`
	Serect   string `json:"secret"`
	Callback string `json:"callback,omitempty"`
}

type QueueConfig

type QueueConfig struct {
	Sms    string `json:"sms"`
	Mail   string `json:"mail"`
	IMSms  string `json:"im"`
	Phone  string `json:"phone"`
	Wechat string `json:"wechat"`
}

type RedisConfig

type RedisConfig struct {
	Addr    string `json:"addr"`
	MaxIdle int    `json:"maxIdle"`
}

type WechatConfig

type WechatConfig struct {
	CorpId    string `json:"corp_id"`
	AgentId   string `json:"agent_id"`
	SecretKey string `json:"secret_key"`
}

type WorkerConfig

type WorkerConfig struct {
	IMSms  int `json:"im"`
	Mail   int `json:"mail"`
	Phone  int `json:"phone"`
	Wechat int `json:"wechat"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL