From 8426bb6494b63c15258191590eb80e479fa50e3e Mon Sep 17 00:00:00 2001 From: nytpu Date: Wed, 17 Mar 2021 09:38:41 -0600 Subject: [PATCH] make jsonData public --- core/structs.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/structs.go b/core/structs.go index 67573cf..a111841 100644 --- a/core/structs.go +++ b/core/structs.go @@ -22,7 +22,7 @@ import ( // jsonData is used for both reading from json and for storing the global feeds // map. contains read mutexes so concurrency can be used. -type jsonData struct { +type JsonData struct { Feeds map[url.URL]*Feed `json:"feeds,omitempty"` Pages map[url.URL]*Page `json:"pages,omitempty"` @@ -115,25 +115,25 @@ func (f *Feed) Swap(i, j int) { // elements so they shuld be able to be accessed at the same time, right? // Lock locks both feed and page mutexes. -func (j *jsonData) Lock() { +func (j *JsonData) Lock() { j.feedsMu.Lock() j.pagesMu.Lock() } // Unlock unlocks both feed and page mutexes. -func (j *jsonData) Unlock() { +func (j *JsonData) Unlock() { j.feedsMu.Unlock() j.pagesMu.Unlock() } // RLock read-locks both feed and page mutexes. -func (j *jsonData) RLock() { +func (j *JsonData) RLock() { j.feedsMu.RLock() j.pagesMu.RLock() } // RUnlock read-unlocks both feed and page mutexes. -func (j *jsonData) RUnlock() { +func (j *JsonData) RUnlock() { j.feedsMu.RUnlock() j.pagesMu.RUnlock() }