ejob

package
v1.2.7 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: MIT Imports: 16 Imported by: 9 modules, 15 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const PackageName = "task.ejob"

PackageName 包名

Variables

View Source
var Handle = http.HandlerFunc(handleFunc)

Functions

func HandleJobList added in v0.6.3

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

HandleJobList job列表

Types

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 defines a component instance.

func DefaultContainer

func DefaultContainer() *Container

DefaultContainer returns an default container. Deprecated Use ejob.Job()

func (*Container) Build

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

Build constructs a specific component from container. 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 {
	standard.Component
}

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