Documentation
¶
Index ¶
Constants ¶
const ( RetentionDays = 7 TimeFormat = "2006-01-02 15:04" TimeFormatRecurring = "Monday 15:04" )
Variables ¶
var ErrLocked = errors.New("another execution is in progress")
ErrLocked returned when homesever has a lock
Functions ¶
This section is empty.
Types ¶
type Alert ¶
type Alert struct { ID string Name string Domain string Instance string Status string Icon string Summary string Hints string Message string }
Alert is Grafana alert, processed by Alerter service
type Contacts ¶
Contacts struct
func (*Contacts) ContainsEmail ¶
ContainsEmail checks if the contacts contains at least one email
func (*Contacts) ContainsMXID ¶
ContainsMXID checks if the contacts contains at least one mxid
type GitPosterFile ¶
type GitPosterFile struct { Path string `json:"path"` Content string `json:"content"` Action string `json:"action"` Line string `json:"line,omitempty"` Regex string `json:"regex,omitempty"` }
GitPosterFile is the struct that represents file actions to be posted to the GitPoster API
type GitPosterRequest ¶
type GitPosterRequest struct { Message string `json:"message"` Files []*GitPosterFile `json:"files"` }
GitPosterRequest is the struct that represents the request to the GitPoster API
type Notification ¶
type Notification struct { PM id.UserID // PM is MXID to try first MXID id.UserID RoomID id.RoomID EventID id.EventID ThreadReply bool FromAuto bool Log string Homeserver string Message string Error string Output string SentAt string }
Notification record
func NewNotification ¶
func NewNotification(r *Run, output string) *Notification
NewNotification creates Notification model from run record
type PSDTarget ¶
type PSDTarget struct { Targets []string `json:"targets"` Labels map[string]string `json:"labels"` }
PSDTarget - Prometheus Service Discovery item
type PSDTargets ¶
type PSDTargets []*PSDTarget
PSDTargets - Prometheus Service Discovery items
func (PSDTargets) Contains ¶
func (p PSDTargets) Contains(needle string) bool
Contains - check if PSDTargets contains arbitrary target
func (PSDTargets) ContainsFederation ¶
func (p PSDTargets) ContainsFederation() bool
ContainsFederation - check if PSDTargets contains matrix federation endpoint
func (PSDTargets) ContainsMSC1929 ¶
func (p PSDTargets) ContainsMSC1929() bool
ContainsMSC1929 - check if PSDTargets contains matrix MSC1929 endpoint
func (PSDTargets) GetDomains ¶
func (p PSDTargets) GetDomains() []string
GetDomains - get domains from service discovery labels
type PingLabel ¶
type PingResponse ¶
type PingResponse struct { OK bool `json:"ok"` Results []*PingResult `json:"results"` }
PingResponse is the result of the ping request
func (*PingResponse) Markdown ¶
func (l *PingResponse) Markdown() string
type PingResult ¶
type PingResult struct { OK bool `json:"ok"` Reason string `json:"reason"` Target string `json:"url"` Label *PingLabel `json:"label"` }
PingResult
type Recurring ¶
type Recurring struct { MXID id.UserID RoomID id.RoomID EventID id.EventID UseAdmin bool FromAuto bool Time string Homeserver string Message string Args string }
Recurring record
func NewRecurring ¶
func NewRecurring(evt *event.Event, useAdmin bool, adminRoomID id.RoomID, homeserver, command string) *Recurring
NewRecurring creates Recurring model from matrix event
type Run ¶
type Run struct { PM id.UserID // PM is MXID to try first MXID id.UserID RoomID id.RoomID EventID id.EventID NoPM bool UseAdmin bool FromAuto bool Prefix string Log string Homeserver string Message string Args string Error string CreatedAt string UpdatedAt string ExecutedAt string }
Run record
type Schedule ¶
type Schedule struct { MXID id.UserID RoomID id.RoomID EventID id.EventID NoPM bool Recurring bool UseAdmin bool FromAuto bool Homeserver string Message string Args string CreatedAt string UpdatedAt string ScheduledAt string }
Schedule record