Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReturnError ¶
func ReturnError(w http.ResponseWriter, err error) bool
ReturnError produces an error response with HTTP status code 500 if the given error is non-nil. Otherwise, nothing is done and false is returned.
func ReturnJSON ¶
func ReturnJSON(w http.ResponseWriter, code int, data any)
ReturnJSON is a convenience function for HTTP handlers returning JSON data. The `code` argument specifies the HTTP response code, usually 200.
Types ¶
type EventList ¶
type EventList struct { NextURL string `json:"next,omitempty"` PrevURL string `json:"previous,omitempty"` Events []*hermes.ListEvent `json:"events"` Total int `json:"total"` }
EventList is the model for JSON returned by the ListEvents API call
type Token ¶
type Token struct {
// contains filtered or unexported fields
}
Token represents a user's token, as passed through the X-Auth-Token header of a request.
type VersionData ¶
type VersionData struct { Status string `json:"status"` ID string `json:"id"` Links []versionLinkData `json:"links"` }
VersionData is used by version advertisement handlers.
func NewV1Handler ¶
func NewV1Handler(keystone identity.Identity, storageInterface storage.Storage) (http.Handler, VersionData)
NewV1Handler creates a http.Handler that serves the Hermes v1 API. It also returns the VersionData for this API version which is needed for the version advertisement on "GET /".