Documentation
¶
Index ¶
- func CORS(w http.ResponseWriter, r *http.Request)
- func Healthz(w http.ResponseWriter, r *http.Request)
- func JSON(w http.ResponseWriter, code int, payload interface{})
- func Login(w http.ResponseWriter, r *http.Request)
- func Metadata(w http.ResponseWriter, r *http.Request)
- func NodeProxy(upstream *httputil.ReverseProxy) func(http.ResponseWriter, *http.Request)
- func NotImplemented(w http.ResponseWriter, r *http.Request)
- func Root(w http.ResponseWriter, r *http.Request)
- func StreamJSON(c *websocket.Conn, payload interface{})
- type DatabaseResponse
- type Handlers
- type HealthzResponse
- type LoginRequest
- type LoginResponse
- type MetadataResponse
- type SPAHandler
- type StatusResponse
- type StorageResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JSON ¶
func JSON(w http.ResponseWriter, code int, payload interface{})
func NodeProxy ¶
func NodeProxy(upstream *httputil.ReverseProxy) func(http.ResponseWriter, *http.Request)
func NotImplemented ¶
func NotImplemented(w http.ResponseWriter, r *http.Request)
func StreamJSON ¶
Types ¶
type DatabaseResponse ¶
type DatabaseResponse struct {
Connected bool `json:"connected"`
}
type HealthzResponse ¶
type HealthzResponse struct { Version string `json:"version"` GitSHA string `json:"gitSha"` Status StatusResponse `json:"status"` }
type LoginRequest ¶
type LoginRequest struct {
Password string `json:"password"`
}
type LoginResponse ¶
type LoginResponse struct {
Token string `json:"token"`
}
type MetadataResponse ¶
type SPAHandler ¶
spaHandler implements the http.Handler interface, so we can use it to respond to HTTP requests. The path to the static directory and path to the index file within that static directory are used to serve the SPA in the given static directory.
func (SPAHandler) ServeHTTP ¶
func (h SPAHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP inspects the URL path to locate a file within the static dir on the SPA handler. If a file is found, it will be served. If not, the file located at the index path on the SPA handler will be served. This is suitable behavior for serving an SPA (single page application).
type StatusResponse ¶
type StatusResponse struct { Database DatabaseResponse `json:"database"` Storage StorageResponse `json:"storage"` }
type StorageResponse ¶
type StorageResponse struct {
Available bool `json:"available"`
}
Click to show internal directories.
Click to hide internal directories.