conf

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2017 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Config = new(Conf)
)

Functions

func Exit

func Exit(i interface{})

func Init

func Init() error

Types

type Conf

type Conf struct {
	Node    string // node 进程路径
	Proc    string // 当前执行任务路径
	Cmd     string // cmd 路径
	Once    string // 马上执行任务路径
	Lock    string // job lock 路径
	Group   string // 节点分组
	Noticer string // 通知

	Ttl        int64 // 节点超时时间,单位秒
	ReqTimeout int   // 请求超时时间,单位秒
	// 执行任务信息过期时间,单位秒
	// 0 为不过期
	ProcTtl int64
	// 记录任务执行中的信息的执行时间阀值,单位秒
	// 0 为不限制
	ProcReq int64
	// 单机任务锁过期时间,单位秒
	// 默认 300
	LockTtl int64

	Etcd client.Config
	Mgo  *db.Config
	Web  webConfig
	Mail *MailConf

	Security *Security
}

type MailConf

type MailConf struct {
	Enable bool
	To     []string
	// 如果配置,则按 http api 方式发送,否则按 smtp 方式发送
	HttpAPI string
	// 如果此时间段内没有邮件发送,则关闭 SMTP 连接,单位/秒
	Keepalive int64
	*gomail.Dialer
}

type Security

type Security struct {
	// 是不开启安全选项
	// true 开启
	// 所执行的命令只能是机器上的脚本,仅支持配置项里的扩展名
	// 执行用户只能选择配置里的用户
	// false 关闭,命令和用户可以用动填写
	Open bool `json:"open"`
	// 配置执行用户
	Users []string `json:"users"`
	// 支持的执行的脚本扩展名
	Ext []string `json:"ext"`
}

Jump to

Keyboard shortcuts

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