sentry

package
v0.0.0-...-f5ef94b Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHub

func GetHub(ctx interface{ Get(string) interface{} }) *sentry.Hub

GetHub extracts the *sentry.Hub from the passed context. The context is abstracted as interface { Get(string) interface{} }, to allow both getting from *state.XEvents and *plugin.Contexts.

If no hub is accessible using 'sentry.hub' as key, a clone of the current hub will be returned.

func Init

func Init() error

Init initializes sentry using config.C.

Types

type Middlewares

type Middlewares struct {
	MessageCreateMiddleware func(*state.State, *state.MessageCreateEvent)
	MessageUpdateMiddleware func(*state.State, *state.MessageUpdateEvent)
	Middleware              bot.MiddlewareFunc
	PostMiddleware          bot.MiddlewareFunc
}

Middlewares is a data struct that contains the middlewares sentry provides.

func NewMiddlewares

func NewMiddlewares(h *sentry.Hub) Middlewares

NewMiddlewares returns a struct containing all Middlewares relevant to sentry. Callers must ensure that either all, or no middlewares are added, to ensure proper functionality.

Jump to

Keyboard shortcuts

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