handlers

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RFC5424PassThroughFormatter

func RFC5424PassThroughFormatter(p syslog.Priority, hostname, tag, content string) string

func VersionHandler

func VersionHandler(version string) echo.HandlerFunc

Types

type HealthHandler

type HealthHandler struct {
}

func (HealthHandler) Handler

func (h HealthHandler) Handler(ctx context.Context, tracer trace.Tracer) echo.HandlerFunc

type LogData added in v0.4.2

type LogData struct {
	Message string `json:"message"`
}

type LogEvent added in v0.4.2

type LogEvent struct {
	LogData             LogData   `json:"logData"`
	ApplicationName     string    `json:"applicationName"`
	ServiceName         string    `json:"serviceName"`
	EventId             string    `json:"eventId"`
	ServerName          string    `json:"serverName"`
	OriginatingUser     string    `json:"originatingUser"`
	Id                  string    `json:"id"`
	LogTime             time.Time `json:"logTime"`
	TransactionId       string    `json:"transactionId"`
	ApplicationVersion  string    `json:"applicationVersion"`
	ProductName         string    `json:"productName"`
	Category            string    `json:"category"`
	ApplicationInstance string    `json:"applicationInstance"`
	Severity            string    `json:"severity"`
	Component           string    `json:"component"`
	ResourceType        string    `json:"resourceType"`
}

type RabbitMQHandler

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

func NewRabbitMQHandler

func NewRabbitMQHandler(promtailAddr string) (*RabbitMQHandler, error)

func (*RabbitMQHandler) CreateWorker

func (h *RabbitMQHandler) CreateWorker(exchange, exchangeType, routingKey, queueName, consumerTag string) (chan bool, error)

func (*RabbitMQHandler) RabbitMQRFC5424Worker

func (h *RabbitMQHandler) RabbitMQRFC5424Worker(doneChannel <-chan bool) rabbitmq.ConsumerHandlerFunc

type RabbitMQMessage added in v0.4.2

type RabbitMQMessage struct {
	Syslog5424Sd string    `json:"syslog5424_sd,omitempty"`
	Type         string    `json:"type"`
	LogEvent     LogEvent  `json:"LogEvent"`
	Timestamp    time.Time `json:"@timestamp,omitempty"`
	Tags         []string  `json:"tags,omitempty"`
	Version      string    `json:"@version,omitempty"`
}

type SyslogHandler

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

func NewSyslogHandler

func NewSyslogHandler(token, promtailAddr string) (*SyslogHandler, error)

func (*SyslogHandler) Handler

func (h *SyslogHandler) Handler(ctx context.Context, tracer trace.Tracer) echo.HandlerFunc

Jump to

Keyboard shortcuts

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