handler

package
v0.0.0-...-31c1c1e Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Null

func Null(c echo.Context) error

Null is a handler that always returns NoContent

Types

type DiskFSHandler

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

The DiskFSHandler type provides handlers for manipulating a filesystem

func NewDiskFS

func NewDiskFS(fs fs.Filesystem, cache cache.Cacher) *DiskFSHandler

NewDiskFS return a new DiskFS type. You have to provide a filesystem to act on and optionally a Cacher where files will be purged from if the Cacher is related to the filesystem.

func (*DiskFSHandler) GetFile

func (h *DiskFSHandler) GetFile(c echo.Context) error

GetFile returns the file at the given path @Summary Fetch a file from the filesystem @Description Fetch a file from the filesystem. If the file is a directory, a index.html is returned, if it exists. @ID diskfs-get-file @Produce application/data @Produce json @Param path path string true "Path to file" @Success 200 {file} byte @Success 301 {string} string @Failure 404 {object} api.Error @Router /{path} [get]

type MemFSHandler

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

The MemFSHandler type provides handlers for manipulating a filesystem

func NewMemFS

func NewMemFS(fs fs.Filesystem) *MemFSHandler

NewMemFS return a new MemFS type. You have to provide a filesystem to act on.

func (*MemFSHandler) DeleteFile

func (h *MemFSHandler) DeleteFile(c echo.Context) error

DeleteFile removes a file from the filesystem @Summary Remove a file from the memory filesystem @Description Remove a file from the memory filesystem @ID memfs-delete-file @Produce text/plain @Param path path string true "Path to file" @Success 200 {string} string @Failure 404 {object} api.Error @Security BasicAuth @Router /memfs/{path} [delete]

func (*MemFSHandler) GetFile

func (h *MemFSHandler) GetFile(c echo.Context) error

GetFile returns the file at the given path @Summary Fetch a file from the memory filesystem @Description Fetch a file from the memory filesystem @ID memfs-get-file @Produce application/data @Produce json @Param path path string true "Path to file" @Success 200 {file} byte @Success 301 {string} string @Failure 404 {object} api.Error @Router /memfs/{path} [get]

func (*MemFSHandler) PutFile

func (h *MemFSHandler) PutFile(c echo.Context) error

PutFile adds or overwrites a file at the given path @Summary Add a file to the memory filesystem @Description Writes or overwrites a file on the memory filesystem @ID memfs-put-file @Accept application/data @Produce text/plain @Produce json @Param path path string true "Path to file" @Param data body []byte true "File data" @Success 201 {string} string @Success 204 {string} string @Failure 507 {object} api.Error @Security BasicAuth @Router /memfs/{path} [put]

type PingHandler

type PingHandler struct{}

The PingHandler type provides a handler for a ping requesr

func NewPing

func NewPing() *PingHandler

NewPing returns a neww Ping type.

func (*PingHandler) Ping

func (p *PingHandler) Ping(c echo.Context) error

Ping returns pong @Summary Liveliness check @Description Liveliness check @ID ping @Produce text/plain @Success 200 {string} string "pong" @Router /ping [get]

type ProfilingHandler

type ProfilingHandler struct{}

The ProfilingHandler type provides a function to register the porfiling endpoints

func NewProfiling

func NewProfiling() *ProfilingHandler

NewProfiling returns a new Profiling type

func (*ProfilingHandler) Register

func (p *ProfilingHandler) Register(r *echo.Group)

Register registers the different golang profiling endpoinds with a router @Summary Retrieve profiling data from the application @Description Retrieve profiling data from the application @ID profiling @Produce text/html @Success 200 {string} string @Failure 404 {string} string @Router /profiling [get]

type PrometheusHandler

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

The PrometheusHandler type provides a handler function for reading the prometheus metrics

func NewPrometheus

func NewPrometheus(handler http.Handler) *PrometheusHandler

NewPrometheus returns a new Prometheus type. You have to provide a HTTP.Handler

func (*PrometheusHandler) Metrics

func (m *PrometheusHandler) Metrics(c echo.Context) error

Metrics godoc @Summary Prometheus metrics @Description Prometheus metrics @ID metrics @Produce text/plain @Success 200 {string} string @Router /metrics [get]

Directories

Path Synopsis
Package api implements various handlers for the API routes
Package api implements various handlers for the API routes

Jump to

Keyboard shortcuts

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