errorshandler

package
v0.0.0-...-6794387 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2021 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultQueueName = "errors/default"

Variables

This section is empty.

Functions

func GetQueueCache

func GetQueueCache(nonDefaultQueues []string) map[string]bool

GetQueueCache - construct searching set from array of queue names

Types

type BrokerMessage

type BrokerMessage struct {
	ProjectId   string          `json:"projectId"`
	Payload     json.RawMessage `json:"payload"`
	CatcherType string          `json:"catcherType"`
}

BrokerMessage represents message to a queue

type CatcherMessage

type CatcherMessage struct {
	Token       string          `json:"token"`
	Payload     json.RawMessage `json:"payload"`
	CatcherType string          `json:"catcherType"`
}

ResponseMessage represents incoming message from a client

type Handler

type Handler struct {
	Broker    *broker.Broker
	JwtSecret string

	// Maximum POST body size in bytes for error messages
	MaxErrorCatcherMessageSize int

	ErrorsBlockedByLimit prometheus.Counter
	ErrorsProcessed      prometheus.Counter

	RedisClient           *redis.RedisClient
	AccountsMongoDBClient *accounts.AccountsMongoDBClient

	NonDefaultQueues map[string]bool
}

Handler of error messages

func (*Handler) HandleHTTP

func (handler *Handler) HandleHTTP(ctx *fasthttp.RequestCtx)

HandleHTTP processes HTTP requests with JSON body

func (*Handler) HandleWebsocket

func (handler *Handler) HandleWebsocket(ctx *fasthttp.RequestCtx)

HandleWebsocket handles WebSocket connection

type ResponseMessage

type ResponseMessage struct {
	Code    int    `json:"code"`
	Error   bool   `json:"error"`
	Message string `json:"message"`
}

ResponseMessage represents response message to a client

Jump to

Keyboard shortcuts

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