Skip to content
/ GFr13 Public

Golang Gin Friday 13th Middleware HandlerFunc

License

Notifications You must be signed in to change notification settings

cpl/GFr13

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GFr13

What

This package is a middleware/HandlerFunc for Gin that will abort any and all requests on Friday 13th with the following response:

{
  "code": 513,
  "error": "server too spooked, today is Friday 13th"
}

Why

Today, people are all about "high availability", but what if your web server is superstitious? Maybe you don't want to risk a catastrophe on Friday 13th. Well, if you ever had this problem, now you have a solution.

No, but really, this package is a joke, don't use in any production environment.

How

The package is simple to use. First you need to get it:

go get cpl.li/go/gfr13

Now you can use it in your web project:

package main

import (
	"log"
	
	"cpl.li/go/gfr13"
	"github.com/gin-gonic/gin"
)

func main() {
	server := gin.Default()
	
	// if nil is used for Opts, then gfr13.DefaultOpts are used
	server.Use(gfr13.Handler(nil))
	
	if err := server.Run(":8099"); err != nil {
		log.Fatal(err)
	}
}

Releases

No releases published

Packages

No packages published

Languages