spearlet

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2025 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderFuncId    = "Spear-Func-Id"
	HeaderFuncType  = "Spear-Func-Type"
	HeaderFuncAsync = "Spear-Func-Async"
)

Variables

This section is empty.

Functions

func SetLogLevel

func SetLogLevel(lvl log.Level)

Types

type Spearlet

type Spearlet struct {
	SearchPaths []string
	// contains filtered or unexported fields
}

func NewSpearlet

func NewSpearlet(cfg *SpearletConfig) *Spearlet

func (*Spearlet) ExecuteTask

func (w *Spearlet) ExecuteTask(taskId int64, funcType task.TaskType, wait bool,
	method string, data string) (string, error)

func (*Spearlet) ExecuteTaskByName

func (w *Spearlet) ExecuteTaskByName(name string, wait bool, method string,
	data string) (string, error)

func (*Spearlet) ExecuteTaskNoMeta

func (w *Spearlet) ExecuteTaskNoMeta(funcName string, funcType task.TaskType,
	wait bool, method string, data string) (string, error)

func (*Spearlet) Initialize

func (w *Spearlet) Initialize()

func (*Spearlet) ListTasks

func (w *Spearlet) ListTasks() []string

func (*Spearlet) LookupTaskId

func (w *Spearlet) LookupTaskId(name string) (int64, error)

func (*Spearlet) StartServer

func (w *Spearlet) StartServer()

func (*Spearlet) Stop

func (w *Spearlet) Stop()

type SpearletConfig

type SpearletConfig struct {
	Addr string
	Port string

	// Search Path
	SearchPath []string

	// Debug
	Debug          bool
	LocalExecution bool

	SpearAddr string

	// backend service
	StartBackendServices bool
}

func NewExecSpearletConfig

func NewExecSpearletConfig(debug bool, spearAddr string, spath []string,
	startBackendServices bool) *SpearletConfig

func NewServeSpearletConfig

func NewServeSpearletConfig(addr, port string, spath []string, debug bool,
	spearAddr string) *SpearletConfig

NewServeSpearletConfig creates a new SpearletConfig

type TaskMetaData

type TaskMetaData struct {
	Id        int64
	Type      task.TaskType
	ImageName string
	ExecName  string
	Name      string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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