2017-06-24 11:12:15 +00:00
|
|
|
package filemanager
|
|
|
|
|
2017-08-18 08:00:32 +00:00
|
|
|
import "net/http"
|
2017-08-11 08:33:47 +00:00
|
|
|
|
2017-08-18 08:00:32 +00:00
|
|
|
// StaticGen is a static website generator.
|
|
|
|
type StaticGen interface {
|
|
|
|
SettingsPath() string
|
|
|
|
Name() string
|
|
|
|
Setup() error
|
2017-06-24 11:12:15 +00:00
|
|
|
|
2017-08-18 08:00:32 +00:00
|
|
|
Hook(c *Context, w http.ResponseWriter, r *http.Request) (int, error)
|
|
|
|
Preview(c *Context, w http.ResponseWriter, r *http.Request) (int, error)
|
|
|
|
Publish(c *Context, w http.ResponseWriter, r *http.Request) (int, error)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Context contains the needed information to make handlers work.
|
|
|
|
type Context struct {
|
2017-08-01 19:49:56 +00:00
|
|
|
*FileManager
|
2017-07-11 15:58:18 +00:00
|
|
|
User *User
|
2017-08-18 08:00:32 +00:00
|
|
|
File *File
|
2017-07-26 17:01:24 +00:00
|
|
|
// On API handlers, Router is the APi handler we want.
|
2017-07-11 15:58:18 +00:00
|
|
|
Router string
|
2017-06-27 18:00:58 +00:00
|
|
|
}
|