handlers

package
v0.0.0-...-86d81c4 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddUser

func AddUser(w http.ResponseWriter, r *http.Request)

AddUser add a new user to database

func Connect

func Connect() redis.Conn

Connect returns redis connection

func DeleteUserByID

func DeleteUserByID(w http.ResponseWriter, r *http.Request)

DeleteUserByID deletes a user by id

func GetUserByID

func GetUserByID(w http.ResponseWriter, r *http.Request)

GetUserByID returns a user from mongo

func GetUsers

func GetUsers(w http.ResponseWriter, r *http.Request)

GetUsers returns json payload with users

func UsersIndex

func UsersIndex(w http.ResponseWriter, r *http.Request)

UsersIndex returns index page with users

Types

type User

type User struct {
	ID        int    `json:"id"`
	FirstName string `json:"first_name"`
	LastName  string `json:"last_name"`
	Email     string `json:"email"`
	Gender    string `json:"gender"`
}

User Struct is the model for the app

Jump to

Keyboard shortcuts

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