Documentation
¶
Index ¶
- func GenerateHandler(m *Manager, tokenPassword string) func(w http.ResponseWriter, r *http.Request)
- func InspectHandler(m *Manager) func(w http.ResponseWriter, r *http.Request)
- func ValidatedHandler(m *Manager, ...) func(w http.ResponseWriter, r *http.Request)
- type Generator
- type Manager
- type TokenReply
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateHandler ¶ added in v1.4.0
GenerateHandler will return a http handler to generate tokens.
func InspectHandler ¶ added in v1.4.0
func InspectHandler(m *Manager) func(w http.ResponseWriter, r *http.Request)
InspectHandler handles requests to see remaining credits for a token.
func ValidatedHandler ¶
func ValidatedHandler(m *Manager, handler func(w http.ResponseWriter, r *http.Request, token *jwt.Token)) func(w http.ResponseWriter, r *http.Request)
ValidatedHandler will return a http handler which validates a request prior to invoking the given handler.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager validates and generates new tokens
func NewManager ¶
type TokenReply ¶ added in v1.4.0
type TokenReply struct { Token string `json:"token"` Email string `json:"email"` Credits int `json:"credits"` }
Token is used to create a JSON object.
Click to show internal directories.
Click to hide internal directories.