bridges

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

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) Close

func (b *BridgeWS) Close() error

func (*BridgeWS) Identify

func (b *BridgeWS) Identify() *core.BridgeIdentityInfo

func (*BridgeWS) SendMessage

func (b *BridgeWS) SendMessage(ctx context.Context, message *core.BridgeMessage) error

func (*BridgeWS) SetCloseHandler

func (b *BridgeWS) SetCloseHandler(handler func(err error))

func (*BridgeWS) SetErrorHandler

func (b *BridgeWS) SetErrorHandler(handler func(err error))

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 NewDatabase

func NewDatabase() *Database

NewDatabase is a constructor for *Database.

func (*Database) CreateIndexes

func (d *Database) CreateIndexes(ctx context.Context, indexData []mongo.IndexModel) error

CreateIndexes creates indexes as per the provided data on the "bridges" collection/table.

func (*Database) DeleteBridgeForNode

func (d *Database) DeleteBridgeForNode(ctx context.Context, bridgeID string, nodeAddr string) error

func (*Database) DeleteBridgesForNode

func (d *Database) DeleteBridgesForNode(ctx context.Context, bridgeIDs []string, nodeAddr string) error

func (*Database) GetBridgesByClientIDs

func (d *Database) GetBridgesByClientIDs(ctx context.Context, clientIDs []string) ([]*core.BridgeDoc, error)

func (*Database) InsertBridge

func (d *Database) InsertBridge(ctx context.Context, doc *core.BridgeDoc) error

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 (d *DatabaseLocal) DeleteBridgeForNode(ctx context.Context, bridgeID string, nodeAddr string) error

func (*DatabaseLocal) DeleteBridgesForNode

func (d *DatabaseLocal) DeleteBridgesForNode(ctx context.Context, bridgeIDs []string, nodeAddr string) error

func (*DatabaseLocal) GetBridgesByClientIDs

func (d *DatabaseLocal) GetBridgesByClientIDs(ctx context.Context, clientIDs []string) ([]*core.BridgeDoc, error)

func (*DatabaseLocal) InsertBridge

func (d *DatabaseLocal) InsertBridge(ctx context.Context, doc *core.BridgeDoc) error

type Manager

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

Manager implements the core.BridgeManager interface using a local map.

func NewManager

func NewManager() *Manager

NewManager is a constructor for *Manager.

func (*Manager) CreateBridge

func (m *Manager) CreateBridge(ctx context.Context, params *core.BridgeCreateParams) (core.Bridge, error)

func (*Manager) DeleteBridgeByID

func (m *Manager) DeleteBridgeByID(ctx context.Context, bridgeID string)

func (*Manager) GetBridgeByID

func (m *Manager) GetBridgeByID(ctx context.Context, bridgeID string) core.Bridge

func (*Manager) GetBridgesByClientID

func (m *Manager) GetBridgesByClientID(ctx context.Context, clientID string) []core.Bridge

Jump to

Keyboard shortcuts

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