controllers

package
v0.0.0-...-195a7bd Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserKey key = "user"
)

UserKey is a constant context key

Variables

This section is empty.

Functions

func AuthUser

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

AuthUser is the handler function for authorizing user login

func CreateNote

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

CreateNote is the handler function for adding a note to the database

func CreateUser

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

CreateUser is the handler function for adding a new account into the databsse

func DeleteUser

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

DeleteUser is the handler function for removing a user from the database

func DeleteUserNote

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

DeleteUserNote is the handler function for removing a note created by current user from the database

func ExecuteCode

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

ExecuteCode is the handler function for carrying out a token action

func GenerateCode

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

GenerateCode is the handler function for creating a new reset token

func GetNote

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

GetNote is the handler function for getting a note from the database

func GetNotes

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

GetNotes is the handler function for getting all notes from database

func GetUser

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

GetUser is the handler funcion for getting a user fom the database.

func GetUserNotes

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

GetUserNotes is the handler funcion for getting notes created by current user

func Handle

func Handle(e error)

Handle deals with top-level errors

func ToggleUserNote

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

ToggleUserNote is the handler function for togglling visibility for a note created by current user in the database

func UpdatePassword

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

UpdatePassword is the handler function for changing a user's password

func UpdateUser

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

UpdateUser is the handler function for editing a user in the database

func UpdateUserNote

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

UpdateUserNote is the handler function for editing a note created by current user in the database

Types

type Application

type Application struct {
	Router *mux.Router
	DB     *gorm.DB
}

Application is a copy of the app.App struct

var (
	App *Application
)

App is an instance of Application

Jump to

Keyboard shortcuts

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