common

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindImage

func BindImage(images *store.Images, paramName string) func(http.Handler) http.Handler

func BindPinl

func BindPinl(pinls *store.Pinls, paramName string) func(http.Handler) http.Handler

BindPinl finds pinl by id and binds into context.

func BindShare

func BindShare(shares *store.Shares, paramName string) func(http.Handler) http.Handler

func BindShareBySlug

func BindShareBySlug(shares *store.Shares, paramName string) func(http.Handler) http.Handler

func BindTag

func BindTag(tags *store.Tags, paramName string) func(http.Handler) http.Handler

func BindUserByLogin

func BindUserByLogin(users *store.Users, paramName string) func(http.Handler) http.Handler

func ImageHandler

func ImageHandler() http.Handler

func ImageUpload

func ImageUpload(ctx context.Context, r *http.Request, images *store.Images, target model.Morphable, maxMemory int64, replace bool) (image *model.Image, code int, outerr error)

func PinlCreateHandler

func PinlCreateHandler(txer database.Txer, pinls *store.Pinls, tags *store.Tags, taggables *store.Taggables, queue *queue.Manager) http.Handler

PinlCreateHandler creates pinl from request.

func PinlDeleteHandler

func PinlDeleteHandler(txer database.Txer, pinls *store.Pinls, tags *store.Tags, taggables *store.Taggables, queue *queue.Manager) http.Handler

PinlDeleteHandler deletes pinl if found.

func PinlHandler

func PinlHandler(taggables *store.Taggables) http.Handler

PinlHandler shows pinl by id.

func PinlListHandler

func PinlListHandler(pinls *store.Pinls, tags *store.Tags, taggables *store.Taggables) http.Handler

PinlListHandler handles pinl listing request.

func PinlUpdateHandler

func PinlUpdateHandler(txer database.Txer, pinls *store.Pinls, tags *store.Tags, taggables *store.Taggables, queue *queue.Manager) http.Handler

PinlUpdateHandler updates fields of the found pinl.

func TagCreateHandler

func TagCreateHandler(txer database.Txer, tags *store.Tags) http.Handler

func TagDeleteHandler

func TagDeleteHandler(txer database.Txer, tags *store.Tags, taggables *store.Taggables) http.Handler

func TagHandler

func TagHandler() http.Handler

func TagListHandler

func TagListHandler(tags *store.Tags) http.Handler

func TagUpdateHandler

func TagUpdateHandler(txer database.Txer, tags *store.Tags) http.Handler

Types

type PinlBody

type PinlBody struct {
	URL         string   `json:"url"`
	Title       string   `json:"title"`
	Description string   `json:"description"`
	TagNames    []string `json:"tagNames"`
}

PinlBody defines the fields of pinl body.

type TagBody

type TagBody struct {
	Name    string `json:"name"`
	Color   string `json:"color"`
	BgColor string `json:"bgColor"`
}

Jump to

Keyboard shortcuts

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