controller

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2022 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// HeaderContentType is the Content-Type header key.
	HeaderContentType = "Content-Type"
	// ContentTypeJSON is the application/json MIME type.
	ContentTypeJSON = "application/json"
)

Variables

View Source
var (
	ErrRandNumNotFound = errors.New("timeout - random number not found")
)

Functions

func LimitHandler added in v0.0.7

func LimitHandler(handler httprouter.Handle, lmt *limiter.Limiter) httprouter.Handle

func NewServer

func NewServer(handler http.Handler, port int) *http_no.Server

func SendNotifs added in v0.0.7

func SendNotifs(nc *nats.Conn, rdb *redis.Client) httprouter.Handle

func SendRandNum

func SendRandNum(nc *nats.Conn) httprouter.Handle

func SendTestRandNum

func SendTestRandNum(nc *nats.Conn) httprouter.Handle

func SetVerbosity added in v0.0.7

func SetVerbosity() httprouter.Handle

SetVerbosity allows the user to remotely modify the verbosity of all log messages Expects a "v" parameter in the query string of a PUT request:

curl -X PUT http://host:port/api/v1/verbosity?v=debug

options are:

debug
info
warn
error

func Verbosity added in v0.0.7

func Verbosity() httprouter.Handle

Types

type Router

type Router struct {
	http.Handler
	// contains filtered or unexported fields
}

func NewRouter

func NewRouter(nats *nats.Conn, rdb *redis.Client, serviceProvider string) *Router

func (*Router) Ready

func (r *Router) Ready()

Jump to

Keyboard shortcuts

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