interfaces

package
v0.0.0-...-3f08e25 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractJobName

func ExtractJobName(jobKey string) string

从etcd jobs key中提取JobName 比如:/crontab/jobs/test 得到的jobName是test

func ExtractKillJobName

func ExtractKillJobName(killKey string) string

从etcd kill key中提取jobName 比如:/crontab/kill/test 得到的jobName是test

Types

type WatchHandler

type WatchHandler interface {
	HandlerGetResponse(getResponse *clientv3.GetResponse) // 监听key之前先 Get一下所有的Key
	HandlerWatchChan(watchChan clientv3.WatchChan)        // 监听事件会有个watchResponse的Channel
}

type WatchJobsHandlerDemo

type WatchJobsHandlerDemo struct {
	KeyDir string // 监听的key目录
}

func (*WatchJobsHandlerDemo) HandlerGetResponse

func (demo *WatchJobsHandlerDemo) HandlerGetResponse(response *clientv3.GetResponse)

func (*WatchJobsHandlerDemo) HandlerWatchChan

func (demo *WatchJobsHandlerDemo) HandlerWatchChan(watchChan clientv3.WatchChan)

type WatchKillHandlerDemo

type WatchKillHandlerDemo struct {
}

监听kill处理器Demo

func (*WatchKillHandlerDemo) HandlerGetResponse

func (demo *WatchKillHandlerDemo) HandlerGetResponse(response *clientv3.GetResponse)

func (*WatchKillHandlerDemo) HandlerWatchChan

func (demo *WatchKillHandlerDemo) HandlerWatchChan(watchChan clientv3.WatchChan)

Jump to

Keyboard shortcuts

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