script

package
v0.1.10 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type LuamdaEndpoints added in v0.1.6

type LuamdaEndpoints struct {
	GET     []string
	POST    []string
	PUT     []string
	PATCH   []string
	DELETE  []string
	HEAD    []string
	OPTIONS []string
}

type LuamdaReader added in v0.1.6

type LuamdaReader struct {
	Endpoints *LuamdaEndpoints
}

func (*LuamdaReader) Read added in v0.1.6

func (l *LuamdaReader) Read(f io.Reader) error

func (*LuamdaReader) ReadFile added in v0.1.6

func (l *LuamdaReader) ReadFile(filename string) error

func (*LuamdaReader) ReadString added in v0.1.6

func (l *LuamdaReader) ReadString(str string) error

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, 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