summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authornytpu <alex@nytpu.com>2021-03-17 09:38:41 -0600
committernytpu <alex@nytpu.com>2021-03-17 09:38:41 -0600
commit8426bb6494b63c15258191590eb80e479fa50e3e (patch)
treee77b925886c11b772c1ea43a4eca6bda74446334 /core
parente42ebd8171c4acad153bf0cfd231f326c0b73936 (diff)
make jsonData public
Diffstat (limited to 'core')
-rw-r--r--core/structs.go10
1 files 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()
}