gomiddleware

package module
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2021 License: MIT Imports: 3 Imported by: 1

README

MrAndreID / Go Middleware

Go Reference

The MrAndreID/GoMiddleware package is a collection of functions in the go language.


Table of Contents


Install

To use The MrAndreID/GoMiddleware package, you must follow the steps below:

go get -u github.com/MrAndreID/gomiddleware

Usage

To use The MrAndreID/GoMiddleware package, you must combine it with The gorilla/mux package.

Log
router := mux.NewRouter().StrictSlash(true)

router.Handle("/api/v1/", gomiddleware.Log(Documentation)).Methods("GET")
Acceptable
router := mux.NewRouter().StrictSlash(true)

router.Handle("/api/v1/", gomiddleware.Acceptable(Documentation)).Methods("POST")
Client ID
router := mux.NewRouter().StrictSlash(true)

router.Handle("/api/v1/", gomiddleware.ClientID(Documentation)).Methods("POST")
Timestamp
router := mux.NewRouter().StrictSlash(true)

router.Handle("/api/v1/", gomiddleware.Timestamp(Documentation)).Methods("POST")
App ID
router := mux.NewRouter().StrictSlash(true)

router.Handle("/api/v1/", gomiddleware.AppID(Documentation)).Methods("POST")
Private Key
router := mux.NewRouter().StrictSlash(true)

router.Handle("/api/v1/", gomiddleware.PrivateKey(Documentation)).Methods("POST")

Versioning

I use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

Andrea Adam - MrAndreID

License

MIT licensed. See the LICENSE file for details.

Official Documentation for Go Language

Documentation for Go Language can be found on the Go Language website.

More

Documentation can be found on https://go.dev/.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Acceptable added in v1.1.0

func Acceptable(next http.HandlerFunc) http.HandlerFunc

func AppID added in v1.1.0

func AppID(next http.HandlerFunc) http.HandlerFunc

func ClientID added in v1.1.0

func ClientID(next http.HandlerFunc) http.HandlerFunc

func Log

func Log(next http.HandlerFunc) http.HandlerFunc

func PrivateKey added in v1.2.0

func PrivateKey(next http.HandlerFunc) http.HandlerFunc

func Timestamp added in v1.1.0

func Timestamp(next http.HandlerFunc) http.HandlerFunc

Types

This section is empty.

Jump to

Keyboard shortcuts

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