Files
filebrowser/http.go
T

24 lines
586 B
Go
Raw Normal View History

2017-06-24 12:12:15 +01:00
package filemanager
2017-08-18 09:00:32 +01:00
import "net/http"
2017-08-11 09:33:47 +01:00
2017-08-18 09:00:32 +01:00
// StaticGen is a static website generator.
type StaticGen interface {
SettingsPath() string
Name() string
Setup() error
2017-06-24 12:12:15 +01:00
2017-08-18 09:00:32 +01: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 20:49:56 +01:00
*FileManager
2017-07-11 16:58:18 +01:00
User *User
2017-08-18 09:00:32 +01:00
File *File
2017-07-26 18:01:24 +01:00
// On API handlers, Router is the APi handler we want.
2017-07-11 16:58:18 +01:00
Router string
2017-06-27 19:00:58 +01:00
}