Encode returns a base64 encoded version of the JSON representation of token.
()
| 36 | |
| 37 | // Encode returns a base64 encoded version of the JSON representation of token. |
| 38 | func (t *Token) Encode() (string, error) { |
| 39 | barr, err := json.Marshal(t) |
| 40 | if err != nil { |
| 41 | return "", err |
| 42 | } |
| 43 | s := base64.StdEncoding.EncodeToString(barr) |
| 44 | return s, nil |
| 45 | } |
| 46 | |
| 47 | // Decode updates the internals of Token using the passed in base64 |
| 48 | // encoded version of the JSON representation of token. |
no test coverage detected