handler

package
v0.0.0-...-63bdbfa Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package handler implements handlers for HTTP routes

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	DB     *db.DBConnection
	Mailer *m.Mailer
}

Handler object contains handler configuration

func (*Handler) Blacklisted

func (h *Handler) Blacklisted(w http.ResponseWriter, r *http.Request)

Blacklisted handler for blacklisting a client It will skip localhost IPv4 and IPv6 addresses, and perform the following operations - Add db record about blacklisted IP - Send an email about blacklisted IP

func (*Handler) Healthz

func (h *Handler) Healthz(w http.ResponseWriter, r *http.Request)

Healthz handler for Healthcheck endpoint This check should have some logic to check if the application is healthy

func (*Handler) Square

func (h *Handler) Square(w http.ResponseWriter, r *http.Request)

Square handler for calculating square of n parameter It relies on the 'n' query parameter and returns n*n

Jump to

Keyboard shortcuts

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