client

package module
v0.0.0-...-ae08a2b Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

README

pink-go

Documentation

Index

Constants

View Source
const (
	InstancePath               = "/pink/client/%s/instances/%s"
	ExecuteSnapshotPath        = "/pink/execute/snapshots/%s/%s/"
	ExecuteSnapshotHistoryPath = "/pink/execute/history/snapshots/"
	InstanceTTL                = 5
)
View Source
const (
	Init int32 = iota
	Doing
	Success
	Fail
)

Variables

This section is empty.

Functions

func GetLocalIP

func GetLocalIP() string

Types

type ExecuteSnapshot

type ExecuteSnapshot struct {
	Id           string `json:"id"`
	JobId        string `json:"job_id"`
	Name         string `json:"name"`
	Group        string `json:"group"`
	Cron         string `json:"cron"`
	Target       string `json:"target"`
	Ip           string `json:"ip"`
	Param        string `json:"param"`
	State        int32  `json:"state"`
	BeforeTime   string `json:"before_time"`
	ScheduleTime string `json:"schedule_time"`
	StartTime    string `json:"start_time"`
	EndTime      string `json:"end_time"`
	Times        int64  `json:"times"`
	Mobile       string `json:"mobile"`
	Version      int32  `json:"version"`
	Result       string `json:"result"`
	Remark       string `json:"remark"`
}

func (*ExecuteSnapshot) Decode

func (es *ExecuteSnapshot) Decode(content string) *ExecuteSnapshot

func (*ExecuteSnapshot) Encode

func (es *ExecuteSnapshot) Encode() string

type Job

type Job interface {
	Target() string
	// execute job
	Execute(param string) (string, error)
}

type PinkClient

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

PinkClient

func NewPinkClient

func NewPinkClient(cli *etcd.Cli, group string) *PinkClient

new PinkClient

func (*PinkClient) Subscribe

func (client *PinkClient) Subscribe(target string, job Job)

subscribe the job with target

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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