Documentation ¶
Overview ¶
Package handlers contains the HTTP server along with the requests and routes. All HTTP related functions are in this package.
More info on: https://github.com/hunterlong/statping
Index ¶
- func ExecuteResponse(w http.ResponseWriter, r *http.Request, file string, data interface{}, ...)
- func IsAdmin(r *http.Request) bool
- func IsFullAuthenticated(r *http.Request) bool
- func IsReadAuthenticated(r *http.Request) bool
- func IsUser(r *http.Request) bool
- func Router() *mux.Router
- func RunHTTPServer(ip string, port int) error
- type Cacher
- type Item
- type PluginSelect
- type Storage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecuteResponse ¶
func ExecuteResponse(w http.ResponseWriter, r *http.Request, file string, data interface{}, redirect interface{})
ExecuteResponse will render a HTTP response for the front end user
func IsFullAuthenticated ¶ added in v0.80.2
IsFullAuthenticated returns true if the HTTP request is authenticated. You can set the environment variable GO_ENV=test to bypass the admin authenticate to the dashboard features.
func IsReadAuthenticated ¶ added in v0.80.2
IsReadAuthenticated will allow Read Only authentication for some routes
func Router ¶
Router returns all of the routes used in Statping. Server will use static assets if the 'assets' directory is found in the root directory.
func RunHTTPServer ¶
RunHTTPServer will start a HTTP server on a specific IP and port
Types ¶
type Cacher ¶ added in v0.79.1
type Cacher interface { Get(key string) []byte Delete(key string) Set(key string, content []byte, duration time.Duration) List() map[string]Item }
var CacheStorage Cacher
type PluginSelect ¶
type Storage ¶ added in v0.79.1
type Storage struct {
// contains filtered or unexported fields
}
Storage mecanism for caching strings in memory
func NewStorage ¶ added in v0.79.1
func NewStorage() *Storage
NewStorage creates a new in memory CacheStorage