Documentation
¶
Index ¶
Constants ¶
View Source
const (
// TypeHTTP .
TypeHTTP = "http"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Alert ¶
type Alert struct {
ID bson.ObjectId `bson:"_id" json:"id"`
Name string `bson:"name,omitempty" json:"name,omitempty"`
AlertDate time.Time `bson:"alertDate,omitempty" json:"alertDate"`
Channel string `bson:"channel,omitempty" json:"channel"`
Method string `bson:"method,omitempty" json:"method,omitempty"`
ContentType string `bson:"contentType,omitempty" json:"contentType,omitempty"`
URL string `bson:"url,omitempty" json:"url,omitempty"`
Data string `bson:"data,omitempty" json:"data,omitempty"`
Schedule *Schedule `bson:"schedule,omitempty" json:"schedule,omitempty"`
Enabled bool `json:"enabled"`
User bson.ObjectId `json:"-"`
}
Alert struct represents alert data stored in storage
type CreateAlertRequest ¶
type CreateAlertRequest struct {
Token string `json:"token"`
Name string `json:"name"`
Channel string `json:"channel"`
URL string `json:"url"`
Method string `json:"method"`
ContentType string `json:"contentType"`
Data string `json:"data"`
AlertDate string `json:"alertDate"`
AlertAfter int `json:"alertAfter"`
RepeatEvery int `json:"repeatEvery"`
RepeatCount int `json:"repeatCount"`
}
CreateAlertRequest .
func (*CreateAlertRequest) Validate ¶
func (r *CreateAlertRequest) Validate() error
Validate validates CreateAlertRequest
type CreateAlertResponse ¶
type CreateAlertResponse struct {
AlertDate string `json:"alertDate"`
}
CreateAlertResponse .
type CreateUserRequest ¶
CreateUserRequest .
func (*CreateUserRequest) Validate ¶
func (r *CreateUserRequest) Validate() error
Validate validates CreateUserRequest
type CreateUserResponse ¶
CreateUserResponse .
type GetAlertsResponse ¶
GetAlertsResponse .
type ProcessAlert ¶
type ProcessAlert struct {
Type string `json:"type"`
Alert bson.ObjectId `json:"-"`
StatusCode int `json:"responseStatusCode"`
CreatedAt time.Time `json:"date"`
}
ProcessAlert .
type Schedule ¶
type Schedule struct {
RepeatEvery int `bson:"repeatEvery,omitempty" json:"repeatEvery,omitempty"`
RepeatCount int `bson:"repeatCount" json:"repeatCount"`
}
Schedule represents schedule of alert
type UpdateAlertRequest ¶
type UpdateAlertRequest struct {
Enabled *bool `json:"enabled"`
}
UpdateAlertRequest .
Click to show internal directories.
Click to hide internal directories.