network/router/router.go

25 lines
657 B
Go

package router
import (
"git.hpds.cc/Component/network/frame"
"git.hpds.cc/Component/network/metadata"
)
// Router is the interface to manage the routes for applications.
type Router interface {
// Route gets the route
Route(metadata metadata.Metadata) Route
// Clean the routes.
Clean()
}
// Route manages data subscribers according to their observed data tags.
type Route interface {
// Add a route.
Add(connId string, name string, observeDataTags []frame.Tag) error
// Remove a route.
Remove(connId string) error
// GetForwardRoutes returns all the subscribers by the given data tag.
GetForwardRoutes(tag frame.Tag) (streamIds []string)
}