match

package
v0.0.0-...-aed1ee4 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package match builds a tree of active subscriptions that is matched against all incoming updates.

Index

Constants

View Source
const Glob = "*"

Glob is a special string used to indicate a match of any path node.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Update(interface{})
}

Client is a interface for a callback invoked for all matching updates.

type Match

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

Match is a structure that will invoke registered query callbacks for each matching update.

func New

func New() *Match

New creates a new Match structure.

func (*Match) AddQuery

func (m *Match) AddQuery(query []string, client Client) (remove func())

AddQuery registers a client callback for all matching nodes. It returns a callback to remove the query. The remove function is idempotent.

func (*Match) Update

func (m *Match) Update(n interface{}, p []string)

Update invokes all client callbacks for queries that match the supplied node.

Jump to

Keyboard shortcuts

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