Skip to content

MrAndreID/gomiddleware

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MrAndreID / Go Middleware

Go Reference License: MIT

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

Table of Contents

Installation

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 or The Echo Framework.

Log for Gorilla Mux

import (
    "github.com/MrAndreID/gomiddleware"
)

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

router.Handle("/api/v1/", gomiddleware.Log(Documentation)).Methods("GET")

Acceptable for Gorilla Mux

import (
    "github.com/MrAndreID/gomiddleware"
)

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

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

Client ID for Gorilla Mux

import (
    "github.com/MrAndreID/gomiddleware"
)

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

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

Timestamp for Gorilla Mux

import (
    "github.com/MrAndreID/gomiddleware"
)

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

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

App ID for Gorilla Mux

import (
    "github.com/MrAndreID/gomiddleware"
)

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

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

Private Key for Gorilla Mux

import (
    "github.com/MrAndreID/gomiddleware"
)

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

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

Content Type for Gorilla Mux

import (
    "github.com/MrAndreID/gomiddleware"
)

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

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

Set Request ID for Echo Framework

import (
    "github.com/MrAndreID/gomiddleware"
)

e := echo.New()

e.Pre(gomiddleware.EchoSetRequestID)

Set No Cache for Echo Framework

import (
    "github.com/MrAndreID/gomiddleware"
)

e := echo.New()

e.Use(gomiddleware.EchoSetNoCache)

Set Route List for Echo Framework

import (
    "github.com/MrAndreID/gomiddleware"
)

e := echo.New()

e.Use(gomiddleware.EchoSetRouteList)

Versioning

I use Semantic Versioning. For the versions available, see the tags on this repository.

Authors

Andrea Adam - MrAndreID

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Please make sure to update tests as appropriate.

Official Documentation for Go Language

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

License

The MrAndreID/GoMiddleware is released under the MIT License. See the LICENSE file for more information.

More

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

About

A collection of functions in go language for middleware.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages