Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AuthHost string = ""
View Source
var HTTPListener net.Listener
View Source
var HTTPSListener net.Listener
View Source
var SH = &staticHandler{}
Functions ¶
func ListenHTTP ¶
func ListenHTTP()
func ListenHTTPS ¶
func ListenHTTPS()
func MakeConsolePassword ¶
func MakeConsolePassword()
func RedirectHTTPS ¶
func RedirectHTTPS(w http.ResponseWriter, r *http.Request)
safely redirect non-secure requests.
func RouterInit ¶
func RouterInit()
Types ¶
type Json_cache ¶
type Json_cache struct {
// Base Name, URI_Prefix "/", and Suffix ".json" are assumed
// ex "gdlemonitor"
BaseName string
// Required Access to GET resource (Default is 0)
// ex -1, 0, 6
GetAccess int
// Required Access to PUT resource (Default is 0)
// ex -1, 0, 6
PutAccess int
// cache Valid Duration (Default is 0, effectively no cache; but it hangs out in memory... meh)
// ex 30 * time.Minute
Exp time.Duration
// (optional) Dynamic Get function- should only populate cache.Content; handler will update
// last modified to time.Now().UTC()., unless cache.modified is modified in function.
Get func(cache *Json_cache) error
// (optional) Dynamic Put function- should only act on cache.Content; handler will update
// last modified to time.Now().UTC()., unless cache.modified is modified in function.
Put func(cache *Json_cache) error
sync.Mutex
// contains filtered or unexported fields
}
func (*Json_cache) Invalidate ¶
func (cache *Json_cache) Invalidate()
func (*Json_cache) ReadFile ¶
func (cache *Json_cache) ReadFile() (err error)
func (*Json_cache) UpdateModified ¶
func (cache *Json_cache) UpdateModified(mod time.Time)
func (*Json_cache) WriteFile ¶
func (cache *Json_cache) WriteFile() (err error)
Click to show internal directories.
Click to hide internal directories.