user

package
v0.0.0-...-c683906 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2018 License: MIT Imports: 10 Imported by: 0

README

User API Documentation

/*
Relative API Path:
  api/user/auth
Request:
  {
    "user": string,
    "pass": string,
  }
Response(204, 400, 401, 405, 500):
  N/A
*/
func Auth(res http.ResponseWriter, req *http.Request) bool {}

/*
Relative API Path:
  api/user/register
Request:
  {
    "user": string,
    "pass": string,
  }
Response (204, 400, 405, 500):
  N/A
*/
func Register(res http.ResponseWriter, req *http.Request) bool {}

/*
Relative API Path:
  api/user/logout
Request:
  N/A
Response (204, 405, 500):
  N/A
*/
func Logout(res http.ResponseWriter, req *http.Request) bool {}

Documentation

Overview

Package user is a child of package api to handle api calls concerning users

Package user is a child of package api to handle api calls concerning users

Package user is a child of package api to handle api calls concerning users

Package user is a child of package api to handle api calls concerning users

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Auth

func Auth(res http.ResponseWriter, req *http.Request, logger *log.Logger, dir string) bool

Auth function is accessed by an API call from the webhost root by accessing /user_auth and sending it a post request with userRequestData struct in JSON format.

func Delete

func Delete(res http.ResponseWriter, req *http.Request, logger *log.Logger, dir string) bool

func GetSecret

func GetSecret(user string, directory string) (string, error)

GetSecret is not accessible from the any client side request. It is only used on the server side to help verify users are who they say they are.

func List

func List(res http.ResponseWriter, req *http.Request, logger *log.Logger, dir string) bool

func Logout

func Logout(res http.ResponseWriter, req *http.Request, logger *log.Logger, dir string) bool

Logout function is accessed by an API call from the webhost root by accessing /user_logout and sending it an empty POST request. This function will delete the user-auth cookie session store

func Register

func Register(res http.ResponseWriter, req *http.Request, logger *log.Logger, dir string) bool

Register function is accessed by an API call from the webhost root by accessing /user_register and sending it a post request with userRequestData struct in JSON format.

func UpdatePassword

func UpdatePassword(res http.ResponseWriter, req *http.Request, logger *log.Logger, dir string) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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