lib

package
v0.0.0-...-6cf74ba Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2015 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAuthToken

func GetAuthToken(id int) string

func GetAuthUser

func GetAuthUser(res http.ResponseWriter, req *http.Request) (http.ResponseWriter, *http.Request, int)

func PostAccount

func PostAccount(email string) error

func PostTransaction

func PostTransaction(email string, amount float32) error

func SignToken

func SignToken(tokData []byte) (string, error)

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

func VerifyToken(tokData []byte) (*jwt.Token, error)

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

func GetAccount(email string) (*Account, error)

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"`
}

func GetJSend

func GetJSend(iri string) (JSend, error)

Parses the standard return format that will contain a status and may contain either contain data or message

type Transaction

type Transaction struct {
	Id        uint32  `json:"id"`
	AccountId string  `json:"accountId"`
	Amount    float64 `json:"amount"`
}

Jump to

Keyboard shortcuts

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