handler

package
v0.0.0-...-ab45ee7 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	HandleResponse func(reflect.Value, *Response)
	HandleError    func(reflect.Value, error)
	// contains filtered or unexported fields
}

Handler ...

func New

func New() *Handler

New creates a new Handler.

func (*Handler) AddHandler

func (h *Handler) AddHandler(fn interface{})

AddHandler adds the given function handler.

func (*Handler) Call

func (h *Handler) Call(ev interface{})

Call calls the handler with the given event. This should be passed as a handler to the main state handler. Yes, this means that we reflect all events twice... luckily, we don't really care about the few milliseconds that might take at worst.

type Response

type Response struct {
	// Guild ID to log to
	GuildID discord.GuildID
	// Channel ID to log to
	ChannelID discord.ChannelID

	Embeds []discord.Embed
	Files  []sendpart.File
}

Response must be returned by handler functions.

type SentryHandler

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

SentryHandler ...

func NewSentry

func NewSentry() *SentryHandler

NewSentry ...

func (*SentryHandler) AddHandler

func (h *SentryHandler) AddHandler(v interface{})

AddHandler adds the given event handler.

func (*SentryHandler) Handle

func (h *SentryHandler) Handle(hub *sentry.Hub, ev interface{})

Handle handles the given event + sentry hub

Jump to

Keyboard shortcuts

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