Documentation ¶
Index ¶
- Constants
- Variables
- func BuildSitemap(urls ...*URL)
- func CloseJsBuild()
- func CloseLog()
- func CloseReloadBrowser()
- func CookieDeleteSession(cookieName string, w http.ResponseWriter, r *http.Request) error
- func CookieGetFlash(cookieName string, w http.ResponseWriter, r *http.Request) string
- func CookieGetSession(cookieName string, w http.ResponseWriter, r *http.Request) string
- func CookieSetFlash(cookieName string, w http.ResponseWriter, msg string)
- func CookieSetSession(cookieName string, w http.ResponseWriter, uuid string)
- func CreateLog(logToFile bool) error
- func CreateMakeFile() error
- func CreateMkcertIfNotExists() (mkcertPath string, err error)
- func Domain(pathDomain string) string
- func GenerateSSL(mkcertPath string) (err error)
- func GetFilesAndDirRecursively(ext string, path string) (files []string)
- func IsDev() bool
- func JsBuild()
- func LogFatalErr(err error)
- func LogPrintErr(err error)
- func ReloadBrowser()
- type ChangeFreq
- type Dev
- type Prod
- type Sitemap
- type URL
Constants ¶
const ( ModeDev = "dev" ModeProd = "prod" )
Variables ¶
var Reload = make(chan bool, 1)
var Server server
Functions ¶
func BuildSitemap ¶
func BuildSitemap(urls ...*URL)
func CloseJsBuild ¶
func CloseJsBuild()
func CloseReloadBrowser ¶
func CloseReloadBrowser()
func CookieDeleteSession ¶
func CookieGetFlash ¶
func CookieGetSession ¶
func CookieSetFlash ¶
func CookieSetFlash(cookieName string, w http.ResponseWriter, msg string)
func CookieSetSession ¶
func CookieSetSession(cookieName string, w http.ResponseWriter, uuid string)
func CreateMakeFile ¶
func CreateMakeFile() error
func CreateMkcertIfNotExists ¶
func GenerateSSL ¶
func GetFilesAndDirRecursively ¶
GetFilesAndDirRecursively returns all files with the given extension in a given directory The returned files include the path from root
func LogFatalErr ¶
func LogFatalErr(err error)
func LogPrintErr ¶
func LogPrintErr(err error)
func ReloadBrowser ¶
func ReloadBrowser()
Types ¶
type ChangeFreq ¶
type ChangeFreq string
ChangeFreq specifies the change frequency of a sitemap entry. It is just a string.
const ( Always ChangeFreq = "always" Hourly ChangeFreq = "hourly" Daily ChangeFreq = "daily" Weekly ChangeFreq = "weekly" Monthly ChangeFreq = "monthly" Yearly ChangeFreq = "yearly" Never ChangeFreq = "never" )
Feel free to use these constants for ChangeFreq (or you can just supply a string directly).
type Prod ¶
type Prod struct { User string `json:"user"` Domain string `json:"domain"` IP string `json:"ip"` Password string `json:"password"` Port string `json:"port"` PortSSL string `json:"port_ssl"` UseSSL bool `json:"use_ssl"` CacheStaticFiles bool `json:"cache_static_files"` CacheTempls bool `json:"cache_templates"` }
type Sitemap ¶
type Sitemap struct { XMLName xml.Name `xml:"urlset"` Xmlns string `xml:"xmlns,attr"` URLs []*URL `xml:"url"` Minify bool `xml:"-"` }
Sitemap represents a complete sitemap which can be marshaled to XML. New instances must be created with New() in order to set the xmlns attribute correctly. Minify can be set to make the output less human- readable.
func (*Sitemap) ReadFrom ¶
ReadFrom reads and parses an XML encoded sitemap from io.Reader. Implements io.ReaderFrom.
func (*Sitemap) WriteToFile ¶
WriteToFile writes XML encoded sitemap to given io.Writer. Implements io.WriterTo.
type URL ¶
type URL struct { Loc string `xml:"loc"` LastMod string `xml:"lastmod,omitempty"` ChangeFreq ChangeFreq `xml:"changefreq,omitempty"` Priority float32 `xml:"priority,omitempty"` }
URL entry in sitemap or sitemap index. LastMod is a pointer to time.Time because omitempty does not work otherwise. Loc is the only mandatory item. ChangeFreq and Priority must be left empty when using with a sitemap index.