api

package
v0.0.0-...-e1e0af0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateBin

func CreateBin(conf *config.App, rd *redis.Client) func(c echo.Context) error

CreateBin @Summary Create bin @Accept json @Header 201 {string} Location "uuid" @Failure 500 {object} echo.HTTPError @Router /bins [post]

func CreateRequest

func CreateRequest(conf *config.App, rd *redis.Client) func(c echo.Context) error

CreateRequest @Summary Create request - EXAMPLE!!! - Swagger does not allowed multiple http method. @Description Route accept all of http methods. Swagger does not allowed multiple http method. @Success 200 {string} string "ok" @Param uuid path string true "uuid" @Param body body string false "body" @Param hello formData string false "world" @Param hello header string false "world" @Param hello query string false "world" @Failure 400 {object} echo.HTTPError @Failure 404 {object} echo.HTTPError @Failure 500 {object} echo.HTTPError @Router /r/{uuid} [post]

func Home

func Home(c echo.Context) error

Home @Summary Welcome page @Accept plain @Success 200 {string} string "" @Router / [get]

func ListBin

func ListBin(rd *redis.Client) func(c echo.Context) error

ListBin @Summary List of created bin @Produce json @Success 200 {object} []Bin @Failure 404 {object} echo.HTTPError @Failure 500 {object} echo.HTTPError @Router /bins [get]

func ListRequest

func ListRequest(rd *redis.Client) func(c echo.Context) error

ListRequest @Summary List of created request @Accept json @Produce json @Success 200 {object} []Request @Param uuid path string true "uuid" @Failure 400 {object} echo.HTTPError @Failure 404 {object} echo.HTTPError @Failure 500 {object} echo.HTTPError @Router /l/{uuid} [get]

Types

type Bin

type Bin struct {
	Key       string    `json:"key"`
	CreatedAt time.Time `json:"created_at"`
}

type Request

type Request struct {
	Method      string            `json:"method"`
	Host        string            `json:"host"`
	UserAgent   string            `json:"user_agent"`
	Ip          string            `json:"ip"`
	Uri         string            `json:"uri"`
	ContentType string            `json:"content_type"`
	Headers     map[string]string `json:"headers"`
	Cookies     map[string]string `json:"cookies"`
	Body        string            `json:"body"`
	CreatedAt   time.Time         `json:"created_at"`
}

Jump to

Keyboard shortcuts

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