api

package
v0.0.0-...-35a2a4f Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	Router *mux.Router
	DB     *sql.DB
}

Server struct holds the backend API struct info

func (*Server) CreateUser

func (a *Server) CreateUser(w http.ResponseWriter, r *http.Request)

CreateUser creates a new user

func (*Server) DeleteUser

func (a *Server) DeleteUser(w http.ResponseWriter, r *http.Request)

DeleteUser deletes a user

func (*Server) Initialize

func (a *Server) Initialize(host string, port int32, user string, pw string, dbname string)

Initialize starts up the API connection

func (*Server) InitializeRoutes

func (a *Server) InitializeRoutes() error

InitializeRoutes sets & calls handlers

func (*Server) ListUsers

func (a *Server) ListUsers(w http.ResponseWriter, r *http.Request)

ListUsers retrieves all users

func (*Server) LoginUser

func (a *Server) LoginUser(w http.ResponseWriter, r *http.Request)

LoginUser logs in a user

func (*Server) LogoutUser

func (a *Server) LogoutUser(w http.ResponseWriter, r *http.Request)

LogoutUser logs out a user

func (*Server) RetrieveUser

func (a *Server) RetrieveUser(w http.ResponseWriter, r *http.Request)

RetrieveUser retrieves a specific user

func (*Server) Run

func (a *Server) Run(addr string)

Run exposes backend on port 8000

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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