diff --git a/authentication_queue.go b/authentication_map.go similarity index 93% rename from authentication_queue.go rename to authentication_map.go index 39813bd..bf5585f 100644 --- a/authentication_queue.go +++ b/authentication_map.go @@ -17,7 +17,7 @@ type AuthenticationMap struct { } // Returns empty string when no request by that id is present -func (q *AuthenticationMap) getRequestByID(ID string) *AuthRequest { +func (q *AuthenticationMap) GetRequestByID(ID string) *AuthRequest { q.requestMapMutex.RLock() req, ok := q.requestMap[ID] @@ -57,6 +57,7 @@ func (q *AuthenticationMap) QueueRequest(r *AuthRequest) error { func (q *AuthenticationMap) Init() { q.requestMap = make(map[string]*AuthRequest) + q.requestMapMutex = &sync.RWMutex{} q.startRequestMapCleaner() }