From 61747119026a8a7dbfa222140c22557f1f5ab4a8 Mon Sep 17 00:00:00 2001 From: Dave Grijalva Date: Sun, 15 Jun 2014 19:39:12 -0700 Subject: [PATCH] updating documentation --- doc.go | 4 ++-- jwt.go | 15 +++++++-------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/doc.go b/doc.go index e973ce0..a86dc1a 100644 --- a/doc.go +++ b/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 -// +// // See README.md for more info. -package jwt \ No newline at end of file +package jwt diff --git a/jwt.go b/jwt.go index 412e668..aa5ce4f 100644 --- a/jwt.go +++ b/jwt.go @@ -22,16 +22,15 @@ type Keyfunc func(*Token) ([]byte, error) // A JWT Token type Token struct { - Raw string - Header map[string]interface{} - Claims map[string]interface{} - Method SigningMethod - // This is only populated when you Parse a token - Signature string - // This is only populated when you Parse/Verify a token - Valid bool + Raw string // The raw token. Populated when you Parse a token + Method SigningMethod // The signing method used or to be used + Header map[string]interface{} // The first segment of the token + Claims map[string]interface{} // The second segment of the token + Signature string // The third segment of the token. Populated when you Parse a token + Valid bool // Is the token valid? Populated when you Parse/Verify a token } +// Create a new Token. Takes a signing method func New(method SigningMethod) *Token { return &Token{ Header: map[string]interface{}{