middleware

package
v0.0.0-...-8bbae97 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2020 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Broadcast = make(chan string)
View Source
var Clients = make(map[*websocket.Conn]string) // Note: although large maps with pointer-like types (e.g. strings) as keys are slow, using pointers themselves as keys is acceptable and fast
View Source
var Register = make(chan *websocket.Conn)
View Source
var Unregister = make(chan *websocket.Conn)

var Broadcast = make(chan model.Chat)

View Source
var User = make(chan string)

Functions

func NewWebSocket

func NewWebSocket(c *websocket.Conn)

func Protected

func Protected() func(*fiber.Ctx) error

Protected protect routes

func RunHub

func RunHub()

Types

type FiberPrometheus

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

FiberPrometheus ...

func New

func New(servicename string) *FiberPrometheus

New creates a new instance of FiberPrometheus middleware servicename is available as a const label

func NewWith

func NewWith(servicename, namespace, subsystem string) *FiberPrometheus

NewWith creates a new instance of FiberPrometheus middleware but with an ability to pass namespace and a custom subsystem Here servicename is created as a constant-label for the metrics Namespace, subsystem get prefixed to the metrics. For e.g namespace = "my_app", subsyste = "http" then then metrics would be my_app_http_requests_total{...,"service": servicename}

func (*FiberPrometheus) Middleware

func (ps *FiberPrometheus) Middleware(ctx *fiber.Ctx) error

Middleware is the actual default middleware implementation

func (*FiberPrometheus) RegisterAt

func (ps *FiberPrometheus) RegisterAt(app *fiber.App, url string)

RegisterAt will register the prometheus handler at a given URL

Jump to

Keyboard shortcuts

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