Documentation ¶
Index ¶
- type Env
- func (env *Env) AddImage(w http.ResponseWriter, r *http.Request)
- func (env *Env) AuthMiddleware(next http.Handler) http.Handler
- func (env *Env) CreateCategory(w http.ResponseWriter, r *http.Request)
- func (env *Env) DeleteCategory(w http.ResponseWriter, r *http.Request)
- func (env *Env) GetAuthURL(w http.ResponseWriter, r *http.Request, appKey, redirectURI string)
- func (env *Env) GetCategories(w http.ResponseWriter, r *http.Request)
- func (env *Env) JSONMiddleware(next http.Handler) http.Handler
- func (env *Env) Login(w http.ResponseWriter, r *http.Request, appKey, appSecret, redirectURI string)
- func (env *Env) ReadCategory(w http.ResponseWriter, r *http.Request)
- func (env *Env) RemoveImage(w http.ResponseWriter, r *http.Request)
- func (env *Env) UpdateCategory(w http.ResponseWriter, r *http.Request)
- func (env *Env) UploadImage(w http.ResponseWriter, r *http.Request, maxMemorySize int64)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Env ¶
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 ¶
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 ¶
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 ¶
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 ¶
UploadImage uploads an image to the user's account.
Click to show internal directories.
Click to hide internal directories.