clijob

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CmdParser

type CmdParser interface {
	//解析命令行参数,并选择对应的job任务
	JobArgParse(jobs map[string]Job) (selectedJobs []Job, err error)
}

type Job

type Job struct {
	//任务名称
	Name string
	Task TaskFunc
}

func (*Job) Do

func (j *Job) Do() error

type JobServer

type JobServer struct {
	*bootstrap.FuncSetter
	Opts Options

	Jobs map[string]Job
	// contains filtered or unexported fields
}

func NewJobServer

func NewJobServer(options ...OptionFunc) *JobServer

func (*JobServer) AddJobs

func (js *JobServer) AddJobs(jobs map[string]Job) error

func (*JobServer) Start

func (js *JobServer) Start() (err error)

func (*JobServer) Stop

func (js *JobServer) Stop()

type OptionFunc

type OptionFunc func(*Options)

func OptSetCmdParser

func OptSetCmdParser(parser CmdParser) OptionFunc

type Options

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

func DefaultOptions

func DefaultOptions() Options

type TaskFunc

type TaskFunc func() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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