You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

18 lines
461 B

package dao
import (
"fmt"
"strconv"
"github.com/dgryski/go-farm"
)
func rangeKey(prefix string, start, end int64) (string, string) {
return prefix + strconv.FormatInt(start, 10), prefix + strconv.FormatInt(end, 10)
}
func keyPrefix(serviceName, operationName string) string {
serviceNameHash := farm.Hash32([]byte(serviceName))
operationNameHash := farm.Hash32([]byte(operationName))
return fmt.Sprintf("%x%x", serviceNameHash, operationNameHash)
}