diff options
author | 2023-05-25 10:37:38 +0200 | |
---|---|---|
committer | 2023-05-25 10:37:38 +0200 | |
commit | f5c004d67d4ed66b6c6df100afec47174aa14ae0 (patch) | |
tree | 45b72a6e90450d711e10571d844138186fe023c9 /internal/config | |
parent | [docs] local docs hacking howto (#1816) (diff) | |
download | gotosocial-f5c004d67d4ed66b6c6df100afec47174aa14ae0.tar.xz |
[feature] Add List functionality (#1802)
* start working on lists
* further list work
* test list db functions nicely
* more work on lists
* peepoopeepoo
* poke
* start list timeline func
* we're getting there lads
* couldn't be me working on stuff... could it?
* hook up handlers
* fiddling
* weeee
* woah
* screaming, pissing
* fix streaming being a whiny baby
* lint, small test fix, swagger
* tidying up, testing
* fucked! by the linter
* move timelines to state like a boss
* add timeline start to tests using state
* invalidate lists
Diffstat (limited to 'internal/config')
-rw-r--r-- | internal/config/config.go | 8 | ||||
-rw-r--r-- | internal/config/defaults.go | 8 | ||||
-rw-r--r-- | internal/config/helpers.gen.go | 150 |
3 files changed, 166 insertions, 0 deletions
diff --git a/internal/config/config.go b/internal/config/config.go index 7119fc4a7..0b7b527ea 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -199,6 +199,14 @@ type GTSCacheConfiguration struct { FollowRequestTTL time.Duration `name:"follow-request-ttl"` FollowRequestSweepFreq time.Duration `name:"follow-request-sweep-freq"` + ListMaxSize int `name:"list-max-size"` + ListTTL time.Duration `name:"list-ttl"` + ListSweepFreq time.Duration `name:"list-sweep-freq"` + + ListEntryMaxSize int `name:"list-entry-max-size"` + ListEntryTTL time.Duration `name:"list-entry-ttl"` + ListEntrySweepFreq time.Duration `name:"list-entry-sweep-freq"` + MediaMaxSize int `name:"media-max-size"` MediaTTL time.Duration `name:"media-ttl"` MediaSweepFreq time.Duration `name:"media-sweep-freq"` diff --git a/internal/config/defaults.go b/internal/config/defaults.go index 6e2d141be..53d994cda 100644 --- a/internal/config/defaults.go +++ b/internal/config/defaults.go @@ -153,6 +153,14 @@ var Defaults = Configuration{ FollowRequestTTL: time.Minute * 30, FollowRequestSweepFreq: time.Minute, + ListMaxSize: 2000, + ListTTL: time.Minute * 30, + ListSweepFreq: time.Minute, + + ListEntryMaxSize: 2000, + ListEntryTTL: time.Minute * 30, + ListEntrySweepFreq: time.Minute, + MediaMaxSize: 1000, MediaTTL: time.Minute * 30, MediaSweepFreq: time.Minute, diff --git a/internal/config/helpers.gen.go b/internal/config/helpers.gen.go index 9993d7aaf..2a70488e8 100644 --- a/internal/config/helpers.gen.go +++ b/internal/config/helpers.gen.go @@ -2778,6 +2778,156 @@ func GetCacheGTSFollowRequestSweepFreq() time.Duration { // SetCacheGTSFollowRequestSweepFreq safely sets the value for global configuration 'Cache.GTS.FollowRequestSweepFreq' field func SetCacheGTSFollowRequestSweepFreq(v time.Duration) { global.SetCacheGTSFollowRequestSweepFreq(v) } +// GetCacheGTSListMaxSize safely fetches the Configuration value for state's 'Cache.GTS.ListMaxSize' field +func (st *ConfigState) GetCacheGTSListMaxSize() (v int) { + st.mutex.Lock() + v = st.config.Cache.GTS.ListMaxSize + st.mutex.Unlock() + return +} + +// SetCacheGTSListMaxSize safely sets the Configuration value for state's 'Cache.GTS.ListMaxSize' field +func (st *ConfigState) SetCacheGTSListMaxSize(v int) { + st.mutex.Lock() + defer st.mutex.Unlock() + st.config.Cache.GTS.ListMaxSize = v + st.reloadToViper() +} + +// CacheGTSListMaxSizeFlag returns the flag name for the 'Cache.GTS.ListMaxSize' field +func CacheGTSListMaxSizeFlag() string { return "cache-gts-list-max-size" } + +// GetCacheGTSListMaxSize safely fetches the value for global configuration 'Cache.GTS.ListMaxSize' field +func GetCacheGTSListMaxSize() int { return global.GetCacheGTSListMaxSize() } + +// SetCacheGTSListMaxSize safely sets the value for global configuration 'Cache.GTS.ListMaxSize' field +func SetCacheGTSListMaxSize(v int) { global.SetCacheGTSListMaxSize(v) } + +// GetCacheGTSListTTL safely fetches the Configuration value for state's 'Cache.GTS.ListTTL' field +func (st *ConfigState) GetCacheGTSListTTL() (v time.Duration) { + st.mutex.Lock() + v = st.config.Cache.GTS.ListTTL + st.mutex.Unlock() + return +} + +// SetCacheGTSListTTL safely sets the Configuration value for state's 'Cache.GTS.ListTTL' field +func (st *ConfigState) SetCacheGTSListTTL(v time.Duration) { + st.mutex.Lock() + defer st.mutex.Unlock() + st.config.Cache.GTS.ListTTL = v + st.reloadToViper() +} + +// CacheGTSListTTLFlag returns the flag name for the 'Cache.GTS.ListTTL' field +func CacheGTSListTTLFlag() string { return "cache-gts-list-ttl" } + +// GetCacheGTSListTTL safely fetches the value for global configuration 'Cache.GTS.ListTTL' field +func GetCacheGTSListTTL() time.Duration { return global.GetCacheGTSListTTL() } + +// SetCacheGTSListTTL safely sets the value for global configuration 'Cache.GTS.ListTTL' field +func SetCacheGTSListTTL(v time.Duration) { global.SetCacheGTSListTTL(v) } + +// GetCacheGTSListSweepFreq safely fetches the Configuration value for state's 'Cache.GTS.ListSweepFreq' field +func (st *ConfigState) GetCacheGTSListSweepFreq() (v time.Duration) { + st.mutex.Lock() + v = st.config.Cache.GTS.ListSweepFreq + st.mutex.Unlock() + return +} + +// SetCacheGTSListSweepFreq safely sets the Configuration value for state's 'Cache.GTS.ListSweepFreq' field +func (st *ConfigState) SetCacheGTSListSweepFreq(v time.Duration) { + st.mutex.Lock() + defer st.mutex.Unlock() + st.config.Cache.GTS.ListSweepFreq = v + st.reloadToViper() +} + +// CacheGTSListSweepFreqFlag returns the flag name for the 'Cache.GTS.ListSweepFreq' field +func CacheGTSListSweepFreqFlag() string { return "cache-gts-list-sweep-freq" } + +// GetCacheGTSListSweepFreq safely fetches the value for global configuration 'Cache.GTS.ListSweepFreq' field +func GetCacheGTSListSweepFreq() time.Duration { return global.GetCacheGTSListSweepFreq() } + +// SetCacheGTSListSweepFreq safely sets the value for global configuration 'Cache.GTS.ListSweepFreq' field +func SetCacheGTSListSweepFreq(v time.Duration) { global.SetCacheGTSListSweepFreq(v) } + +// GetCacheGTSListEntryMaxSize safely fetches the Configuration value for state's 'Cache.GTS.ListEntryMaxSize' field +func (st *ConfigState) GetCacheGTSListEntryMaxSize() (v int) { + st.mutex.Lock() + v = st.config.Cache.GTS.ListEntryMaxSize + st.mutex.Unlock() + return +} + +// SetCacheGTSListEntryMaxSize safely sets the Configuration value for state's 'Cache.GTS.ListEntryMaxSize' field +func (st *ConfigState) SetCacheGTSListEntryMaxSize(v int) { + st.mutex.Lock() + defer st.mutex.Unlock() + st.config.Cache.GTS.ListEntryMaxSize = v + st.reloadToViper() +} + +// CacheGTSListEntryMaxSizeFlag returns the flag name for the 'Cache.GTS.ListEntryMaxSize' field +func CacheGTSListEntryMaxSizeFlag() string { return "cache-gts-list-entry-max-size" } + +// GetCacheGTSListEntryMaxSize safely fetches the value for global configuration 'Cache.GTS.ListEntryMaxSize' field +func GetCacheGTSListEntryMaxSize() int { return global.GetCacheGTSListEntryMaxSize() } + +// SetCacheGTSListEntryMaxSize safely sets the value for global configuration 'Cache.GTS.ListEntryMaxSize' field +func SetCacheGTSListEntryMaxSize(v int) { global.SetCacheGTSListEntryMaxSize(v) } + +// GetCacheGTSListEntryTTL safely fetches the Configuration value for state's 'Cache.GTS.ListEntryTTL' field +func (st *ConfigState) GetCacheGTSListEntryTTL() (v time.Duration) { + st.mutex.Lock() + v = st.config.Cache.GTS.ListEntryTTL + st.mutex.Unlock() + return +} + +// SetCacheGTSListEntryTTL safely sets the Configuration value for state's 'Cache.GTS.ListEntryTTL' field +func (st *ConfigState) SetCacheGTSListEntryTTL(v time.Duration) { + st.mutex.Lock() + defer st.mutex.Unlock() + st.config.Cache.GTS.ListEntryTTL = v + st.reloadToViper() +} + +// CacheGTSListEntryTTLFlag returns the flag name for the 'Cache.GTS.ListEntryTTL' field +func CacheGTSListEntryTTLFlag() string { return "cache-gts-list-entry-ttl" } + +// GetCacheGTSListEntryTTL safely fetches the value for global configuration 'Cache.GTS.ListEntryTTL' field +func GetCacheGTSListEntryTTL() time.Duration { return global.GetCacheGTSListEntryTTL() } + +// SetCacheGTSListEntryTTL safely sets the value for global configuration 'Cache.GTS.ListEntryTTL' field +func SetCacheGTSListEntryTTL(v time.Duration) { global.SetCacheGTSListEntryTTL(v) } + +// GetCacheGTSListEntrySweepFreq safely fetches the Configuration value for state's 'Cache.GTS.ListEntrySweepFreq' field +func (st *ConfigState) GetCacheGTSListEntrySweepFreq() (v time.Duration) { + st.mutex.Lock() + v = st.config.Cache.GTS.ListEntrySweepFreq + st.mutex.Unlock() + return +} + +// SetCacheGTSListEntrySweepFreq safely sets the Configuration value for state's 'Cache.GTS.ListEntrySweepFreq' field +func (st *ConfigState) SetCacheGTSListEntrySweepFreq(v time.Duration) { + st.mutex.Lock() + defer st.mutex.Unlock() + st.config.Cache.GTS.ListEntrySweepFreq = v + st.reloadToViper() +} + +// CacheGTSListEntrySweepFreqFlag returns the flag name for the 'Cache.GTS.ListEntrySweepFreq' field +func CacheGTSListEntrySweepFreqFlag() string { return "cache-gts-list-entry-sweep-freq" } + +// GetCacheGTSListEntrySweepFreq safely fetches the value for global configuration 'Cache.GTS.ListEntrySweepFreq' field +func GetCacheGTSListEntrySweepFreq() time.Duration { return global.GetCacheGTSListEntrySweepFreq() } + +// SetCacheGTSListEntrySweepFreq safely sets the value for global configuration 'Cache.GTS.ListEntrySweepFreq' field +func SetCacheGTSListEntrySweepFreq(v time.Duration) { global.SetCacheGTSListEntrySweepFreq(v) } + // GetCacheGTSMediaMaxSize safely fetches the Configuration value for state's 'Cache.GTS.MediaMaxSize' field func (st *ConfigState) GetCacheGTSMediaMaxSize() (v int) { st.mutex.Lock() |