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 NewLogStreamHandler

func NewLogStreamHandler(context *app.Context)

Types

type LogStreamHttpHandler

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

func (*LogStreamHttpHandler) GetStream

func (h *LogStreamHttpHandler) GetStream(c *fiber.Ctx) error

Get Stream godoc @ID get-stream @Router /streams/{id} [get] @Tags logstream @Description get info about a logstream @Summary fetch a stream @Produce json @Success 200 {object} LogStreamResponse @Success 400 {object} http_common.ErrorResponse @Success 404 {object} http_common.ErrorResponse @Failure 500 {object} http_common.ErrorResponse

func (*LogStreamHttpHandler) ListStreams

func (h *LogStreamHttpHandler) ListStreams(c *fiber.Ctx) error

List Streams godoc @ID list-stream @Router /streams [get] @Tags logstream @Description get all available logstreams on the server @Summary list all streams @Produce json @Success 200 {object} LogStreamsResponse @Failure 500 {object} http_common.ErrorResponse

func (*LogStreamHttpHandler) RegisterStream

func (h *LogStreamHttpHandler) RegisterStream(c *fiber.Ctx) error

Register Streams godoc @ID register-stream @Router /stream/register [post] @Tags logstream @Description create a new logstream on the server so that client can subscribe to it @Summary register a logstream @Accept json @Param Payload body RegisterRequest true "information about the logstream to create" @Produce json @Success 200 {object} LogStreamWithSecretResponse @Failure 409 {object} http_common.ErrorResponse @Failure 422 {object} http_common.ErrorResponse @Failure 500 {object} http_common.ErrorResponse

func (*LogStreamHttpHandler) UnregisterStream

func (h *LogStreamHttpHandler) UnregisterStream(c *fiber.Ctx) error

Unregister Streams godoc @ID unregister-stream @Router /stream/unregister [post] @Tags logstream @Description delete a logstream an close all open connection to it @Summary unregister a logstream @Accept json @Param Payload body UnregisterRequest true "information about the logstream to unregister" @Produce json @Success 200 {object} http_common.SuccessResponse @Failure 403 {object} http_common.ErrorResponse @Failure 404 {object} http_common.ErrorResponse @Failure 422 {object} http_common.ErrorResponse @Failure 500 {object} http_common.ErrorResponse

type LogStreamResponse

type LogStreamResponse struct {
	ID    string `json:"id"`
	Alias string `json:"alias"`
}

type LogStreamWithSecretResponse

type LogStreamWithSecretResponse struct {
	ID        string `json:"id"`
	Alias     string `json:"alias"`
	SecretKey string `json:"key"`
}

type LogStreamsResponse

type LogStreamsResponse struct {
	Streams []LogStreamResponse `json:"streams"`
}

type RegisterRequest

type RegisterRequest struct {
	Alias string `json:"alias" validate:"required"`
	ID    string `json:"id"`
	Key   string `json:"key"`
}

type UnregisterRequest

type UnregisterRequest struct {
	ID        string `json:"id" validate:"required"`
	SecretKey string `json:"key" validate:"required"`
}

Jump to

Keyboard shortcuts

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