Fixed imports

gql_cataclysm v0.2.2
noah metz 2023-07-27 23:17:44 -06:00
parent 027c3d4c96
commit f314b46415
3 changed files with 4 additions and 7 deletions

@ -5,6 +5,8 @@ import (
"fmt" "fmt"
"errors" "errors"
"runtime" "runtime"
"crypto/sha512"
"encoding/binary"
) )
type NodeType string type NodeType string
@ -13,12 +15,6 @@ func (node NodeType) Hash() uint64 {
return binary.BigEndian.Uint64(hash[(len(hash)-9):(len(hash)-1)]) return binary.BigEndian.Uint64(hash[(len(hash)-9):(len(hash)-1)])
} }
type PolicyType string
func (policy PolicyType) Hash() uint64 {
hash := sha512.Sum512([]byte(fmt.Sprintf("POLICY: %s", string(policy))))
return binary.BigEndian.Uint64(hash[(len(hash)-9):(len(hash)-1)])
}
type ExtType string type ExtType string
func (ext ExtType) Hash() uint64 { func (ext ExtType) Hash() uint64 {
hash := sha512.Sum512([]byte(fmt.Sprintf("EXTENSION: %s", string(ext)))) hash := sha512.Sum512([]byte(fmt.Sprintf("EXTENSION: %s", string(ext))))

@ -9,7 +9,6 @@ import (
"fmt" "fmt"
"encoding/binary" "encoding/binary"
"encoding/json" "encoding/json"
"crypto/sha512"
"sync/atomic" "sync/atomic"
) )

@ -3,6 +3,8 @@ package graphvent
import ( import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"crypto/sha512"
"encoding/binary"
) )
type PolicyType string type PolicyType string