Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteError ¶
func WriteError(w http.ResponseWriter, statusCode int, err error) error
WriteError writes an error response back to the ResponseWriter.
func WriteResponse ¶
func WriteResponse(w http.ResponseWriter, statusCode int, resp interface{}) error
Types ¶
type APIResponse ¶
type APIResponse struct { Status string `json:"status"` Data interface{} `json:"data,omitempty"` }
APIResponse is the base object returned for any API call. The Data field will be set to either nil or a value of another *Response type value from this package.
func (*APIResponse) WriteTo ¶
func (r *APIResponse) WriteTo(w http.ResponseWriter, statusCode int) error
type ErrorResponse ¶
type ErrorResponse struct {
Error string `json:"error"`
}
ErrorResponse is contained inside an APIResponse and returns an error string. Returned by any API call that can fail.
type GetConfigurationResponse ¶
type GetConfigurationResponse struct { // Value is the stringified YAML configuration. Value string `json:"value"` }
GetConfigurationResponse is contained inside an APIResponse and provides a single configuration known to the KV store. Returned by GetConfiguration.
type ListConfigurationsResponse ¶
type ListConfigurationsResponse struct { // Configs is the list of configuration names. Configs []string `json:"configs"` }
ListConfigurationsResponse is contained inside an APIResponse and provides the list of configurations known to the KV store. Returned by ListConfigurations.
Click to show internal directories.
Click to hide internal directories.