mirror of
https://github.com/hanzoai/status.git
synced 2026-10-30 18:21:48 +00:00
The import path a reader types is the one the org owns, rather than the forge that happens to host the bytes. hanzo.ai serves the go-import meta and points it at the same repository, so where the code lives does not change. Rewritten by role. A bare repository URL — a clone target, a badge, a build context — still names where the code is and stays on github.com.
19 lines
493 B
Go
19 lines
493 B
Go
package incidentio
|
|
|
|
import (
|
|
"crypto/sha256"
|
|
"encoding/hex"
|
|
"fmt"
|
|
"time"
|
|
|
|
"hanzo.ai/status/alerting/alert"
|
|
"hanzo.ai/status/config/endpoint"
|
|
)
|
|
|
|
// generateDeduplicationKey generates a unique deduplication_key for incident.io
|
|
func generateDeduplicationKey(ep *endpoint.Endpoint, alert *alert.Alert) string {
|
|
data := fmt.Sprintf("%s|%s|%s|%d", ep.Key(), alert.Type, alert.GetDescription(), time.Now().UnixNano())
|
|
hash := sha256.Sum256([]byte(data))
|
|
return hex.EncodeToString(hash[:])
|
|
}
|