bind

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewScope

func NewScope[T any]() *trie.Trie[T]

Types

type ActionEvent

type ActionEvent[T any] struct {
	Action T
	Source *trie.Trie[T]
}

An action was triggered

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]) 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

type RawEvent

type RawEvent struct {
	Data []byte
}

All input that did not match anything in the scope

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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