api

package
v0.0.0-...-7361872 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2022 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Router         = mux.NewRouter()
	DefaultAddress = ":8080"
)
View Source
var CurrentTraefikConfiguration *dynamic.Configuration
View Source
var Logger = log.StandardLogger()

Functions

func Error

func Error(w http.ResponseWriter, r *http.Request, err error, code int)

func HTTPLogError

func HTTPLogError(r *http.Request, err error)

func HTTPLogFields

func HTTPLogFields(r *http.Request) (fields log.Fields)

func HTTPLogRequest

func HTTPLogRequest(_ http.ResponseWriter, r *http.Request)

func HTTPLogging

func HTTPLogging() func(http.Handler) http.Handler

func HandleHome

func HandleHome(w http.ResponseWriter, _ *http.Request)

func HandleTraefik

func HandleTraefik(w http.ResponseWriter, r *http.Request)

func NotFound

func NotFound(w http.ResponseWriter, r *http.Request)

func RespondWithJSON

func RespondWithJSON(w http.ResponseWriter, data interface{}, code int)

Types

type ErrorResponse

type ErrorResponse struct {
	Error string `json:"error"`
}

type MessageResponse

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

type Server

type Server struct {
	CollectionPath string
	Server         *http.Server
}

func NewServer

func NewServer() (s *Server, err error)

func (*Server) ListenAndServe

func (s *Server) ListenAndServe() error

Jump to

Keyboard shortcuts

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