app

package
v0.0.0-...-de348d4 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetGotdVersion

func GetGotdVersion() string

GetGotdVersion optimistically gets current gotd version.

Does not handle replace directives.

Types

type Handler

type Handler struct {
	Middleware *oteltg.Middleware
	// contains filtered or unexported fields
}

Handler implements stats request handler.

func NewHandler

func NewHandler(m *app.Metrics) Handler

func (Handler) OnMessage

func (h Handler) OnMessage(ctx context.Context, e dispatch.MessageEvent) error

OnMessage implements dispatch.MessageHandler.

type Middleware

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

func NewMiddleware

func NewMiddleware(
	next dispatch.MessageHandler,
	d *downloader.Downloader,
	metrics *app.Metrics,
	opts MiddlewareOptions,
) Middleware

NewMiddleware creates new metrics middleware

func (Middleware) OnMessage

func (m Middleware) OnMessage(ctx context.Context, e dispatch.MessageEvent) error

OnMessage implements dispatch.MessageHandler.

type MiddlewareOptions

type MiddlewareOptions struct {
	BotAPI *botapi.Client
	Logger *zap.Logger
}

MiddlewareOptions is middleware options.

Jump to

Keyboard shortcuts

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