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

script

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message added in v0.2.0

type Message struct {
	Subject string
	Payload []byte
	Method  string
	URL     string
}

type Script

type Script struct {
	Name    string
	Subject string
	Content []byte
	LibKeys []string
}

type ScriptExecutor

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

ScriptExecutor defines the structure responsible for managing Lua script execution

func NewScriptExecutor

func NewScriptExecutor(store msgstore.ScriptStore, plugins []msgplugins.PreloadFunc, nc *nats.Conn) *ScriptExecutor

NewScriptExecutor creates a new ScriptExecutor using the provided ScriptStore

func (*ScriptExecutor) HandleMessage

func (se *ScriptExecutor) HandleMessage(ctx context.Context, msg *Message, replyFunc func(string))

HandleMessage receives a message, matches it to a Lua script, and executes the script in a new goroutine

func (*ScriptExecutor) Stop

func (se *ScriptExecutor) Stop()

Stop gracefully shuts down the ScriptExecutor and stops watching for messages

type ScriptReader

type ScriptReader struct {
	Script *Script
}

func (*ScriptReader) Read

func (s *ScriptReader) Read(f io.Reader) error

func (*ScriptReader) ReadFile

func (s *ScriptReader) ReadFile(filename string) error

func (*ScriptReader) ReadString added in v0.1.5

func (s *ScriptReader) ReadString(str string) error

Jump to

Keyboard shortcuts

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