Version: v1.1.5 Latest Latest

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

Go to latest
Published: Aug 3, 2022 License: MIT Imports: 16 Imported by: 8




View Source
const PackageName = "task.ejob"

PackageName 包名


This section is empty.


func Handle added in v0.6.0

func Handle(w http.ResponseWriter, r *http.Request)

Handle ...

func HandleJobList added in v0.6.3

func HandleJobList(w http.ResponseWriter, r *http.Request)

HandleJobList job列表


type Component

type Component struct {
	// contains filtered or unexported fields

Component ...

func Job added in v0.6.0

func Job(name string, startFunc func(Context) error) *Component

Job Job方法

func (*Component) Init

func (c *Component) Init() error

Init 初始化

func (*Component) Name

func (c *Component) Name() string

Name 配置名称

func (*Component) PackageName

func (c *Component) PackageName() string

PackageName 包名

func (*Component) Start

func (c *Component) Start() (err error)

Start 启动

func (*Component) StartHTTP added in v0.6.3

func (c *Component) StartHTTP(w http.ResponseWriter, r *http.Request) (err error)

StartHTTP ...

func (*Component) Stop

func (c *Component) Stop() error

Stop ...

type Config

type Config struct {
	Name string
	// contains filtered or unexported fields

Config ...

type Container

type Container struct {
	// contains filtered or unexported fields

Container 容器

func DefaultContainer

func DefaultContainer() *Container

DefaultContainer 默认容器 Deprecated Use ejob.Job()

func (*Container) Build

func (c *Container) Build(options ...Option) *Component

Build 构建组件 Deprecated Use ejob.Job()

type Context added in v0.6.0

type Context struct {
	Ctx     context.Context
	Writer  http.ResponseWriter
	Request *http.Request

Context Job Context

type Ejob

type Ejob interface {

Ejob ...

type Option

type Option func(c *Container)

Option 选项

func WithName

func WithName(name string) Option

WithName 设置Job的名称

func WithStartFunc

func WithStartFunc(startFunc func(ctx Context) error) Option

WithStartFunc 设置Job的函数

Jump to

Keyboard shortcuts

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