Documentation ¶
Index ¶
- type BridgeWS
- func (b *BridgeWS) Close() error
- func (b *BridgeWS) Identify() *core.BridgeIdentityInfo
- func (b *BridgeWS) SendMessage(ctx context.Context, message *core.BridgeMessage) error
- func (b *BridgeWS) SetCloseHandler(handler func(err error))
- func (b *BridgeWS) SetErrorHandler(handler func(err error))
- func (b *BridgeWS) SetMessageHandler(handler func(message *core.BridgeMessage))
- type Database
- func (d *Database) CreateIndexes(ctx context.Context, indexData []mongo.IndexModel) error
- func (d *Database) DeleteBridgeForNode(ctx context.Context, bridgeID string, nodeAddr string) error
- func (d *Database) DeleteBridgesForNode(ctx context.Context, bridgeIDs []string, nodeAddr string) error
- func (d *Database) GetBridgesByClientIDs(ctx context.Context, clientIDs []string) ([]*core.BridgeDoc, error)
- func (d *Database) InsertBridge(ctx context.Context, doc *core.BridgeDoc) error
- type DatabaseLocal
- func (d *DatabaseLocal) DeleteBridgeForNode(ctx context.Context, bridgeID string, nodeAddr string) error
- func (d *DatabaseLocal) DeleteBridgesForNode(ctx context.Context, bridgeIDs []string, nodeAddr string) error
- func (d *DatabaseLocal) GetBridgesByClientIDs(ctx context.Context, clientIDs []string) ([]*core.BridgeDoc, error)
- func (d *DatabaseLocal) InsertBridge(ctx context.Context, doc *core.BridgeDoc) error
- type Manager
- func (m *Manager) CreateBridge(ctx context.Context, params *core.BridgeCreateParams) (core.Bridge, error)
- func (m *Manager) DeleteBridgeByID(ctx context.Context, bridgeID string)
- func (m *Manager) GetBridgeByID(ctx context.Context, bridgeID string) core.Bridge
- func (m *Manager) GetBridgesByClientID(ctx context.Context, clientID string) []core.Bridge
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BridgeWS ¶
type BridgeWS struct {
// contains filtered or unexported fields
}
BridgeWS implements the core.Bridge interface using websockets.
func (*BridgeWS) Identify ¶
func (b *BridgeWS) Identify() *core.BridgeIdentityInfo
func (*BridgeWS) SendMessage ¶
func (*BridgeWS) SetCloseHandler ¶
func (*BridgeWS) SetErrorHandler ¶
func (*BridgeWS) SetMessageHandler ¶
func (b *BridgeWS) SetMessageHandler(handler func(message *core.BridgeMessage))
type Database ¶
type Database struct{}
Database implements the core.BridgeDatabase interface using MongoDB.
func (*Database) CreateIndexes ¶
CreateIndexes creates indexes as per the provided data on the "bridges" collection/table.
func (*Database) DeleteBridgeForNode ¶
func (*Database) DeleteBridgesForNode ¶
func (*Database) GetBridgesByClientIDs ¶
type DatabaseLocal ¶
type DatabaseLocal struct {
// contains filtered or unexported fields
}
DatabaseLocal implements the core.BridgeDatabase interface locally (in-memory).
func NewDatabaseLocal ¶
func NewDatabaseLocal() *DatabaseLocal
NewDatabaseLocal is a constructor for *DatabaseLocal.
func (*DatabaseLocal) DeleteBridgeForNode ¶
func (*DatabaseLocal) DeleteBridgesForNode ¶
func (*DatabaseLocal) GetBridgesByClientIDs ¶
func (*DatabaseLocal) InsertBridge ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager implements the core.BridgeManager interface using a local map.
func (*Manager) CreateBridge ¶
func (*Manager) DeleteBridgeByID ¶
func (*Manager) GetBridgeByID ¶
Click to show internal directories.
Click to hide internal directories.