Help us shape the future of Go! Take the 2026 Go Developer Survey

common

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2022 License: BSD-3-Clause Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpOption added in v1.0.5

type HttpOption struct {
	// 网络回调地址
	Url string `msgpack:"url"`

	// 请求头部
	Headers map[string]string `msgpack:"headers"`

	// 请求体
	Body map[string]interface{} `msgpack:"body"`
}

type Inject

type Inject struct {
	Values *Values
	Log    *zap.Logger
	Nats   *nats.Conn
	Js     nats.JetStreamContext
	Store  nats.ObjectStore
}

type Job

type Job struct {
	// 触发模式
	Mode string `msgpack:"mode"`

	// 时间规格
	Spec string `msgpack:"spec"`

	// 配置
	Option Option `msgpack:"option"`

	// 状态
	State `msgpack:"state"`
}

func HttpJob added in v1.0.5

func HttpJob(spec string, option HttpOption) Job

HttpJob HTTP回调

type Option added in v1.0.5

type Option interface{}

type State added in v1.0.5

type State struct {
	// 下次时间
	Next time.Time `msgpack:"next"`

	// 上次时间
	Prev time.Time `msgpack:"prev"`
}

type Status added in v1.1.3

type Status struct {
	Key     string `msgpack:"key"`
	Running bool   `msgpack:"running"`
}

type Values

type Values struct {
	// 启动调试
	Debug bool `yaml:"debug"`

	// 命名空间
	Namespace string `yaml:"namespace"`

	// Nats 配置
	Nats struct {
		Hosts []string `yaml:"hosts"`
		Nkey  string   `yaml:"nkey"`
	} `yaml:"nats"`
}

func SetValues added in v1.0.5

func SetValues() (values *Values, err error)

SetValues 设置配置

Jump to

Keyboard shortcuts

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