node

package
v0.0.0-...-8aeb8a1 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2023 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JitsuKvGetCommand = "_JITSU_KV_GET"
	JitsuKvSetCommand = "_JITSU_KV_SET"
)

Variables

View Source
var DefaultExchangeTimeout = time.Minute

Functions

This section is empty.

Types

type Execute

type Execute struct {
	Session
	Function string        `json:"function,omitempty"`
	Args     []interface{} `json:"args"`
}

type Factory

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

func NewFactory

func NewFactory(poolSize, maxSpace, sourcesMaxSpace int, transformStorage script.Storage, tmpDir ...string) (*Factory, error)

func (*Factory) Close

func (f *Factory) Close() error

func (*Factory) CreateScript

func (f *Factory) CreateScript(executable script.Executable, variables map[string]interface{}, standalone bool, includes ...string) (script.Interface, error)

func (*Factory) ProcessCustomCommand

func (f *Factory) ProcessCustomCommand(command string, payload []byte) (*ipc.CommandResponse, error)

type Init

type Init struct {
	Session
	Executable string                 `json:"executable"`
	Variables  map[string]interface{} `json:"variables,omitempty"`
	Includes   []string               `json:"includes,omitempty"`
}

type KeyValueCommand

type KeyValueCommand struct {
	RequestId     int64   `json:"requestId"`
	DestinationId string  `json:"destinationId"`
	Key           string  `json:"key"`
	Value         *string `json:"value,omitempty"`
	TTLms         *int64  `json:"ttlMs,omitempty"`
	Success       bool    `json:"success"`
	Error         string  `json:"error"`
}

KeyValueCommand is used to pass payload of key-value storage commands and results.

type Log

type Log struct {
	Level   string `json:"level"`
	Message string `json:"message"`
}

type Request

type Request struct {
	Command string      `json:"command"`
	Payload interface{} `json:"payload,omitempty"`
}

type Response

type Response struct {
	Ok     bool            `json:"ok"`
	Result json.RawMessage `json:"result,omitempty"`
	Error  string          `json:"error,omitempty"`
	Stack  string          `json:"stack,omitempty"`
	Log    []Log           `json:"log,omitempty"`
}

type Script

type Script struct {
	*Init
	// contains filtered or unexported fields
}

func (*Script) Close

func (s *Script) Close()

func (*Script) Describe

func (s *Script) Describe() (script.Symbols, error)

func (*Script) Execute

func (s *Script) Execute(name string, args []interface{}, result interface{}, listener script.Listener) error

type Session

type Session struct {
	Session string `json:"session"`
}

Jump to

Keyboard shortcuts

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