jwt

package
v0.0.0-...-1a196e1 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2017 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parser

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

Parser 呈現了一個解析者。

func NewParser

func NewParser(secret string) *Parser

NewParser 會建立並回傳一個新的解析器。

func (*Parser) Parse

func (p *Parser) Parse(token string, context interface{}) error

Parse 會解析接收到的 JSON Web Token,並將其資料帶入到傳入的建構體中。

type Signer

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

Signer 呈現了一個簽署者。

func NewSigner

func NewSigner(secret string, method jwt.SigningMethod) *Signer

NewSigner 會建立並回傳一個新的簽署者,並以此來簽發之後的 JSON Web Token。

func (*Signer) Sign

func (s *Signer) Sign(claims jwt.Claims) (token string, err error)

Sign 會簽發一個接收到的內容,並回傳 JSON Web Token 格式。

func (*Signer) SignWithStruct

func (s *Signer) SignWithStruct(context interface{}) (token string, err error)

SignWithStruct 會簽發一個接收到的建構體,並回傳 JSON Web Token 格式。

Jump to

Keyboard shortcuts

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