bind

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewScope

func NewScope[T any](source interface{}) *trie.Trie[T]

Types

type Action added in v0.1.5

type Action struct {
	Callback *janet.Function
}

type ActionEvent

type ActionEvent[T any] struct {
	Action   T
	Source   *trie.Trie[T]
	Sequence []string
	// Any regex traversals that matched
	Args []string
}

An action was triggered

type BindEvent added in v0.1.5

type BindEvent = ActionEvent[Action]

type BindScope added in v0.1.5

type BindScope = trie.Trie[Action]

func NewBindScope added in v0.1.5

func NewBindScope(source interface{}) *BindScope

type Engine

type Engine[T any] struct {
	deadlock.RWMutex
	// contains filtered or unexported fields
}

func NewEngine

func NewEngine[T any]() *Engine[T]

func (*Engine[T]) Input

func (e *Engine[T]) Input(data []byte)

Process input and produce events.

func (*Engine[T]) InputMessage added in v0.1.5

func (e *Engine[T]) InputMessage(msg taro.Msg)

func (*Engine[T]) Poll

func (e *Engine[T]) Poll(ctx context.Context)

func (*Engine[T]) Recv

func (e *Engine[T]) Recv() <-chan Event

func (*Engine[T]) Scopes

func (e *Engine[T]) Scopes() []*trie.Trie[T]

func (*Engine[T]) SetScopes

func (e *Engine[T]) SetScopes(scopes ...*trie.Trie[T])

type Event

type Event interface{}

type Match

type Match[T any] struct {
	Bind   trie.Leaf[T]
	Source *trie.Trie[T]
}

type PartialEvent

type PartialEvent[T any] struct {
	Prefix  []string
	Matches []Match[T]
}

There are partial matches

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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