common

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 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 Database

type Database struct {
	Uri        string `yaml:"uri"`
	Name       string `yaml:"name"`
	Collection string `yaml:"collection"`
}

type Inject

type Inject struct {
	Values   *Values
	Log      *zap.Logger
	Mongo    *mongo.Client
	Db       *mongo.Database
	Schedule *Schedule
	Transfer *client.Transfer
}

type Job

type Job struct {
	*Inject
	// contains filtered or unexported fields
}

func NewJob

func NewJob(i *Inject, spec string) *Job

NewJob 创建工作

func (*Job) HttpWorker

func (x *Job) HttpWorker(ctx context.Context, option model.HttpJob) *Job

HttpWorker Http 回调工作

type Schedule

type Schedule struct {
	// contains filtered or unexported fields
}

func NewSchedule

func NewSchedule() *Schedule

func (*Schedule) Remove

func (x *Schedule) Remove(k string)

func (*Schedule) Set

func (x *Schedule) Set(k string, jobs ...*Job) (err error)

func (*Schedule) Start

func (x *Schedule) Start(k string)

func (*Schedule) State

func (x *Schedule) State(k string) []cron.Entry

type TLS

type TLS struct {
	Cert string `yaml:"cert"`
	Key  string `yaml:"key"`
}

type Transfer

type Transfer struct {
	Address string `yaml:"address"`
	TLS     TLS    `yaml:"tls"`
	Topic   string `yaml:"topic"`
}

type Values

type Values struct {
	Address  string   `yaml:"address"`
	TLS      TLS      `yaml:"tls"`
	Node     string   `yaml:"node"`
	Database Database `yaml:"database"`
	Transfer Transfer `yaml:"transfer"`
}

Jump to

Keyboard shortcuts

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