Documentation ¶
Index ¶
- type Controller
- type MemeHandler
- func (h *MemeHandler) Form(w http.ResponseWriter, r *http.Request)
- func (h *MemeHandler) ListGifs(w http.ResponseWriter, r *http.Request)
- func (h *MemeHandler) LoadTemplates(basepath string)
- func (h *MemeHandler) MemeFromRequest(w http.ResponseWriter, r *http.Request)
- func (h *MemeHandler) Preview(w http.ResponseWriter, r *http.Request)
- func (h *MemeHandler) UID(r *http.Request) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct { Handler *MemeHandler Router *mux.Router }
func (*Controller) Load ¶
func (r *Controller) Load(tplPath string)
Load sets up all dynamic routes.
func (*Controller) StaticRoute ¶
func (r *Controller) StaticRoute(uriPrefix string, docRoot string)
StaticRoute sets up a static route
type MemeHandler ¶
type MemeHandler struct { // ImgPath is the filesystem path where all images are located ImgPath string // OutputPath is the path on the filesystem where all memes will be saved OutputPath string // FontName is the font to use FontName string // MemeURL is the url at which the file will be served MemeURL string // contains filtered or unexported fields }
MemeHandler is the base structure that handles most web operations
func (*MemeHandler) Form ¶
func (h *MemeHandler) Form(w http.ResponseWriter, r *http.Request)
Form returns a form that will generate the meme
func (*MemeHandler) ListGifs ¶
func (h *MemeHandler) ListGifs(w http.ResponseWriter, r *http.Request)
ListGifs lists the available GIFs
func (*MemeHandler) LoadTemplates ¶
func (h *MemeHandler) LoadTemplates(basepath string)
LoadTemplates pre-parses the templates. Must be called before starting the server.
func (*MemeHandler) MemeFromRequest ¶
func (h *MemeHandler) MemeFromRequest(w http.ResponseWriter, r *http.Request)
MemeFromRequest generates a meme image from a request, and saves it to disk. Then sends a 301 to the user.
func (*MemeHandler) Preview ¶
func (h *MemeHandler) Preview(w http.ResponseWriter, r *http.Request)
Preview returns a thumbnail, in jpeg format
Click to show internal directories.
Click to hide internal directories.