Versions in this module Expand all Collapse all v1 v1.2.4 Aug 28, 2020 Changes in this version type CachedFile + func NewCachedBuffer(name string, buf []byte) (*CachedFile, error) v1.2.3 Jul 22, 2020 Changes in this version + var ERootCAFailed = errors.New("failed to add Root CAs to certificate pool") + var MaxFileSize int64 = 1 << 24 + func CheckDir(path string) error + func CheckFile(path, name string) error + func FindAndReplace(buf []byte, w io.Writer, fn func(string) string) + func FindTemplates(buf []byte) (locs []int) + func IsCached(f http.File) bool + func NewTLSConfig(c TLSConfig) (*tls.Config, error) + func ReplaceTemplates(src []byte, w io.Writer, locs []int, fn func(string) string) + func SetDelims(start, end string) + func SetMaxReplace(size int) + func TLSVersion(v int) uint16 + func TLSVersionString(v uint16) string + type AccessLog struct + BodyBytesSent int + ContentType string + Host string + Referrer string + RemoteAddr string + Request string + RequestId string + RequestMethod string + RequestTime float64 + SslCipher string + SslProtocol string + Status int + Time time.Time + UserAgent string + type CacheConfig struct + Control string + Enable bool + Expires time.Duration + Rules []CacheRule + type CacheRule struct + Control string + Expires time.Duration + Filename string + Ignore bool + NoCache bool + Regexp *regexp.Regexp + type CachedFile struct + func NewCachedFile(f http.File) (*CachedFile, error) + func (f *CachedFile) Close() error + func (f *CachedFile) Read(p []byte) (n int, err error) + func (f *CachedFile) Readdir(count int) ([]os.FileInfo, error) + func (f *CachedFile) ReplaceTemplates() + func (f *CachedFile) Seek(offset int64, whence int) (int64, error) + func (f *CachedFile) Stat() (os.FileInfo, error) + type CachedFileInfo struct + func NewCachedFileInfo(fi os.FileInfo) *CachedFileInfo + func (i *CachedFileInfo) IsDir() bool + func (i *CachedFileInfo) ModTime() time.Time + func (i *CachedFileInfo) Mode() os.FileMode + func (i *CachedFileInfo) Name() string + func (i *CachedFileInfo) Size() int64 + func (i *CachedFileInfo) Sys() interface{} + type SPAServer struct + func NewSPAServer() (*SPAServer, error) + func (s *SPAServer) Address() string + func (s *SPAServer) ServeHTTP(w http.ResponseWriter, r *http.Request) + func (s *SPAServer) TLS() *tls.Config + func (s *SPAServer) TryFile(r *http.Request, name string) (http.File, string, error) + func (s *SPAServer) WriteHeaders(w http.ResponseWriter, r *http.Request, f http.File, start time.Time) + type ServerConfig struct + Addr string + Base string + Cache CacheConfig + CspLog string + Host string + Index string + Port int + Root string + Scheme string + Tpl TemplateConfig + type TLSConfig struct + AllowInsecureCerts bool + Cert []string + CertFile string + Key []string + KeyFile string + RootCaCerts []string + RootCaCertsFile string + ServerName string + TLSMaxVersion int + TLSMinVersion int + func (cfg TLSConfig) Check() error + type TemplateConfig struct + Enable bool + Left string + Match *regexp.Regexp + MaxReplace int + MaxSize int64 + Right string