router

package
v1.18.3 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: Apache-2.0 Imports: 3 Imported by: 2

Documentation

Overview

Package router defines the interface of router.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Default

func Default() *defaultRouter

DefaultRouter provides a default implementation of `router`, It routes data according to observed tag and metadata.

Types

type Router

type Router interface {
	// Add adds the route rule to the router.
	Add(id uint64, observeDataTags []uint32, md metadata.M) error
	// Route gets the ID list of connections from the router.
	Route(dataTag uint32, md metadata.M) (connIDs []uint64)
	// Remove removes the route rule from the router.
	Remove(id uint64)
	// Release release the router and removes all the route rules.
	Release()
}

Router routes data that is written by source/sfn according to parameters be passed. Users should define their own rules that tells zipper how to route data and how to store the rules.

Jump to

Keyboard shortcuts

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