Documentation
¶
Index ¶
- func GetAuthToken(id int) string
- func GetAuthUser(res http.ResponseWriter, req *http.Request) (http.ResponseWriter, *http.Request, int)
- func PostAccount(email string) error
- func PostTransaction(email string, amount float32) error
- func SignToken(tokData []byte) (string, error)
- func VerifyToken(tokData []byte) (*jwt.Token, error)
- type Account
- type JSend
- type Transaction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAuthToken ¶
func GetAuthUser ¶
func GetAuthUser(res http.ResponseWriter, req *http.Request) (http.ResponseWriter, *http.Request, int)
func PostAccount ¶
func PostTransaction ¶
func SignToken ¶
Create, sign, and output a token. This is a great, simple example of how to use this library to create and sign a token.
func VerifyToken ¶
Verify a token and output the claims. This is a great example of how to verify and view a token.
Types ¶
type Account ¶
type Account struct { Id string `json:"id"` Email string `json:"email"` AccountLimit string `json:"accountLimit"` AccountBalance string `json:"accountBalance"` }
func GetAccount ¶
Parses the standard return format that may or may not contain a data or message
type JSend ¶
type JSend struct { Status string `json:"status"` Message string `json:"message"` Data json.RawMessage `json:"data"` }
type Transaction ¶
Click to show internal directories.
Click to hide internal directories.