spearlet

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2025 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderFuncId   = "Spear-Func-Id"
	HeaderFuncName = "Spear-Func-Name"
	HeaderFuncType = "Spear-Func-Type"
)

Variables

This section is empty.

Functions

func SetLogLevel

func SetLogLevel(lvl log.Level)

Types

type Spearlet

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

func NewSpearlet

func NewSpearlet(cfg *SpearletConfig) *Spearlet

func (*Spearlet) CommunicationManager added in v0.0.3

func (w *Spearlet) CommunicationManager() *hostcalls.CommunicationManager

func (*Spearlet) ExecuteTask

func (w *Spearlet) ExecuteTask(funcId int64, funcName string, funcType task.TaskType,
	method, data string, inStream, outStream chan task.Message) (t task.Task, respData string,
	err error)

func (*Spearlet) ExecuteTaskById added in v0.0.3

func (w *Spearlet) ExecuteTaskById(taskId int64, funcType task.TaskType, method string,
	reqData string, reqStream chan task.Message, respStream chan task.Message) (t task.Task,
	respData string,
	err error)

func (*Spearlet) ExecuteTaskByName

func (w *Spearlet) ExecuteTaskByName(taskName string, funcType task.TaskType, method string,
	reqData string, reqStream chan task.Message, respStream chan task.Message) (t task.Task,
	respData string, err 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) RunTask added in v0.0.3

func (w *Spearlet) RunTask(funcId int64, funcName string, funcType task.TaskType,
	method string, data string, reqStream chan task.Message, respStream chan task.Message,
	sendTermOnRtn bool, waitInstance bool) (
	respData string, err error)

func (*Spearlet) StartProviderService added in v0.0.3

func (w *Spearlet) StartProviderService()

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

	SpearAddr string

	// backend service
	StartBackendServices bool

	CertFile string
	KeyFile  string
}

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, certFile string, keyFile string,
	startBackendService bool) (*SpearletConfig, error)

NewServeSpearletConfig creates a new SpearletConfig

type TaskMetaData

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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