user

package
v0.0.0-...-61dd45f Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

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

Create creates a new user

func Delete

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

Delete removes a user by id

func FirstUser

func FirstUser()

FirstUser is called from main.go and is used to create an admin user on first run.

func Index

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

Index displays all users

func Route

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

Route is used to route methods for individual user actions

func Show

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

Show shows all users

func Update

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

Update updates one user record by id

func UserAuth

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

UserAuth checks a users creds

Types

type APIToken

type APIToken struct {
	APIToken string
}

APIToken is used to generate an API JSON message

type JSONTOKEN

type JSONTOKEN struct {
	Token string
}

JSONTOKEN is used to make the JWT

type Message

type Message struct {
	Type    string
	Message string
}

Message describes the JSON object message

type User

type User struct {
	gorm.Model
	Username string
	Password string
	APIToken string
	Email    string
}

User describes the user database

Jump to

Keyboard shortcuts

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