broker

package
v0.0.1-20220802-0002 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2022 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Broker

type Broker struct {
	// Name   string
	Server *server.Server         // This is the websocket server
	Pipes  map[string]*server.Hub // These are the pipes/hubs that are being created

	// Logger
	Logger *model.Logger
	// contains filtered or unexported fields
}

func GetBroker

func GetBroker(ctx context.Context, brokerName string) (*Broker, error)

GetBroker it gets a specific broker by name!

func GetDefaultBroker

func GetDefaultBroker() (*Broker, error)

GetDefaultBroker it gets the default broker from the config!

func New

func New(
	ctx context.Context,
	instanceName string,
	config brokerConfig.Config,
) (*Broker, error)

func (*Broker) CheckIsAuthenticated

func (b *Broker) CheckIsAuthenticated() gin.HandlerFunc

func (*Broker) Clean

func (b *Broker) Clean()

func (*Broker) GetNrOfPipes

func (b *Broker) GetNrOfPipes() int

func (*Broker) LDebug

func (b *Broker) LDebug() *zerolog.Event

LDebug -> 0

func (*Broker) LDebugF

func (b *Broker) LDebugF(functionName string) *zerolog.Event

LDebugF -> when you need specifically to indicate in what function the logging is happening

func (*Broker) LError

func (b *Broker) LError() *zerolog.Event

LError -> 3

func (*Broker) LErrorF

func (b *Broker) LErrorF(functionName string) *zerolog.Event

LErrorF -> when you need specifically to indicate in what function the logging is happening

func (*Broker) LEvent

func (b *Broker) LEvent(eventType string, eventName string, beforeMsg func(event *zerolog.Event))

func (*Broker) LEventCustom

func (b *Broker) LEventCustom(eventType string, eventName string) *zerolog.Event

func (*Broker) LEventF

func (b *Broker) LEventF(eventType string, eventName string, functionName string) *zerolog.Event

func (*Broker) LFatal

func (b *Broker) LFatal() *zerolog.Event

LFatal -> 4

func (*Broker) LInfo

func (b *Broker) LInfo() *zerolog.Event

LInfo -> 1

func (*Broker) LInfoF

func (b *Broker) LInfoF(functionName string) *zerolog.Event

LInfoF -> when you need specifically to indicate in what function the logging is happening

func (*Broker) LPanic

func (b *Broker) LPanic() *zerolog.Event

LPanic -> 5

func (*Broker) LWarn

func (b *Broker) LWarn() *zerolog.Event

LWarn -> 2

func (*Broker) LWarnF

func (b *Broker) LWarnF(functionName string) *zerolog.Event

LWarnF -> when you need specifically to indicate in what function the logging is happening

func (*Broker) Start

func (b *Broker) Start() error

TODO: see what we are returning here! Start -> it can be launched with goroutine if needed

func (*Broker) Stop

func (b *Broker) Stop() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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