Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Receives = prometheus.NewSummary( prometheus.SummaryOpts{ Name: "receive_operation_duration_microseconds", Help: "Total duration and counts of receiver methods", }) ReceiveErrors = prometheus.NewCounter( prometheus.CounterOpts{ Name: "receive_operation_errors", Help: "Errors encountered while receiving", }) )
Functions ¶
This section is empty.
Types ¶
type JsonReceiver ¶
type JsonReceiver struct {
// contains filtered or unexported fields
}
JsonReceiver implements the Receiver interface by providing an HTTP POST handler that receives content formatted for Json's API.
func NewJsonReceiver ¶
func NewJsonReceiver(alertReceived chan<- models.Alert) *JsonReceiver
NewJsonReceiver initializes an empty `JsonReceiver` and returns a pointer to it.
It expects a response channel to be passed in for parsed `Alert` data structures to be placed onto.
func (*JsonReceiver) Handler ¶
func (h *JsonReceiver) Handler(w http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.