middlewares

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 11, 2018 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

* Cryptexly - Copyleft of Xavier D. Johnson. * me at xavierdjohnson dot com * http://www.xavierdjohnson.net/ * * See LICENSE.

* Cryptexly - Copyleft of Xavier D. Johnson. * me at xavierdjohnson dot com * http://www.xavierdjohnson.net/ * * See LICENSE.

* Cryptexly - Copyleft of Xavier D. Johnson. * me at xavierdjohnson dot com * http://www.xavierdjohnson.net/ * * See LICENSE.

Index

Constants

This section is empty.

Variables

View Source
var IndexFile = ""

Functions

func AuthHandler

func AuthHandler() gin.HandlerFunc

func GenerateToken

func GenerateToken(k []byte, userId string) (string, error)

func Security

func Security(tlsFingerprint string) gin.HandlerFunc

func Serve

func Serve(url string, fs ServeFileSystem) gin.HandlerFunc

Static returns a middleware handler that serves static files in the given directory.

func ServeStatic

func ServeStatic(url, root, index string) gin.HandlerFunc

func Static

func Static(root, index string) *localFileSystem

func ValidateToken

func ValidateToken(t string, k string) (*jwt.Token, error)

Types

type ServeFileSystem

type ServeFileSystem interface {
	http.FileSystem
	Exists(prefix string, path string) bool
}

Jump to

Keyboard shortcuts

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