feat: build wahrwelt A/D toolkit
This commit is contained in:
1 parent
303438d206
commit
653924d8c6
564 files changed
+36310
-49998
No files matched your search
@@ -0,0 +1,40 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
)
|
||||
|
||||
type ExploitType string
|
||||
|
||||
const (
|
||||
ExploitTypeRecurrent ExploitType = "recurrent"
|
||||
ExploitTypeEndless ExploitType = "endless"
|
||||
)
|
||||
|
||||
type Exploit struct {
|
||||
ID string
|
||||
Version int64
|
||||
Type ExploitType
|
||||
}
|
||||
|
||||
func NewExploit(id string, version int64, exploitType ExploitType) *Exploit {
|
||||
return &Exploit{
|
||||
ID: id,
|
||||
Version: version,
|
||||
Type: exploitType,
|
||||
}
|
||||
}
|
||||
|
||||
func (i *Exploit) String() string {
|
||||
return fmt.Sprintf("Exploit(%s_%d, type=%s)", i.ID, i.Version, i.Type)
|
||||
}
|
||||
|
||||
func (i *Exploit) MetricLabels() prometheus.Labels {
|
||||
return prometheus.Labels{
|
||||
"exploit_id": i.ID,
|
||||
"exploit_version": fmt.Sprintf("%d", i.Version),
|
||||
"exploit_type": string(i.Type),
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user