client

package
v0.0.0-...-9955711 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2014 License: GPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TOKEN_FORM   = "token"
	TOKEN_HEADER = "x-access-token"
	TOKEN_COOKIE = "token"
)

Variables

This section is empty.

Functions

func ParseUser

func ParseUser(r *http.Request) *common.User

Parses part of the token to a User struct

Types

type Token

type Token struct {
	// contains filtered or unexported fields
}

func Auth

func Auth(tokenString string, keyFunc jwt.Keyfunc) *Token

Validates token with the provided KeyFunc.

func AuthByRequest

func AuthByRequest(r *http.Request, key string) *Token

*

  • Looks for query param 'token', header 'x-access-token' and cookie 'token'
  • in that order

func AuthWithKey

func AuthWithKey(token string, key string) *Token

Validates token with the provided key.

func (*Token) Get

func (token *Token) Get(key string) string

Gets the value of the claim key

Jump to

Keyboard shortcuts

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