Documentation ¶
Index ¶
- type Exchange
- func (b *Exchange) AddNorthbound(backend ...backend.Northbound)
- func (b *Exchange) AddSouthbound(backend ...backend.Southbound)
- func (b *Exchange) ConnectGateway(gatewayID ...string)
- func (b *Exchange) InitRedisState(client *redis.Client, key string) (gatewayIDs []string)
- func (b *Exchange) SetAuth(auth auth.Interface)
- func (b *Exchange) SetID(id string)
- func (b *Exchange) SetMiddleware(chain middleware.Chain)
- func (b *Exchange) Start(goroutines int, timeout time.Duration) (finishedWithinTimeout bool)
- func (b *Exchange) Stop()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Exchange ¶
type Exchange struct {
// contains filtered or unexported fields
}
Exchange routes messages between northbound backends (servers that are up the chain) and southbound backends gateways or servers that are down the chain.
When a connection message is received on the southbound backend: - Uplink messages are routed from the southbound backends to the northbound backends - Downlink messages are routed from the northbound backends to the southbound backends - Status messages are routed from the southbound backends to the northbound backends until a disconnection message is received on the southbound backend
func (*Exchange) AddNorthbound ¶
func (b *Exchange) AddNorthbound(backend ...backend.Northbound)
AddNorthbound adds a new northbound backend (server that is up the chain)
func (*Exchange) AddSouthbound ¶
func (b *Exchange) AddSouthbound(backend ...backend.Southbound)
AddSouthbound adds a new southbound backend (gateway or server that is down the chain)
func (*Exchange) ConnectGateway ¶
ConnectGateway force-connects gateways with the given IDs
func (*Exchange) InitRedisState ¶
InitRedisState initializes Redis-backed connection state for the exchange and returns the state stored in the database
func (*Exchange) SetMiddleware ¶
func (b *Exchange) SetMiddleware(chain middleware.Chain)
SetMiddleware sets the middleware to be executed