Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithMonitorAndLog ¶
func WithMonitorAndLog(m *monitor.Monitor, log *zap.Logger, h RouteHandler) http.HandlerFunc
Types ¶
type AddServerRequestBody ¶
type AddServerRequestBody struct {
// HostAndPort is the public address (in "host:port" format)
HostAndPort string `json:"host_and_port"`
}
type ApiError ¶
type ApiError struct {
ResponseCode int
// ResponseBody is the response body; must support json.Marshal
ResponseBody interface{}
Err error
LogData []zap.Field
}
func NewApiError ¶
NewApiError returns an ApiError using the given arguments. If body is a string, a struct will be used for the ResponseBody field that marshals to {"error":"..."}. Otherwise, the body is used for ResponseBody.
func NewApiErrorFromServerAddError ¶
func NewApiErrorFromServerAddError(log *zap.Logger, err monitor.ServerAddError) ApiError
Click to show internal directories.
Click to hide internal directories.