api

package
v0.0.0-...-e4f64e1 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2023 License: MIT Imports: 4 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	// contains filtered or unexported fields
}

API -

func NewAPI

func NewAPI(db *models.DB) *API

NewAPI -

func (*API) GetUserFromContext

func (api *API) GetUserFromContext(req *http.Request) *models.User

GetUserFromContext - return User reference from header token

func (*API) Quote

func (api *API) Quote(w http.ResponseWriter, req *http.Request)

Quote -

func (*API) SecretQuote

func (api *API) SecretQuote(w http.ResponseWriter, req *http.Request)

SecretQuote -

func (*API) UserInfo

func (api *API) UserInfo(w http.ResponseWriter, req *http.Request)

UserInfo - example to get

func (*API) UserLogin

func (api *API) UserLogin(w http.ResponseWriter, req *http.Request)

UserLogin -

func (*API) UserSignup

func (api *API) UserSignup(w http.ResponseWriter, req *http.Request)

UserSignup -

type UserJSON

type UserJSON struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

UserJSON - json data expected for login/signup

Jump to

Keyboard shortcuts

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