handler

package
v0.0.0-...-89f3358 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2021 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Env

type Env struct {
	DB              *mgo.Database
	MaxItemsPerPage int
}

Env contains common variables, such as the database access, etc.

func (*Env) AddImage

func (env *Env) AddImage(w http.ResponseWriter, r *http.Request)

AddImage adds an image to a category.

func (*Env) AuthMiddleware

func (env *Env) AuthMiddleware(next http.Handler) http.Handler

AuthMiddleware verifies that the current user is authenticated.

func (*Env) CreateCategory

func (env *Env) CreateCategory(w http.ResponseWriter, r *http.Request)

CreateCategory inserts a category.

func (*Env) DeleteCategory

func (env *Env) DeleteCategory(w http.ResponseWriter, r *http.Request)

DeleteCategory deletes a category.

func (*Env) GetAuthURL

func (env *Env) GetAuthURL(w http.ResponseWriter, r *http.Request, appKey, redirectURI string)

GetAuthURL gets the authentication URL.

func (*Env) GetCategories

func (env *Env) GetCategories(w http.ResponseWriter, r *http.Request)

GetCategories gets all the categories.

func (*Env) JSONMiddleware

func (env *Env) JSONMiddleware(next http.Handler) http.Handler

JSONMiddleware sets the content type to JSON.

func (*Env) Login

func (env *Env) Login(w http.ResponseWriter, r *http.Request, appKey, appSecret, redirectURI string)

Login logs into the system.

func (*Env) ReadCategory

func (env *Env) ReadCategory(w http.ResponseWriter, r *http.Request)

ReadCategory gets a category.

func (*Env) RemoveImage

func (env *Env) RemoveImage(w http.ResponseWriter, r *http.Request)

RemoveImage removes an image from a category.

func (*Env) UpdateCategory

func (env *Env) UpdateCategory(w http.ResponseWriter, r *http.Request)

UpdateCategory updates a category.

func (*Env) UploadImage

func (env *Env) UploadImage(w http.ResponseWriter, r *http.Request, maxMemorySize int64)

UploadImage uploads an image to the user's account.

Jump to

Keyboard shortcuts

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