Documentation
¶
Index ¶
- Constants
- func GetJSONFile(w http.ResponseWriter, r *http.Request)
- func GetSystemMeters(w http.ResponseWriter, r *http.Request)
- func HelloName(w http.ResponseWriter, r *http.Request)
- func HelloWorld(w http.ResponseWriter, r *http.Request)
- func NewRouter() http.Handler
- func RequireAuthentication(next http.Handler) http.Handler
- func ServerResourceStats(w http.ResponseWriter, r *http.Request)
- func SetJSONFile(w http.ResponseWriter, r *http.Request)
- type FruitBasket
- type HelloResponse
- type ServerStats
Constants ¶
View Source
const ValidBearer = "123456"
ValidBearer is a hardcoded bearer token for demonstration purposes.
Variables ¶
This section is empty.
Functions ¶
func GetJSONFile ¶
func GetJSONFile(w http.ResponseWriter, r *http.Request)
GetJSONFile open any file
func GetSystemMeters ¶
func GetSystemMeters(w http.ResponseWriter, r *http.Request)
GetSystemMeters ss
func HelloName ¶
func HelloName(w http.ResponseWriter, r *http.Request)
HelloName returns a personalized JSON message
func HelloWorld ¶
func HelloWorld(w http.ResponseWriter, r *http.Request)
HelloWorld returns a basic "Hello World!" message
func RequireAuthentication ¶
RequireAuthentication is an example middleware handler that checks for a hardcoded bearer token. This can be used to verify session cookies, JWTs and more.
func ServerResourceStats ¶
func ServerResourceStats(w http.ResponseWriter, r *http.Request)
ServerResourceStats return server resource statat in JSON
Types ¶
type FruitBasket ¶
FruitBasket dff
type HelloResponse ¶
type HelloResponse struct {
Message string `json:"message"`
}
HelloResponse is the JSON representation for a customized message
Click to show internal directories.
Click to hide internal directories.