Documentation

Overview

    Package user contains the basic admin user creation and authentication code, specific to Ponzu systems.

    Index

    Constants

    This section is empty.

    Variables

    This section is empty.

    Functions

    func Auth

    func Auth(next http.HandlerFunc) http.HandlerFunc

      Auth is HTTP middleware to ensure the request has proper token credentials

      func IsUser

      func IsUser(usr *User, password string) bool

        IsUser checks for consistency in email/pass combination

        func IsValid

        func IsValid(req *http.Request) bool

          IsValid checks if the user request is authenticated

          Types

          type User

          type User struct {
          	ID    int    `json:"id"`
          	Email string `json:"email"`
          	Hash  string `json:"hash"`
          	Salt  string `json:"salt"`
          }

            User defines a admin user in the system

            func New

            func New(email, password string) (*User, error)

              New creates a user

              Source Files