http

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLogHandler

func NewLogHandler(context *app.Context)

Types

type LogBatchRequest

type LogBatchRequest struct {
	Stream string              `json:"stream" validate:"required"`
	Logs   []LogBatchSingleLog `json:"logs" validate:"required"`
}

type LogBatchSingleLog

type LogBatchSingleLog struct {
	Timestamp int    `json:"timestamp"`
	Log       string `json:"log"`
}

type LogHttpHandler

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

func (*LogHttpHandler) Log

func (h *LogHttpHandler) Log(c *fiber.Ctx) error

Log godoc @ID log @Router /log [post] @Tags log @Description add a new log on a logstream @Summary push a log @Accept json @Param Payload body LogRequest true "send a log" @Produce json @Success 200 {object} http_common.SuccessResponse @Failure 404 {object} http_common.ErrorResponse @Failure 422 {object} http_common.ErrorResponse @Failure 500 {object} http_common.ErrorResponse

func (*LogHttpHandler) LogBatch

func (h *LogHttpHandler) LogBatch(c *fiber.Ctx) error

LogBatch godoc @ID batch @Router /batch [post] @Tags log @Description add a bunch of logs at once to a stream @Summary push multiple logs at once @Accept json @Param Payload body LogBatchRequest true "batch some logs" @Produce json @Success 200 {object} http_common.SuccessResponse @Failure 404 {object} http_common.ErrorResponse @Failure 422 {object} http_common.ErrorResponse @Failure 500 {object} http_common.ErrorResponse

type LogRequest

type LogRequest struct {
	Stream    string `json:"stream" validate:"required"`
	Log       string `json:"log"`
	Timestamp int    `json:"timestamp"`
}

Jump to

Keyboard shortcuts

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