handlers

package
v4.5.6 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FuncGetLogLevel

func FuncGetLogLevel()

FuncGetLogLevel godoc (only for swagger doc) @Summary Get Log Level @Description Get current logging level @Tags Logs @Produce json @Security Bearer @Success 200 "Status OK" @Failure 400 "Status Bad Request" @Router /log_level [get]

func FuncLogin

func FuncLogin()

FuncLogin godoc (only for swagger doc) @Summary Login @Description Authenticate using basic auth @Description Example : @Description <pre>{"login":"myuser","password":"mypassword"}</pre> @Tags Security @Produce json @Param job body interface{} true "Credentials (json)" @Success 200 "Status OK" @Failure 400 "Status Bad Request" @Router /login [post]

func FuncSetLogLevel

func FuncSetLogLevel()

FuncSetLogLevel godoc (only for swagger doc) @Summary Set Log Level @Description Set logging level @Description Example : @Description <pre>{"level":"info"}</pre> @Tags Logs @Consumme json @Produce json @Param level body interface{} true "Level (json)" @Security Bearer @Success 200 "Status OK" @Failure 400 "Status Bad Request" @Router /log_level [put]

func IsAlive

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

IsAlive godoc @Summary Check if alive @Description allows to check if the API is alive @Tags System @Success 200 "Status OK" @Router /isalive [get]

func NotImplemented

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

NotImplemented returns a basic message "Not Implemented" when called, and should be use a filler for future handler

func ParseDuration

func ParseDuration(dStr string) (time.Duration, error)

ParseDuration try to parse a string as an int or returns 0

func ParseInt

func ParseInt(tStr string) (int, error)

ParseInt try to parse a string as an int or returns 0

func ParseTime

func ParseTime(tStr string) (time.Time, error)

ParseTime try to parse a supposed time string as a time.Time or returns time.Now()

func QueryParamToOptionnalBool

func QueryParamToOptionnalBool(r *http.Request, name string, orDefault bool) (bool, error)

func QueryParamToOptionnalDuration

func QueryParamToOptionnalDuration(r *http.Request, name string, orDefault time.Duration) (time.Duration, error)

func QueryParamToOptionnalInt64

func QueryParamToOptionnalInt64(r *http.Request, name string, orDefault int64) (int64, error)

func QueryParamToOptionnalKeyValues

func QueryParamToOptionnalKeyValues(r *http.Request, name string, orDefault map[string]string) (map[string]string, error)

QueryParamToOptionnalKeyValues parse multiple key:value entries separated by commas from a string

func QueryParamToOptionnalTime

func QueryParamToOptionnalTime(r *http.Request, name string, orDefault time.Time) (time.Time, error)

func QueryParamToTime

func QueryParamToTime(r *http.Request, name string) (time.Time, error)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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