diff options
Diffstat (limited to 'internal/config')
-rw-r--r-- | internal/config/config.go | 4 | ||||
-rw-r--r-- | internal/config/defaults.go | 4 | ||||
-rw-r--r-- | internal/config/helpers.gen.go | 75 |
3 files changed, 83 insertions, 0 deletions
diff --git a/internal/config/config.go b/internal/config/config.go index a7a36eebf..f7a59d760 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -207,6 +207,10 @@ type GTSCacheConfiguration struct { UserMaxSize int `name:"user-max-size"` UserTTL time.Duration `name:"user-ttl"` UserSweepFreq time.Duration `name:"user-sweep-freq"` + + WebfingerMaxSize int `name:"webfinger-max-size"` + WebfingerTTL time.Duration `name:"webfinger-ttl"` + WebfingerSweepFreq time.Duration `name:"webfinger-sweep-freq"` } // MarshalMap will marshal current Configuration into a map structure (useful for JSON/TOML/YAML). diff --git a/internal/config/defaults.go b/internal/config/defaults.go index 7d2427ee7..418858827 100644 --- a/internal/config/defaults.go +++ b/internal/config/defaults.go @@ -166,6 +166,10 @@ var Defaults = Configuration{ UserMaxSize: 100, UserTTL: time.Minute * 5, UserSweepFreq: time.Second * 30, + + WebfingerMaxSize: 250, + WebfingerTTL: time.Hour * 24, + WebfingerSweepFreq: time.Minute * 15, }, }, diff --git a/internal/config/helpers.gen.go b/internal/config/helpers.gen.go index b021ed617..14fa72b24 100644 --- a/internal/config/helpers.gen.go +++ b/internal/config/helpers.gen.go @@ -3003,6 +3003,81 @@ func GetCacheGTSUserSweepFreq() time.Duration { return global.GetCacheGTSUserSwe // SetCacheGTSUserSweepFreq safely sets the value for global configuration 'Cache.GTS.UserSweepFreq' field func SetCacheGTSUserSweepFreq(v time.Duration) { global.SetCacheGTSUserSweepFreq(v) } +// GetCacheGTSWebfingerMaxSize safely fetches the Configuration value for state's 'Cache.GTS.WebfingerMaxSize' field +func (st *ConfigState) GetCacheGTSWebfingerMaxSize() (v int) { + st.mutex.Lock() + v = st.config.Cache.GTS.WebfingerMaxSize + st.mutex.Unlock() + return +} + +// SetCacheGTSWebfingerMaxSize safely sets the Configuration value for state's 'Cache.GTS.WebfingerMaxSize' field +func (st *ConfigState) SetCacheGTSWebfingerMaxSize(v int) { + st.mutex.Lock() + defer st.mutex.Unlock() + st.config.Cache.GTS.WebfingerMaxSize = v + st.reloadToViper() +} + +// CacheGTSWebfingerMaxSizeFlag returns the flag name for the 'Cache.GTS.WebfingerMaxSize' field +func CacheGTSWebfingerMaxSizeFlag() string { return "cache-gts-webfinger-max-size" } + +// GetCacheGTSWebfingerMaxSize safely fetches the value for global configuration 'Cache.GTS.WebfingerMaxSize' field +func GetCacheGTSWebfingerMaxSize() int { return global.GetCacheGTSWebfingerMaxSize() } + +// SetCacheGTSWebfingerMaxSize safely sets the value for global configuration 'Cache.GTS.WebfingerMaxSize' field +func SetCacheGTSWebfingerMaxSize(v int) { global.SetCacheGTSWebfingerMaxSize(v) } + +// GetCacheGTSWebfingerTTL safely fetches the Configuration value for state's 'Cache.GTS.WebfingerTTL' field +func (st *ConfigState) GetCacheGTSWebfingerTTL() (v time.Duration) { + st.mutex.Lock() + v = st.config.Cache.GTS.WebfingerTTL + st.mutex.Unlock() + return +} + +// SetCacheGTSWebfingerTTL safely sets the Configuration value for state's 'Cache.GTS.WebfingerTTL' field +func (st *ConfigState) SetCacheGTSWebfingerTTL(v time.Duration) { + st.mutex.Lock() + defer st.mutex.Unlock() + st.config.Cache.GTS.WebfingerTTL = v + st.reloadToViper() +} + +// CacheGTSWebfingerTTLFlag returns the flag name for the 'Cache.GTS.WebfingerTTL' field +func CacheGTSWebfingerTTLFlag() string { return "cache-gts-webfinger-ttl" } + +// GetCacheGTSWebfingerTTL safely fetches the value for global configuration 'Cache.GTS.WebfingerTTL' field +func GetCacheGTSWebfingerTTL() time.Duration { return global.GetCacheGTSWebfingerTTL() } + +// SetCacheGTSWebfingerTTL safely sets the value for global configuration 'Cache.GTS.WebfingerTTL' field +func SetCacheGTSWebfingerTTL(v time.Duration) { global.SetCacheGTSWebfingerTTL(v) } + +// GetCacheGTSWebfingerSweepFreq safely fetches the Configuration value for state's 'Cache.GTS.WebfingerSweepFreq' field +func (st *ConfigState) GetCacheGTSWebfingerSweepFreq() (v time.Duration) { + st.mutex.Lock() + v = st.config.Cache.GTS.WebfingerSweepFreq + st.mutex.Unlock() + return +} + +// SetCacheGTSWebfingerSweepFreq safely sets the Configuration value for state's 'Cache.GTS.WebfingerSweepFreq' field +func (st *ConfigState) SetCacheGTSWebfingerSweepFreq(v time.Duration) { + st.mutex.Lock() + defer st.mutex.Unlock() + st.config.Cache.GTS.WebfingerSweepFreq = v + st.reloadToViper() +} + +// CacheGTSWebfingerSweepFreqFlag returns the flag name for the 'Cache.GTS.WebfingerSweepFreq' field +func CacheGTSWebfingerSweepFreqFlag() string { return "cache-gts-webfinger-sweep-freq" } + +// GetCacheGTSWebfingerSweepFreq safely fetches the value for global configuration 'Cache.GTS.WebfingerSweepFreq' field +func GetCacheGTSWebfingerSweepFreq() time.Duration { return global.GetCacheGTSWebfingerSweepFreq() } + +// SetCacheGTSWebfingerSweepFreq safely sets the value for global configuration 'Cache.GTS.WebfingerSweepFreq' field +func SetCacheGTSWebfingerSweepFreq(v time.Duration) { global.SetCacheGTSWebfingerSweepFreq(v) } + // GetAdminAccountUsername safely fetches the Configuration value for state's 'AdminAccountUsername' field func (st *ConfigState) GetAdminAccountUsername() (v string) { st.mutex.Lock() |