bearer

package
v0.0.0-...-b147475 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2017 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithToken

func WithToken(expectedToken string, handler router.Handle) router.Handle

WithToken checks if token from request suits the given token.

Example
package main

import (
	"github.com/openprovider/handlers/bearer"
	"github.com/takama/router"
)

func main() {
	r := router.New()

	token := "s-fdF8-mF_9.B-4.1Cfd"
	h := func(ctx *router.Control) {}

	r.GET("/test", bearer.WithToken(token, h))
	r.Listen(":3000")
}
Output:

Types

This section is empty.

Jump to

Keyboard shortcuts

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