mirror of https://github.com/golang-jwt/jwt.git
updating documentation
This commit is contained in:
parent
2c907dbb70
commit
6174711902
4
doc.go
4
doc.go
|
@ -1,4 +1,4 @@
|
||||||
// Package jwt is a Go implementation of JSON Web Tokens: http://self-issued.info/docs/draft-jones-json-web-token.html
|
// Package jwt is a Go implementation of JSON Web Tokens: http://self-issued.info/docs/draft-jones-json-web-token.html
|
||||||
//
|
//
|
||||||
// See README.md for more info.
|
// See README.md for more info.
|
||||||
package jwt
|
package jwt
|
||||||
|
|
15
jwt.go
15
jwt.go
|
@ -22,16 +22,15 @@ type Keyfunc func(*Token) ([]byte, error)
|
||||||
|
|
||||||
// A JWT Token
|
// A JWT Token
|
||||||
type Token struct {
|
type Token struct {
|
||||||
Raw string
|
Raw string // The raw token. Populated when you Parse a token
|
||||||
Header map[string]interface{}
|
Method SigningMethod // The signing method used or to be used
|
||||||
Claims map[string]interface{}
|
Header map[string]interface{} // The first segment of the token
|
||||||
Method SigningMethod
|
Claims map[string]interface{} // The second segment of the token
|
||||||
// This is only populated when you Parse a token
|
Signature string // The third segment of the token. Populated when you Parse a token
|
||||||
Signature string
|
Valid bool // Is the token valid? Populated when you Parse/Verify a token
|
||||||
// This is only populated when you Parse/Verify a token
|
|
||||||
Valid bool
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Create a new Token. Takes a signing method
|
||||||
func New(method SigningMethod) *Token {
|
func New(method SigningMethod) *Token {
|
||||||
return &Token{
|
return &Token{
|
||||||
Header: map[string]interface{}{
|
Header: map[string]interface{}{
|
||||||
|
|
Loading…
Reference in New Issue