mirror of
https://github.com/henrygd/beszel.git
synced 2025-12-17 02:36:17 +01:00
refactor: alerts / emails
This commit is contained in:
@@ -2,6 +2,7 @@ package container
|
||||
|
||||
import "time"
|
||||
|
||||
// Docker container resources info from /containers/id/stats
|
||||
type Container struct {
|
||||
Id string
|
||||
IdShort string
|
||||
@@ -24,6 +25,7 @@ type Container struct {
|
||||
// Mounts []MountPoint
|
||||
}
|
||||
|
||||
// Stats to return to the hub
|
||||
type ContainerStats struct {
|
||||
Name string `json:"n"`
|
||||
Cpu float64 `json:"c"`
|
||||
@@ -32,6 +34,7 @@ type ContainerStats struct {
|
||||
NetworkRecv float64 `json:"nr"`
|
||||
}
|
||||
|
||||
// Keeps track of container stats from previous run
|
||||
type PrevContainerStats struct {
|
||||
Cpu [2]uint64
|
||||
Net struct {
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
package email
|
||||
|
||||
type EmailData struct {
|
||||
to string
|
||||
subj string
|
||||
body string
|
||||
}
|
||||
|
||||
func NewEmailData(to, subj, body string) *EmailData {
|
||||
return &EmailData{
|
||||
to: to,
|
||||
subj: subj,
|
||||
body: body,
|
||||
}
|
||||
}
|
||||
|
||||
func (e *EmailData) To() string {
|
||||
return e.to
|
||||
}
|
||||
|
||||
func (e *EmailData) Subject() string {
|
||||
return e.subj
|
||||
}
|
||||
|
||||
func (e *EmailData) Body() string {
|
||||
return e.body
|
||||
}
|
||||
Reference in New Issue
Block a user