gateway

package
v1.26.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2023 License: Apache-2.0 Imports: 21 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BrMsgID added in v1.1.0

type BrMsgID struct {
	ID        string
	ChannelID string
	// contains filtered or unexported fields
}

type Gateway

type Gateway struct {
	config.Config

	Router         *Router
	MyConfig       *config.Gateway
	Bridges        map[string]*bridge.Bridge
	Channels       map[string]*config.ChannelInfo
	ChannelOptions map[string]config.ChannelOptions
	Message        chan config.Message
	Name           string
	Messages       *lru.Cache
	// contains filtered or unexported fields
}

func New

func New(rootLogger *logrus.Logger, cfg *config.Gateway, r *Router) *Gateway

New creates a new Gateway object associated with the specified router and following the given configuration.

func (*Gateway) AddBridge added in v0.9.0

func (gw *Gateway) AddBridge(cfg *config.Bridge) error

AddBridge sets up a new bridge in the gateway object with the specified configuration.

func (*Gateway) AddConfig added in v0.11.0

func (gw *Gateway) AddConfig(cfg *config.Gateway) error

AddConfig associates a new configuration with the gateway object.

func (*Gateway) FindCanonicalMsgID added in v1.12.0

func (gw *Gateway) FindCanonicalMsgID(protocol string, mID string) string

FindCanonicalMsgID returns the ID under which a message was stored in the cache.

func (*Gateway) SendMessage added in v1.13.0

func (gw *Gateway) SendMessage(
	rmsg *config.Message,
	dest *bridge.Bridge,
	channel *config.ChannelInfo,
	canonicalParentMsgID string,
) (string, error)

SendMessage sends a message (with specified parentID) to the channel on the selected destination bridge and returns a message ID or an error.

type Router added in v1.0.0

type Router struct {
	config.Config
	sync.RWMutex

	BridgeMap        map[string]bridge.Factory
	Gateways         map[string]*Gateway
	Message          chan config.Message
	MattermostPlugin chan config.Message
	// contains filtered or unexported fields
}

func NewRouter added in v1.0.0

func NewRouter(rootLogger *logrus.Logger, cfg config.Config, bridgeMap map[string]bridge.Factory) (*Router, error)

NewRouter initializes a new Matterbridge router for the specified configuration and sets up all required gateways.

func (*Router) Start added in v1.0.0

func (r *Router) Start() error

Start will connect all gateways belonging to this router and subsequently route messages between them.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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