script

package
v0.1.5 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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, nc *nats.Conn) *ScriptExecutor

NewScriptExecutor creates a new ScriptExecutor using the provided ScriptStore

func (*ScriptExecutor) HandleMessage

func (se *ScriptExecutor) HandleMessage(ctx context.Context, subject string, payload []byte, 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