Esempio n. 1
0
func GetMethodUUID(method string, unique string) gocql.UUID {

	h := md5.New()
	io.WriteString(h, method)
	io.WriteString(h, unique)
	methodUUID, _ := gocql.UUIDFromBytes(h.Sum(nil))

	return methodUUID
}
Esempio n. 2
0
func New(ip string, port uint16) *Server {

	h := md5.New()
	io.WriteString(h, ip)
	io.WriteString(h, fmt.Sprintf("%d", port))
	uuid, _ := gocql.UUIDFromBytes(h.Sum(nil))

	s := &Server{IP: ip, Port: port, UUID: uuid}

	return s
}