From a64e655376ed3b31cca59ea1e5981f8cd1fb9d3b Mon Sep 17 00:00:00 2001 From: Leo Balduf Date: Sun, 28 Feb 2016 09:38:50 +0100 Subject: [PATCH] store: ClientStore now using chihaya.PeerID --- server/store/client_store.go | 7 +++++-- server/store/memory/client_store.go | 5 +++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/server/store/client_store.go b/server/store/client_store.go index c6e7059..b41ef7d 100644 --- a/server/store/client_store.go +++ b/server/store/client_store.go @@ -4,14 +4,17 @@ package store -import "fmt" +import ( + "fmt" + "github.com/chihaya/chihaya" +) var clientStoreDrivers = make(map[string]ClientStoreDriver) // ClientStore represents an interface for manipulating clientIDs. type ClientStore interface { CreateClient(clientID string) error - FindClient(peerID string) (bool, error) + FindClient(peerID chihaya.PeerID) (bool, error) DeleteClient(clientID string) error } diff --git a/server/store/memory/client_store.go b/server/store/memory/client_store.go index b0342fd..79a05dc 100644 --- a/server/store/memory/client_store.go +++ b/server/store/memory/client_store.go @@ -7,6 +7,7 @@ package memory import ( "sync" + "github.com/chihaya/chihaya" "github.com/chihaya/chihaya/pkg/clientid" "github.com/chihaya/chihaya/server/store" ) @@ -39,8 +40,8 @@ func (s *clientStore) CreateClient(clientID string) error { return nil } -func (s *clientStore) FindClient(peerID string) (bool, error) { - clientID := clientid.New(peerID) +func (s *clientStore) FindClient(peerID chihaya.PeerID) (bool, error) { + clientID := clientid.New(string(peerID)) s.RLock() defer s.RUnlock()