Documentation ¶
Index ¶
Constants ¶
View Source
const ( InvalidBody ErrorType = "INVALID_BODY" CannotParsePayload = "CANNOT_PARSE_PAYLOAD" InvalidAccessToken = "INVALID_ACCESS_TOKEN" InvalidName = "INVALID_NAME" ServerError = "SERVER_ERROR" InvalidEndpoint = "INVALID_ENDPOINT" )
Variables ¶
This section is empty.
Functions ¶
func StartWebServer ¶
func StartWebServer()
Types ¶
type ErrorHandler ¶
type ErrorHandler struct {
// contains filtered or unexported fields
}
func (ErrorHandler) ServeHTTP ¶
func (h ErrorHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type ErrorResponse ¶
type LoginRequest ¶
type LoginResponse ¶
type LoginResponse struct {
AccessToken string `json:"access_token"`
}
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).
Click to show internal directories.
Click to hide internal directories.