Documentation ¶
Index ¶
- func CheckIfModifiedSince(r *http.Request, modtime time.Time) bool
- func CheckIfNoneMatch(w http.ResponseWriter, r *http.Request) bool
- func RenderBuffer(title string, buf *bytes.Buffer) *bytes.Buffer
- func SetContentAsHTML(w http.ResponseWriter, charset string)
- func SetEtag(w http.ResponseWriter, etag string)
- func SetLastModified(w http.ResponseWriter, modtime time.Time)
- func TextFileServer(root TextFileSystem) http.Handler
- func WriteNotModified(w http.ResponseWriter)
- type FileType
- type PageData
- type TextFile
- type TextFileHandler
- type TextFileSystem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckIfNoneMatch ¶
func CheckIfNoneMatch(w http.ResponseWriter, r *http.Request) bool
func SetContentAsHTML ¶
func SetContentAsHTML(w http.ResponseWriter, charset string)
func SetEtag ¶
func SetEtag(w http.ResponseWriter, etag string)
func SetLastModified ¶
func SetLastModified(w http.ResponseWriter, modtime time.Time)
func TextFileServer ¶
func TextFileServer(root TextFileSystem) http.Handler
func WriteNotModified ¶
func WriteNotModified(w http.ResponseWriter)
Types ¶
type PageData ¶
type PageData struct { File http.File Content string Title string Type FileType CheckSum string Charset string }
func NewPageData ¶
func (*PageData) DetectCharset ¶
func (pd *PageData) DetectCharset()
func (*PageData) RenderPage ¶
func (*PageData) SumContent ¶
func (pd *PageData) SumContent()
type TextFileHandler ¶
type TextFileHandler struct {
// contains filtered or unexported fields
}
func (*TextFileHandler) ServeHTTP ¶
func (f *TextFileHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type TextFileSystem ¶
type TextFileSystem struct {
http.FileSystem
}
Click to show internal directories.
Click to hide internal directories.