Help us shape the future of Go! Take the 2026 Go Developer Survey

plan

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultSubscribeFn

func DefaultSubscribeFn(plan_id string, key string, value interface{}, source bool, method string, args ...interface{})

DefaultSubscribeFn is the default subscribe function

func DefaultTaskFn

func DefaultTaskFn(plan_id string, task_id string, source bool, method string, args ...interface{}) (interface{}, error)

DefaultTaskFn is the default task function

func StringStatus

func StringStatus(status plan.Status) string

StringStatus convert the plan status to a string

Types

type Instance

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

Instance is the instance of the plan

func GetPlan

func GetPlan(id string) (*Instance, error)

GetPlan get the instance of the plan

func (*Instance) Data

func (plan *Instance) Data() interface{}

Data get the data of the plan

type Object

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

Object Plan Object

func New

func New(options ...Options) *Object

New create a new Plan Object

func (*Object) ExportFunction

func (obj *Object) ExportFunction(iso *v8go.Isolate) *v8go.FunctionTemplate

ExportFunction Export as a javascript Plan function const plan = new Plan("plan-id");

plan.Add("task-id", 1, function(task, shared) {
	shared.Set("foo", "bar");
});

func (*Object) ExportObject

func (obj *Object) ExportObject(iso *v8go.Isolate) *v8go.ObjectTemplate

ExportObject Export as a FS Object

func (*Object) ID

func (obj *Object) ID(info *v8go.FunctionCallbackInfo) (string, error)

ID get the id of the plan

func (*Object) NewInstance

func (obj *Object) NewInstance(id string, this *v8go.Object, data ...interface{}) *v8go.Value

NewInstance create a new plan instance

type Options

type Options struct {
	TaskFn      TaskCallback
	SubscribeFn SubscribeCallback
}

Options are the options for the plan object

type SubscribeCallback

type SubscribeCallback func(plan_id string, key string, value interface{}, source bool, method string, args ...interface{})

SubscribeCallback is the callback for the subscribe function

type TaskCallback

type TaskCallback func(plan_id string, task_id string, source bool, method string, args ...interface{}) (interface{}, error)

TaskCallback is the callback for the task function

Jump to

Keyboard shortcuts

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