controller

package
v0.0.0-...-01c4b15 Latest Latest
Warning

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

Go to latest
Published: May 9, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSONResponse

func JSONResponse(w http.ResponseWriter, code int, response interface{})

JSONResponse writter

Types

type Controller

type Controller interface {
	Healthz(w http.ResponseWriter, r *http.Request)
	Statusz(w http.ResponseWriter, r *http.Request)

	CreateLog(w http.ResponseWriter, r *http.Request)
	UpdateLog(w http.ResponseWriter, r *http.Request)
}

Controller handles the HTTP requests

func New

func New(
	c string,
	v string,
	r counter.Repository,
	s counter.Storage,
) Controller

New returns a controller

type Response

type Response struct {
	Message string `json:"message"`
	Status  int    `json:"status"`
}

Response struct

Jump to

Keyboard shortcuts

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