36 lines
739 B
Go
36 lines
739 B
Go
|
package http
|
||
|
|
||
|
import (
|
||
|
"net/http"
|
||
|
"time"
|
||
|
|
||
|
"git.arav.top/Arav/dwelling-home/web"
|
||
|
)
|
||
|
|
||
|
type Handlers struct {
|
||
|
captchaExpire time.Duration
|
||
|
databasesPath string
|
||
|
guestbookOwner string
|
||
|
guestbookPageSize int
|
||
|
}
|
||
|
|
||
|
func NewHandlers(captchaExpire time.Duration, dbPath, gbOwner string, gbPageSize int) *Handlers {
|
||
|
return &Handlers{
|
||
|
captchaExpire: captchaExpire,
|
||
|
databasesPath: dbPath,
|
||
|
guestbookOwner: gbOwner,
|
||
|
guestbookPageSize: gbPageSize}
|
||
|
}
|
||
|
|
||
|
func (h *Handlers) AssetsFS() http.FileSystem {
|
||
|
return web.Assets()
|
||
|
}
|
||
|
|
||
|
func (h *Handlers) Index(w http.ResponseWriter, r *http.Request) {
|
||
|
}
|
||
|
|
||
|
func (h *Handlers) Robots(w http.ResponseWriter, r *http.Request) {
|
||
|
data, _ := web.AssetsGetFile("robots.txt")
|
||
|
w.Write(data)
|
||
|
}
|