diff --git a/example/config.yaml b/example/config.yaml index 7e02a702..37ee84c0 100644 --- a/example/config.yaml +++ b/example/config.yaml @@ -164,6 +164,61 @@ db-tls-mode: "disable" # Default: "" db-tls-ca-cert: "" +cache: + gts: + ########################### + #### DATABASE CACHES ###### + ########################### + # + # Database cache configuration: + # + # Allows configuration of caches used + # when loading GTS models from the database. + # + # max-size = maximum cached objects count + # ttl = cached object lifetime + # sweep-freq = frequency to look for stale cache objects + + account-max-size: 100 + account-ttl: "5m" + account-sweep-freq: "10s" + + block-max-size: 100 + block-ttl: "5m" + block-sweep-freq: "10s" + + domain-block-max-size: 1000 + domain-block-ttl: "24h" + domain-block-sweep-freq: "1m" + + emoji-max-size: 500 + emoji-ttl: "5m" + emoji-sweep-freq: "10s" + + emoji-category-max-size: 100 + emoji-category-ttl: "5m" + emoji-category-sweep-freq: "10s" + + mention-max-size: 500 + mention-ttl: "5m" + mention-sweep-freq: "10s" + + notification-max-size: 500 + notification-ttl: "5m" + notification-sweep-freq: "10s" + + status-max-size: 500 + status-ttl: "5m" + status-sweep-freq: "10s" + + tombstone-max-size: 100 + tombstone-ttl: "5m" + tombstone-sweep-freq: "10s" + + user-max-size: 100 + user-ttl: "5m" + user-sweep-freq: "10s" + ###################### ##### WEB CONFIG ##### ###################### diff --git a/internal/cache/gts.go b/internal/cache/gts.go index 97a4f863..6083b869 100644 --- a/internal/cache/gts.go +++ b/internal/cache/gts.go @@ -99,34 +99,34 @@ func (c *gtsCaches) Init() { func (c *gtsCaches) Start() { tryUntil("starting gtsmodel.Account cache", 5, func() bool { - return c.account.Start(config.GetCacheAccountSweepFreq()) + return c.account.Start(config.GetCacheGTSAccountSweepFreq()) }) tryUntil("starting gtsmodel.Block cache", 5, func() bool { - return c.block.Start(config.GetCacheBlockSweepFreq()) + return c.block.Start(config.GetCacheGTSBlockSweepFreq()) }) tryUntil("starting gtsmodel.DomainBlock cache", 5, func() bool { - return c.domainBlock.Start(config.GetCacheDomainBlockSweepFreq()) + return c.domainBlock.Start(config.GetCacheGTSDomainBlockSweepFreq()) }) tryUntil("starting gtsmodel.Emoji cache", 5, func() bool { - return c.emoji.Start(config.GetCacheEmojiSweepFreq()) + return c.emoji.Start(config.GetCacheGTSEmojiSweepFreq()) }) tryUntil("starting gtsmodel.EmojiCategory cache", 5, func() bool { - return c.emojiCategory.Start(config.GetCacheEmojiCategorySweepFreq()) + return c.emojiCategory.Start(config.GetCacheGTSEmojiCategorySweepFreq()) }) tryUntil("starting gtsmodel.Mention cache", 5, func() bool { - return c.mention.Start(config.GetCacheMentionSweepFreq()) + return c.mention.Start(config.GetCacheGTSMentionSweepFreq()) }) tryUntil("starting gtsmodel.Notification cache", 5, func() bool { - return c.notification.Start(config.GetCacheNotificationSweepFreq()) + return c.notification.Start(config.GetCacheGTSNotificationSweepFreq()) }) tryUntil("starting gtsmodel.Status cache", 5, func() bool { - return c.status.Start(config.GetCacheStatusSweepFreq()) + return c.status.Start(config.GetCacheGTSStatusSweepFreq()) }) tryUntil("starting gtsmodel.Tombstone cache", 5, func() bool { - return c.tombstone.Start(config.GetCacheTombstoneSweepFreq()) + return c.tombstone.Start(config.GetCacheGTSTombstoneSweepFreq()) }) tryUntil("starting gtsmodel.User cache", 5, func() bool { - return c.user.Start(config.GetCacheUserSweepFreq()) + return c.user.Start(config.GetCacheGTSUserSweepFreq()) }) } @@ -194,8 +194,8 @@ func (c *gtsCaches) initAccount() { a2 := new(gtsmodel.Account) *a2 = *a1 return a2 - }, config.GetCacheAccountMaxSize()) - c.account.SetTTL(config.GetCacheAccountTTL(), true) + }, config.GetCacheGTSAccountMaxSize()) + c.account.SetTTL(config.GetCacheGTSAccountTTL(), true) } func (c *gtsCaches) initBlock() { @@ -207,8 +207,8 @@ func (c *gtsCaches) initBlock() { b2 := new(gtsmodel.Block) *b2 = *b1 return b2 - }, config.GetCacheBlockMaxSize()) - c.block.SetTTL(config.GetCacheBlockTTL(), true) + }, config.GetCacheGTSBlockMaxSize()) + c.block.SetTTL(config.GetCacheGTSBlockTTL(), true) } func (c *gtsCaches) initDomainBlock() { @@ -218,8 +218,8 @@ func (c *gtsCaches) initDomainBlock() { d2 := new(gtsmodel.DomainBlock) *d2 = *d1 return d2 - }, config.GetCacheDomainBlockMaxSize()) - c.domainBlock.SetTTL(config.GetCacheDomainBlockTTL(), true) + }, config.GetCacheGTSDomainBlockMaxSize()) + c.domainBlock.SetTTL(config.GetCacheGTSDomainBlockTTL(), true) } func (c *gtsCaches) initEmoji() { @@ -232,8 +232,8 @@ func (c *gtsCaches) initEmoji() { e2 := new(gtsmodel.Emoji) *e2 = *e1 return e2 - }, config.GetCacheEmojiMaxSize()) - c.emoji.SetTTL(config.GetCacheEmojiTTL(), true) + }, config.GetCacheGTSEmojiMaxSize()) + c.emoji.SetTTL(config.GetCacheGTSEmojiTTL(), true) } func (c *gtsCaches) initEmojiCategory() { @@ -244,8 +244,8 @@ func (c *gtsCaches) initEmojiCategory() { c2 := new(gtsmodel.EmojiCategory) *c2 = *c1 return c2 - }, config.GetCacheEmojiCategoryMaxSize()) - c.emojiCategory.SetTTL(config.GetCacheEmojiCategoryTTL(), true) + }, config.GetCacheGTSEmojiCategoryMaxSize()) + c.emojiCategory.SetTTL(config.GetCacheGTSEmojiCategoryTTL(), true) } func (c *gtsCaches) initMention() { @@ -255,8 +255,8 @@ func (c *gtsCaches) initMention() { m2 := new(gtsmodel.Mention) *m2 = *m1 return m2 - }, config.GetCacheMentionMaxSize()) - c.mention.SetTTL(config.GetCacheMentionTTL(), true) + }, config.GetCacheGTSMentionMaxSize()) + c.mention.SetTTL(config.GetCacheGTSMentionTTL(), true) } func (c *gtsCaches) initNotification() { @@ -266,8 +266,8 @@ func (c *gtsCaches) initNotification() { n2 := new(gtsmodel.Notification) *n2 = *n1 return n2 - }, config.GetCacheNotificationMaxSize()) - c.notification.SetTTL(config.GetCacheNotificationTTL(), true) + }, config.GetCacheGTSNotificationMaxSize()) + c.notification.SetTTL(config.GetCacheGTSNotificationTTL(), true) } func (c *gtsCaches) initStatus() { @@ -279,8 +279,8 @@ func (c *gtsCaches) initStatus() { s2 := new(gtsmodel.Status) *s2 = *s1 return s2 - }, config.GetCacheStatusMaxSize()) - c.status.SetTTL(config.GetCacheStatusTTL(), true) + }, config.GetCacheGTSStatusMaxSize()) + c.status.SetTTL(config.GetCacheGTSStatusTTL(), true) } // initTombstone will initialize the gtsmodel.Tombstone cache. @@ -292,8 +292,8 @@ func (c *gtsCaches) initTombstone() { t2 := new(gtsmodel.Tombstone) *t2 = *t1 return t2 - }, config.GetCacheTombstoneMaxSize()) - c.tombstone.SetTTL(config.GetCacheTombstoneTTL(), true) + }, config.GetCacheGTSTombstoneMaxSize()) + c.tombstone.SetTTL(config.GetCacheGTSTombstoneTTL(), true) } func (c *gtsCaches) initUser() { @@ -307,6 +307,6 @@ func (c *gtsCaches) initUser() { u2 := new(gtsmodel.User) *u2 = *u1 return u2 - }, config.GetCacheUserMaxSize()) - c.user.SetTTL(config.GetCacheUserTTL(), true) + }, config.GetCacheGTSUserMaxSize()) + c.user.SetTTL(config.GetCacheGTSUserTTL(), true) } diff --git a/internal/config/config.go b/internal/config/config.go index 4b9f5301..8a2c041e 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -131,7 +131,7 @@ type Configuration struct { AdvancedRateLimitRequests int `name:"advanced-rate-limit-requests" usage:"Amount of HTTP requests to permit within a 5 minute window. 0 or less turns rate limiting off."` // Cache configuration vars. - Cache CacheConfig `name:"cache"` + Cache CacheConfiguration `name:"cache"` // TODO: move these elsewhere, these are more ephemeral vs long-running flags like above AdminAccountUsername string `name:"username" usage:"the username to create/delete/etc"` @@ -141,7 +141,11 @@ type Configuration struct { AdminMediaPruneDryRun bool `name:"dry-run" usage:"perform a dry run and only log number of items eligible for pruning"` } -type CacheConfig struct { +type CacheConfiguration struct { + GTS GTSCacheConfiguration `name:"gts"` +} + +type GTSCacheConfiguration struct { AccountMaxSize int `name:"account-max-size"` AccountTTL time.Duration `name:"account-ttl"` AccountSweepFreq time.Duration `name:"account-sweep-freq"` diff --git a/internal/config/defaults.go b/internal/config/defaults.go index ecc008dc..4fd78361 100644 --- a/internal/config/defaults.go +++ b/internal/config/defaults.go @@ -107,45 +107,47 @@ var Defaults = Configuration{ AdvancedCookiesSamesite: "lax", AdvancedRateLimitRequests: 1000, // per 5 minutes - Cache: CacheConfig{ - AccountMaxSize: 100, - AccountTTL: time.Minute * 5, - AccountSweepFreq: time.Second * 10, + Cache: CacheConfiguration{ + GTS: GTSCacheConfiguration{ + AccountMaxSize: 100, + AccountTTL: time.Minute * 5, + AccountSweepFreq: time.Second * 10, - BlockMaxSize: 100, - BlockTTL: time.Minute * 5, - BlockSweepFreq: time.Second * 10, + BlockMaxSize: 100, + BlockTTL: time.Minute * 5, + BlockSweepFreq: time.Second * 10, - DomainBlockMaxSize: 1000, - DomainBlockTTL: time.Hour * 24, - DomainBlockSweepFreq: time.Minute, + DomainBlockMaxSize: 1000, + DomainBlockTTL: time.Hour * 24, + DomainBlockSweepFreq: time.Minute, - EmojiMaxSize: 500, - EmojiTTL: time.Minute * 5, - EmojiSweepFreq: time.Second * 10, + EmojiMaxSize: 500, + EmojiTTL: time.Minute * 5, + EmojiSweepFreq: time.Second * 10, - EmojiCategoryMaxSize: 100, - EmojiCategoryTTL: time.Minute * 5, - EmojiCategorySweepFreq: time.Second * 10, + EmojiCategoryMaxSize: 100, + EmojiCategoryTTL: time.Minute * 5, + EmojiCategorySweepFreq: time.Second * 10, - MentionMaxSize: 500, - MentionTTL: time.Minute * 5, - MentionSweepFreq: time.Second * 10, + MentionMaxSize: 500, + MentionTTL: time.Minute * 5, + MentionSweepFreq: time.Second * 10, - NotificationMaxSize: 500, - NotificationTTL: time.Minute * 5, - NotificationSweepFreq: time.Second * 10, + NotificationMaxSize: 500, + NotificationTTL: time.Minute * 5, + NotificationSweepFreq: time.Second * 10, - StatusMaxSize: 500, - StatusTTL: time.Minute * 5, - StatusSweepFreq: time.Second * 10, + StatusMaxSize: 500, + StatusTTL: time.Minute * 5, + StatusSweepFreq: time.Second * 10, - TombstoneMaxSize: 100, - TombstoneTTL: time.Minute * 5, - TombstoneSweepFreq: time.Second * 10, + TombstoneMaxSize: 100, + TombstoneTTL: time.Minute * 5, + TombstoneSweepFreq: time.Second * 10, - UserMaxSize: 100, - UserTTL: time.Minute * 5, - UserSweepFreq: time.Second * 10, + UserMaxSize: 100, + UserTTL: time.Minute * 5, + UserSweepFreq: time.Second * 10, + }, }, } diff --git a/internal/config/gen/gen.go b/internal/config/gen/gen.go index 47badd73..9065528e 100644 --- a/internal/config/gen/gen.go +++ b/internal/config/gen/gen.go @@ -26,8 +26,9 @@ import ( "os/exec" "reflect" "strings" + "time" - "github.com/superseriousbusiness/gotosocial/internal/config" + "codeberg.org/gruf/go-bytesize" ) const license = `/* @@ -49,6 +50,149 @@ const license = `/* */ ` +type Configuration struct { + LogLevel string `name:"log-level" usage:"Log level to run at: [trace, debug, info, warn, fatal]"` + LogDbQueries bool `name:"log-db-queries" usage:"Log database queries verbosely when log-level is trace or debug"` + ApplicationName string `name:"application-name" usage:"Name of the application, used in various places internally"` + LandingPageUser string `name:"landing-page-user" usage:"the user that should be shown on the instance's landing page"` + ConfigPath string `name:"config-path" usage:"Path to a file containing gotosocial configuration. Values set in this file will be overwritten by values set as env vars or arguments"` + Host string `name:"host" usage:"Hostname to use for the server (eg., example.org, gotosocial.whatever.com). DO NOT change this on a server that's already run!"` + AccountDomain string `name:"account-domain" usage:"Domain to use in account names (eg., example.org, whatever.com). If not set, will default to the setting for host. DO NOT change this on a server that's already run!"` + Protocol string `name:"protocol" usage:"Protocol to use for the REST api of the server (only use http if you are debugging or behind a reverse proxy!)"` + BindAddress string `name:"bind-address" usage:"Bind address to use for the GoToSocial server (eg., 0.0.0.0, 172.138.0.9, [::], localhost). For ipv6, enclose the address in square brackets, eg [2001:db8::fed1]. Default binds to all interfaces."` + Port int `name:"port" usage:"Port to use for GoToSocial. Change this to 443 if you're running the binary directly on the host machine."` + TrustedProxies []string `name:"trusted-proxies" usage:"Proxies to trust when parsing x-forwarded headers into real IPs."` + SoftwareVersion string `name:"software-version" usage:""` + + DbType string `name:"db-type" usage:"Database type: eg., postgres"` + DbAddress string `name:"db-address" usage:"Database ipv4 address, hostname, or filename"` + DbPort int `name:"db-port" usage:"Database port"` + DbUser string `name:"db-user" usage:"Database username"` + DbPassword string `name:"db-password" usage:"Database password"` + DbDatabase string `name:"db-database" usage:"Database name"` + DbTLSMode string `name:"db-tls-mode" usage:"Database tls mode"` + DbTLSCACert string `name:"db-tls-ca-cert" usage:"Path to CA cert for db tls connection"` + + WebTemplateBaseDir string `name:"web-template-base-dir" usage:"Basedir for html templating files for rendering pages and composing emails."` + WebAssetBaseDir string `name:"web-asset-base-dir" usage:"Directory to serve static assets from, accessible at example.org/assets/"` + + InstanceExposePeers bool `name:"instance-expose-peers" usage:"Allow unauthenticated users to query /api/v1/instance/peers?filter=open"` + InstanceExposeSuspended bool `name:"instance-expose-suspended" usage:"Expose suspended instances via web UI, and allow unauthenticated users to query /api/v1/instance/peers?filter=suspended"` + InstanceExposePublicTimeline bool `name:"instance-expose-public-timeline" usage:"Allow unauthenticated users to query /api/v1/timelines/public"` + InstanceDeliverToSharedInboxes bool `name:"instance-deliver-to-shared-inboxes" usage:"Deliver federated messages to shared inboxes, if they're available."` + + AccountsRegistrationOpen bool `name:"accounts-registration-open" usage:"Allow anyone to submit an account signup request. If false, server will be invite-only."` + AccountsApprovalRequired bool `name:"accounts-approval-required" usage:"Do account signups require approval by an admin or moderator before user can log in? If false, new registrations will be automatically approved."` + AccountsReasonRequired bool `name:"accounts-reason-required" usage:"Do new account signups require a reason to be submitted on registration?"` + AccountsAllowCustomCSS bool `name:"accounts-allow-custom-css" usage:"Allow accounts to enable custom CSS for their profile pages and statuses."` + + MediaImageMaxSize bytesize.Size `name:"media-image-max-size" usage:"Max size of accepted images in bytes"` + MediaVideoMaxSize bytesize.Size `name:"media-video-max-size" usage:"Max size of accepted videos in bytes"` + MediaDescriptionMinChars int `name:"media-description-min-chars" usage:"Min required chars for an image description"` + MediaDescriptionMaxChars int `name:"media-description-max-chars" usage:"Max permitted chars for an image description"` + MediaRemoteCacheDays int `name:"media-remote-cache-days" usage:"Number of days to locally cache media from remote instances. If set to 0, remote media will be kept indefinitely."` + MediaEmojiLocalMaxSize bytesize.Size `name:"media-emoji-local-max-size" usage:"Max size in bytes of emojis uploaded to this instance via the admin API."` + MediaEmojiRemoteMaxSize bytesize.Size `name:"media-emoji-remote-max-size" usage:"Max size in bytes of emojis to download from other instances."` + + StorageBackend string `name:"storage-backend" usage:"Storage backend to use for media attachments"` + StorageLocalBasePath string `name:"storage-local-base-path" usage:"Full path to an already-created directory where gts should store/retrieve media files. Subfolders will be created within this dir."` + StorageS3Endpoint string `name:"storage-s3-endpoint" usage:"S3 Endpoint URL (e.g 'minio.example.org:9000')"` + StorageS3AccessKey string `name:"storage-s3-access-key" usage:"S3 Access Key"` + StorageS3SecretKey string `name:"storage-s3-secret-key" usage:"S3 Secret Key"` + StorageS3UseSSL bool `name:"storage-s3-use-ssl" usage:"Use SSL for S3 connections. Only set this to 'false' when testing locally"` + StorageS3BucketName string `name:"storage-s3-bucket" usage:"Place blobs in this bucket"` + StorageS3Proxy bool `name:"storage-s3-proxy" usage:"Proxy S3 contents through GoToSocial instead of redirecting to a presigned URL"` + + StatusesMaxChars int `name:"statuses-max-chars" usage:"Max permitted characters for posted statuses"` + StatusesCWMaxChars int `name:"statuses-cw-max-chars" usage:"Max permitted characters for content/spoiler warnings on statuses"` + StatusesPollMaxOptions int `name:"statuses-poll-max-options" usage:"Max amount of options permitted on a poll"` + StatusesPollOptionMaxChars int `name:"statuses-poll-option-max-chars" usage:"Max amount of characters for a poll option"` + StatusesMediaMaxFiles int `name:"statuses-media-max-files" usage:"Maximum number of media files/attachments per status"` + + LetsEncryptEnabled bool `name:"letsencrypt-enabled" usage:"Enable letsencrypt TLS certs for this server. If set to true, then cert dir also needs to be set (or take the default)."` + LetsEncryptPort int `name:"letsencrypt-port" usage:"Port to listen on for letsencrypt certificate challenges. Must not be the same as the GtS webserver/API port."` + LetsEncryptCertDir string `name:"letsencrypt-cert-dir" usage:"Directory to store acquired letsencrypt certificates."` + LetsEncryptEmailAddress string `name:"letsencrypt-email-address" usage:"Email address to use when requesting letsencrypt certs. Will receive updates on cert expiry etc."` + + OIDCEnabled bool `name:"oidc-enabled" usage:"Enabled OIDC authorization for this instance. If set to true, then the other OIDC flags must also be set."` + OIDCIdpName string `name:"oidc-idp-name" usage:"Name of the OIDC identity provider. Will be shown to the user when logging in."` + OIDCSkipVerification bool `name:"oidc-skip-verification" usage:"Skip verification of tokens returned by the OIDC provider. Should only be set to 'true' for testing purposes, never in a production environment!"` + OIDCIssuer string `name:"oidc-issuer" usage:"Address of the OIDC issuer. Should be the web address, including protocol, at which the issuer can be reached. Eg., 'https://example.org/auth'"` + OIDCClientID string `name:"oidc-client-id" usage:"ClientID of GoToSocial, as registered with the OIDC provider."` + OIDCClientSecret string `name:"oidc-client-secret" usage:"ClientSecret of GoToSocial, as registered with the OIDC provider."` + OIDCScopes []string `name:"oidc-scopes" usage:"OIDC scopes."` + OIDCLinkExisting bool `name:"oidc-link-existing" usage:"link existing user accounts to OIDC logins based on the stored email value"` + + SMTPHost string `name:"smtp-host" usage:"Host of the smtp server. Eg., 'smtp.eu.mailgun.org'"` + SMTPPort int `name:"smtp-port" usage:"Port of the smtp server. Eg., 587"` + SMTPUsername string `name:"smtp-username" usage:"Username to authenticate with the smtp server as. Eg., 'postmaster@mail.example.org'"` + SMTPPassword string `name:"smtp-password" usage:"Password to pass to the smtp server."` + SMTPFrom string `name:"smtp-from" usage:"Address to use as the 'from' field of the email. Eg., 'gotosocial@example.org'"` + + SyslogEnabled bool `name:"syslog-enabled" usage:"Enable the syslog logging hook. Logs will be mirrored to the configured destination."` + SyslogProtocol string `name:"syslog-protocol" usage:"Protocol to use when directing logs to syslog. Leave empty to connect to local syslog."` + SyslogAddress string `name:"syslog-address" usage:"Address:port to send syslog logs to. Leave empty to connect to local syslog."` + + AdvancedCookiesSamesite string `name:"advanced-cookies-samesite" usage:"'strict' or 'lax', see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie/SameSite"` + AdvancedRateLimitRequests int `name:"advanced-rate-limit-requests" usage:"Amount of HTTP requests to permit within a 5 minute window. 0 or less turns rate limiting off."` + + // Cache configuration vars. + Cache CacheConfiguration `name:"cache"` + + // TODO: move these elsewhere, these are more ephemeral vs long-running flags like above + AdminAccountUsername string `name:"username" usage:"the username to create/delete/etc"` + AdminAccountEmail string `name:"email" usage:"the email address of this account"` + AdminAccountPassword string `name:"password" usage:"the password to set for this account"` + AdminTransPath string `name:"path" usage:"the path of the file to import from/export to"` + AdminMediaPruneDryRun bool `name:"dry-run" usage:"perform a dry run and only log number of items eligible for pruning"` +} + +type CacheConfiguration struct { + GTS GTSCacheConfiguration `name:"gts"` +} + +type GTSCacheConfiguration struct { + AccountMaxSize int `name:"account-max-size"` + AccountTTL time.Duration `name:"account-ttl"` + AccountSweepFreq time.Duration `name:"account-sweep-freq"` + + BlockMaxSize int `name:"block-max-size"` + BlockTTL time.Duration `name:"block-ttl"` + BlockSweepFreq time.Duration `name:"block-sweep-freq"` + + DomainBlockMaxSize int `name:"domain-block-max-size"` + DomainBlockTTL time.Duration `name:"domain-block-ttl"` + DomainBlockSweepFreq time.Duration `name:"domain-block-sweep-freq"` + + EmojiMaxSize int `name:"emoji-max-size"` + EmojiTTL time.Duration `name:"emoji-ttl"` + EmojiSweepFreq time.Duration `name:"emoji-sweep-freq"` + + EmojiCategoryMaxSize int `name:"emoji-category-max-size"` + EmojiCategoryTTL time.Duration `name:"emoji-category-ttl"` + EmojiCategorySweepFreq time.Duration `name:"emoji-category-sweep-freq"` + + MentionMaxSize int `name:"mention-max-size"` + MentionTTL time.Duration `name:"mention-ttl"` + MentionSweepFreq time.Duration `name:"mention-sweep-freq"` + + NotificationMaxSize int `name:"notification-max-size"` + NotificationTTL time.Duration `name:"notification-ttl"` + NotificationSweepFreq time.Duration `name:"notification-sweep-freq"` + + StatusMaxSize int `name:"status-max-size"` + StatusTTL time.Duration `name:"status-ttl"` + StatusSweepFreq time.Duration `name:"status-sweep-freq"` + + TombstoneMaxSize int `name:"tombstone-max-size"` + TombstoneTTL time.Duration `name:"tombstone-ttl"` + TombstoneSweepFreq time.Duration `name:"tombstone-sweep-freq"` + + UserMaxSize int `name:"user-max-size"` + UserTTL time.Duration `name:"user-ttl"` + UserSweepFreq time.Duration `name:"user-sweep-freq"` +} + func main() { var out string @@ -66,7 +210,7 @@ func main() { fmt.Fprint(output, license) fmt.Fprint(output, "package config\n\n") fmt.Fprint(output, "import \"codeberg.org/gruf/go-bytesize\"\n\n") - generateFields(output, nil, reflect.TypeOf(config.Configuration{})) + generateFields(output, nil, reflect.TypeOf(Configuration{})) _ = output.Close() _ = exec.Command("gofumports", "-w", out).Run() diff --git a/internal/config/helpers.gen.go b/internal/config/helpers.gen.go index cfd41baa..62894b4d 100644 --- a/internal/config/helpers.gen.go +++ b/internal/config/helpers.gen.go @@ -1824,755 +1824,759 @@ func GetAdvancedRateLimitRequests() int { return global.GetAdvancedRateLimitRequ // SetAdvancedRateLimitRequests safely sets the value for global configuration 'AdvancedRateLimitRequests' field func SetAdvancedRateLimitRequests(v int) { global.SetAdvancedRateLimitRequests(v) } -// GetCacheAccountMaxSize safely fetches the Configuration value for state's 'Cache.AccountMaxSize' field -func (st *ConfigState) GetCacheAccountMaxSize() (v int) { +// GetCacheGTSAccountMaxSize safely fetches the Configuration value for state's 'Cache.GTS.AccountMaxSize' field +func (st *ConfigState) GetCacheGTSAccountMaxSize() (v int) { st.mutex.Lock() - v = st.config.Cache.AccountMaxSize + v = st.config.Cache.GTS.AccountMaxSize st.mutex.Unlock() return } -// SetCacheAccountMaxSize safely sets the Configuration value for state's 'Cache.AccountMaxSize' field -func (st *ConfigState) SetCacheAccountMaxSize(v int) { +// SetCacheGTSAccountMaxSize safely sets the Configuration value for state's 'Cache.GTS.AccountMaxSize' field +func (st *ConfigState) SetCacheGTSAccountMaxSize(v int) { st.mutex.Lock() defer st.mutex.Unlock() - st.config.Cache.AccountMaxSize = v + st.config.Cache.GTS.AccountMaxSize = v st.reloadToViper() } -// CacheAccountMaxSizeFlag returns the flag name for the 'Cache.AccountMaxSize' field -func CacheAccountMaxSizeFlag() string { return "cache-account-max-size" } +// CacheGTSAccountMaxSizeFlag returns the flag name for the 'Cache.GTS.AccountMaxSize' field +func CacheGTSAccountMaxSizeFlag() string { return "cache-gts-account-max-size" } -// GetCacheAccountMaxSize safely fetches the value for global configuration 'Cache.AccountMaxSize' field -func GetCacheAccountMaxSize() int { return global.GetCacheAccountMaxSize() } +// GetCacheGTSAccountMaxSize safely fetches the value for global configuration 'Cache.GTS.AccountMaxSize' field +func GetCacheGTSAccountMaxSize() int { return global.GetCacheGTSAccountMaxSize() } -// SetCacheAccountMaxSize safely sets the value for global configuration 'Cache.AccountMaxSize' field -func SetCacheAccountMaxSize(v int) { global.SetCacheAccountMaxSize(v) } +// SetCacheGTSAccountMaxSize safely sets the value for global configuration 'Cache.GTS.AccountMaxSize' field +func SetCacheGTSAccountMaxSize(v int) { global.SetCacheGTSAccountMaxSize(v) } -// GetCacheAccountTTL safely fetches the Configuration value for state's 'Cache.AccountTTL' field -func (st *ConfigState) GetCacheAccountTTL() (v time.Duration) { +// GetCacheGTSAccountTTL safely fetches the Configuration value for state's 'Cache.GTS.AccountTTL' field +func (st *ConfigState) GetCacheGTSAccountTTL() (v time.Duration) { st.mutex.Lock() - v = st.config.Cache.AccountTTL + v = st.config.Cache.GTS.AccountTTL st.mutex.Unlock() return } -// SetCacheAccountTTL safely sets the Configuration value for state's 'Cache.AccountTTL' field -func (st *ConfigState) SetCacheAccountTTL(v time.Duration) { +// SetCacheGTSAccountTTL safely sets the Configuration value for state's 'Cache.GTS.AccountTTL' field +func (st *ConfigState) SetCacheGTSAccountTTL(v time.Duration) { st.mutex.Lock() defer st.mutex.Unlock() - st.config.Cache.AccountTTL = v + st.config.Cache.GTS.AccountTTL = v st.reloadToViper() } -// CacheAccountTTLFlag returns the flag name for the 'Cache.AccountTTL' field -func CacheAccountTTLFlag() string { return "cache-account-ttl" } +// CacheGTSAccountTTLFlag returns the flag name for the 'Cache.GTS.AccountTTL' field +func CacheGTSAccountTTLFlag() string { return "cache-gts-account-ttl" } -// GetCacheAccountTTL safely fetches the value for global configuration 'Cache.AccountTTL' field -func GetCacheAccountTTL() time.Duration { return global.GetCacheAccountTTL() } +// GetCacheGTSAccountTTL safely fetches the value for global configuration 'Cache.GTS.AccountTTL' field +func GetCacheGTSAccountTTL() time.Duration { return global.GetCacheGTSAccountTTL() } -// SetCacheAccountTTL safely sets the value for global configuration 'Cache.AccountTTL' field -func SetCacheAccountTTL(v time.Duration) { global.SetCacheAccountTTL(v) } +// SetCacheGTSAccountTTL safely sets the value for global configuration 'Cache.GTS.AccountTTL' field +func SetCacheGTSAccountTTL(v time.Duration) { global.SetCacheGTSAccountTTL(v) } -// GetCacheAccountSweepFreq safely fetches the Configuration value for state's 'Cache.AccountSweepFreq' field -func (st *ConfigState) GetCacheAccountSweepFreq() (v time.Duration) { +// GetCacheGTSAccountSweepFreq safely fetches the Configuration value for state's 'Cache.GTS.AccountSweepFreq' field +func (st *ConfigState) GetCacheGTSAccountSweepFreq() (v time.Duration) { st.mutex.Lock() - v = st.config.Cache.AccountSweepFreq + v = st.config.Cache.GTS.AccountSweepFreq st.mutex.Unlock() return } -// SetCacheAccountSweepFreq safely sets the Configuration value for state's 'Cache.AccountSweepFreq' field -func (st *ConfigState) SetCacheAccountSweepFreq(v time.Duration) { +// SetCacheGTSAccountSweepFreq safely sets the Configuration value for state's 'Cache.GTS.AccountSweepFreq' field +func (st *ConfigState) SetCacheGTSAccountSweepFreq(v time.Duration) { st.mutex.Lock() defer st.mutex.Unlock() - st.config.Cache.AccountSweepFreq = v + st.config.Cache.GTS.AccountSweepFreq = v st.reloadToViper() } -// CacheAccountSweepFreqFlag returns the flag name for the 'Cache.AccountSweepFreq' field -func CacheAccountSweepFreqFlag() string { return "cache-account-sweep-freq" } +// CacheGTSAccountSweepFreqFlag returns the flag name for the 'Cache.GTS.AccountSweepFreq' field +func CacheGTSAccountSweepFreqFlag() string { return "cache-gts-account-sweep-freq" } -// GetCacheAccountSweepFreq safely fetches the value for global configuration 'Cache.AccountSweepFreq' field -func GetCacheAccountSweepFreq() time.Duration { return global.GetCacheAccountSweepFreq() } +// GetCacheGTSAccountSweepFreq safely fetches the value for global configuration 'Cache.GTS.AccountSweepFreq' field +func GetCacheGTSAccountSweepFreq() time.Duration { return global.GetCacheGTSAccountSweepFreq() } -// SetCacheAccountSweepFreq safely sets the value for global configuration 'Cache.AccountSweepFreq' field -func SetCacheAccountSweepFreq(v time.Duration) { global.SetCacheAccountSweepFreq(v) } +// SetCacheGTSAccountSweepFreq safely sets the value for global configuration 'Cache.GTS.AccountSweepFreq' field +func SetCacheGTSAccountSweepFreq(v time.Duration) { global.SetCacheGTSAccountSweepFreq(v) } -// GetCacheBlockMaxSize safely fetches the Configuration value for state's 'Cache.BlockMaxSize' field -func (st *ConfigState) GetCacheBlockMaxSize() (v int) { +// GetCacheGTSBlockMaxSize safely fetches the Configuration value for state's 'Cache.GTS.BlockMaxSize' field +func (st *ConfigState) GetCacheGTSBlockMaxSize() (v int) { st.mutex.Lock() - v = st.config.Cache.BlockMaxSize + v = st.config.Cache.GTS.BlockMaxSize st.mutex.Unlock() return } -// SetCacheBlockMaxSize safely sets the Configuration value for state's 'Cache.BlockMaxSize' field -func (st *ConfigState) SetCacheBlockMaxSize(v int) { +// SetCacheGTSBlockMaxSize safely sets the Configuration value for state's 'Cache.GTS.BlockMaxSize' field +func (st *ConfigState) SetCacheGTSBlockMaxSize(v int) { st.mutex.Lock() defer st.mutex.Unlock() - st.config.Cache.BlockMaxSize = v + st.config.Cache.GTS.BlockMaxSize = v st.reloadToViper() } -// CacheBlockMaxSizeFlag returns the flag name for the 'Cache.BlockMaxSize' field -func CacheBlockMaxSizeFlag() string { return "cache-block-max-size" } +// CacheGTSBlockMaxSizeFlag returns the flag name for the 'Cache.GTS.BlockMaxSize' field +func CacheGTSBlockMaxSizeFlag() string { return "cache-gts-block-max-size" } -// GetCacheBlockMaxSize safely fetches the value for global configuration 'Cache.BlockMaxSize' field -func GetCacheBlockMaxSize() int { return global.GetCacheBlockMaxSize() } +// GetCacheGTSBlockMaxSize safely fetches the value for global configuration 'Cache.GTS.BlockMaxSize' field +func GetCacheGTSBlockMaxSize() int { return global.GetCacheGTSBlockMaxSize() } -// SetCacheBlockMaxSize safely sets the value for global configuration 'Cache.BlockMaxSize' field -func SetCacheBlockMaxSize(v int) { global.SetCacheBlockMaxSize(v) } +// SetCacheGTSBlockMaxSize safely sets the value for global configuration 'Cache.GTS.BlockMaxSize' field +func SetCacheGTSBlockMaxSize(v int) { global.SetCacheGTSBlockMaxSize(v) } -// GetCacheBlockTTL safely fetches the Configuration value for state's 'Cache.BlockTTL' field -func (st *ConfigState) GetCacheBlockTTL() (v time.Duration) { +// GetCacheGTSBlockTTL safely fetches the Configuration value for state's 'Cache.GTS.BlockTTL' field +func (st *ConfigState) GetCacheGTSBlockTTL() (v time.Duration) { st.mutex.Lock() - v = st.config.Cache.BlockTTL + v = st.config.Cache.GTS.BlockTTL st.mutex.Unlock() return } -// SetCacheBlockTTL safely sets the Configuration value for state's 'Cache.BlockTTL' field -func (st *ConfigState) SetCacheBlockTTL(v time.Duration) { +// SetCacheGTSBlockTTL safely sets the Configuration value for state's 'Cache.GTS.BlockTTL' field +func (st *ConfigState) SetCacheGTSBlockTTL(v time.Duration) { st.mutex.Lock() defer st.mutex.Unlock() - st.config.Cache.BlockTTL = v + st.config.Cache.GTS.BlockTTL = v st.reloadToViper() } -// CacheBlockTTLFlag returns the flag name for the 'Cache.BlockTTL' field -func CacheBlockTTLFlag() string { return "cache-block-ttl" } +// CacheGTSBlockTTLFlag returns the flag name for the 'Cache.GTS.BlockTTL' field +func CacheGTSBlockTTLFlag() string { return "cache-gts-block-ttl" } -// GetCacheBlockTTL safely fetches the value for global configuration 'Cache.BlockTTL' field -func GetCacheBlockTTL() time.Duration { return global.GetCacheBlockTTL() } +// GetCacheGTSBlockTTL safely fetches the value for global configuration 'Cache.GTS.BlockTTL' field +func GetCacheGTSBlockTTL() time.Duration { return global.GetCacheGTSBlockTTL() } -// SetCacheBlockTTL safely sets the value for global configuration 'Cache.BlockTTL' field -func SetCacheBlockTTL(v time.Duration) { global.SetCacheBlockTTL(v) } +// SetCacheGTSBlockTTL safely sets the value for global configuration 'Cache.GTS.BlockTTL' field +func SetCacheGTSBlockTTL(v time.Duration) { global.SetCacheGTSBlockTTL(v) } -// GetCacheBlockSweepFreq safely fetches the Configuration value for state's 'Cache.BlockSweepFreq' field -func (st *ConfigState) GetCacheBlockSweepFreq() (v time.Duration) { +// GetCacheGTSBlockSweepFreq safely fetches the Configuration value for state's 'Cache.GTS.BlockSweepFreq' field +func (st *ConfigState) GetCacheGTSBlockSweepFreq() (v time.Duration) { st.mutex.Lock() - v = st.config.Cache.BlockSweepFreq + v = st.config.Cache.GTS.BlockSweepFreq st.mutex.Unlock() return } -// SetCacheBlockSweepFreq safely sets the Configuration value for state's 'Cache.BlockSweepFreq' field -func (st *ConfigState) SetCacheBlockSweepFreq(v time.Duration) { +// SetCacheGTSBlockSweepFreq safely sets the Configuration value for state's 'Cache.GTS.BlockSweepFreq' field +func (st *ConfigState) SetCacheGTSBlockSweepFreq(v time.Duration) { st.mutex.Lock() defer st.mutex.Unlock() - st.config.Cache.BlockSweepFreq = v + st.config.Cache.GTS.BlockSweepFreq = v st.reloadToViper() } -// CacheBlockSweepFreqFlag returns the flag name for the 'Cache.BlockSweepFreq' field -func CacheBlockSweepFreqFlag() string { return "cache-block-sweep-freq" } +// CacheGTSBlockSweepFreqFlag returns the flag name for the 'Cache.GTS.BlockSweepFreq' field +func CacheGTSBlockSweepFreqFlag() string { return "cache-gts-block-sweep-freq" } -// GetCacheBlockSweepFreq safely fetches the value for global configuration 'Cache.BlockSweepFreq' field -func GetCacheBlockSweepFreq() time.Duration { return global.GetCacheBlockSweepFreq() } +// GetCacheGTSBlockSweepFreq safely fetches the value for global configuration 'Cache.GTS.BlockSweepFreq' field +func GetCacheGTSBlockSweepFreq() time.Duration { return global.GetCacheGTSBlockSweepFreq() } -// SetCacheBlockSweepFreq safely sets the value for global configuration 'Cache.BlockSweepFreq' field -func SetCacheBlockSweepFreq(v time.Duration) { global.SetCacheBlockSweepFreq(v) } +// SetCacheGTSBlockSweepFreq safely sets the value for global configuration 'Cache.GTS.BlockSweepFreq' field +func SetCacheGTSBlockSweepFreq(v time.Duration) { global.SetCacheGTSBlockSweepFreq(v) } -// GetCacheDomainBlockMaxSize safely fetches the Configuration value for state's 'Cache.DomainBlockMaxSize' field -func (st *ConfigState) GetCacheDomainBlockMaxSize() (v int) { +// GetCacheGTSDomainBlockMaxSize safely fetches the Configuration value for state's 'Cache.GTS.DomainBlockMaxSize' field +func (st *ConfigState) GetCacheGTSDomainBlockMaxSize() (v int) { st.mutex.Lock() - v = st.config.Cache.DomainBlockMaxSize + v = st.config.Cache.GTS.DomainBlockMaxSize st.mutex.Unlock() return } -// SetCacheDomainBlockMaxSize safely sets the Configuration value for state's 'Cache.DomainBlockMaxSize' field -func (st *ConfigState) SetCacheDomainBlockMaxSize(v int) { +// SetCacheGTSDomainBlockMaxSize safely sets the Configuration value for state's 'Cache.GTS.DomainBlockMaxSize' field +func (st *ConfigState) SetCacheGTSDomainBlockMaxSize(v int) { st.mutex.Lock() defer st.mutex.Unlock() - st.config.Cache.DomainBlockMaxSize = v + st.config.Cache.GTS.DomainBlockMaxSize = v st.reloadToViper() } -// CacheDomainBlockMaxSizeFlag returns the flag name for the 'Cache.DomainBlockMaxSize' field -func CacheDomainBlockMaxSizeFlag() string { return "cache-domain-block-max-size" } +// CacheGTSDomainBlockMaxSizeFlag returns the flag name for the 'Cache.GTS.DomainBlockMaxSize' field +func CacheGTSDomainBlockMaxSizeFlag() string { return "cache-gts-domain-block-max-size" } -// GetCacheDomainBlockMaxSize safely fetches the value for global configuration 'Cache.DomainBlockMaxSize' field -func GetCacheDomainBlockMaxSize() int { return global.GetCacheDomainBlockMaxSize() } +// GetCacheGTSDomainBlockMaxSize safely fetches the value for global configuration 'Cache.GTS.DomainBlockMaxSize' field +func GetCacheGTSDomainBlockMaxSize() int { return global.GetCacheGTSDomainBlockMaxSize() } -// SetCacheDomainBlockMaxSize safely sets the value for global configuration 'Cache.DomainBlockMaxSize' field -func SetCacheDomainBlockMaxSize(v int) { global.SetCacheDomainBlockMaxSize(v) } +// SetCacheGTSDomainBlockMaxSize safely sets the value for global configuration 'Cache.GTS.DomainBlockMaxSize' field +func SetCacheGTSDomainBlockMaxSize(v int) { global.SetCacheGTSDomainBlockMaxSize(v) } -// GetCacheDomainBlockTTL safely fetches the Configuration value for state's 'Cache.DomainBlockTTL' field -func (st *ConfigState) GetCacheDomainBlockTTL() (v time.Duration) { +// GetCacheGTSDomainBlockTTL safely fetches the Configuration value for state's 'Cache.GTS.DomainBlockTTL' field +func (st *ConfigState) GetCacheGTSDomainBlockTTL() (v time.Duration) { st.mutex.Lock() - v = st.config.Cache.DomainBlockTTL + v = st.config.Cache.GTS.DomainBlockTTL st.mutex.Unlock() return } -// SetCacheDomainBlockTTL safely sets the Configuration value for state's 'Cache.DomainBlockTTL' field -func (st *ConfigState) SetCacheDomainBlockTTL(v time.Duration) { +// SetCacheGTSDomainBlockTTL safely sets the Configuration value for state's 'Cache.GTS.DomainBlockTTL' field +func (st *ConfigState) SetCacheGTSDomainBlockTTL(v time.Duration) { st.mutex.Lock() defer st.mutex.Unlock() - st.config.Cache.DomainBlockTTL = v + st.config.Cache.GTS.DomainBlockTTL = v st.reloadToViper() } -// CacheDomainBlockTTLFlag returns the flag name for the 'Cache.DomainBlockTTL' field -func CacheDomainBlockTTLFlag() string { return "cache-domain-block-ttl" } +// CacheGTSDomainBlockTTLFlag returns the flag name for the 'Cache.GTS.DomainBlockTTL' field +func CacheGTSDomainBlockTTLFlag() string { return "cache-gts-domain-block-ttl" } -// GetCacheDomainBlockTTL safely fetches the value for global configuration 'Cache.DomainBlockTTL' field -func GetCacheDomainBlockTTL() time.Duration { return global.GetCacheDomainBlockTTL() } +// GetCacheGTSDomainBlockTTL safely fetches the value for global configuration 'Cache.GTS.DomainBlockTTL' field +func GetCacheGTSDomainBlockTTL() time.Duration { return global.GetCacheGTSDomainBlockTTL() } -// SetCacheDomainBlockTTL safely sets the value for global configuration 'Cache.DomainBlockTTL' field -func SetCacheDomainBlockTTL(v time.Duration) { global.SetCacheDomainBlockTTL(v) } +// SetCacheGTSDomainBlockTTL safely sets the value for global configuration 'Cache.GTS.DomainBlockTTL' field +func SetCacheGTSDomainBlockTTL(v time.Duration) { global.SetCacheGTSDomainBlockTTL(v) } -// GetCacheDomainBlockSweepFreq safely fetches the Configuration value for state's 'Cache.DomainBlockSweepFreq' field -func (st *ConfigState) GetCacheDomainBlockSweepFreq() (v time.Duration) { +// GetCacheGTSDomainBlockSweepFreq safely fetches the Configuration value for state's 'Cache.GTS.DomainBlockSweepFreq' field +func (st *ConfigState) GetCacheGTSDomainBlockSweepFreq() (v time.Duration) { st.mutex.Lock() - v = st.config.Cache.DomainBlockSweepFreq + v = st.config.Cache.GTS.DomainBlockSweepFreq st.mutex.Unlock() return } -// SetCacheDomainBlockSweepFreq safely sets the Configuration value for state's 'Cache.DomainBlockSweepFreq' field -func (st *ConfigState) SetCacheDomainBlockSweepFreq(v time.Duration) { +// SetCacheGTSDomainBlockSweepFreq safely sets the Configuration value for state's 'Cache.GTS.DomainBlockSweepFreq' field +func (st *ConfigState) SetCacheGTSDomainBlockSweepFreq(v time.Duration) { st.mutex.Lock() defer st.mutex.Unlock() - st.config.Cache.DomainBlockSweepFreq = v + st.config.Cache.GTS.DomainBlockSweepFreq = v st.reloadToViper() } -// CacheDomainBlockSweepFreqFlag returns the flag name for the 'Cache.DomainBlockSweepFreq' field -func CacheDomainBlockSweepFreqFlag() string { return "cache-domain-block-sweep-freq" } +// CacheGTSDomainBlockSweepFreqFlag returns the flag name for the 'Cache.GTS.DomainBlockSweepFreq' field +func CacheGTSDomainBlockSweepFreqFlag() string { return "cache-gts-domain-block-sweep-freq" } -// GetCacheDomainBlockSweepFreq safely fetches the value for global configuration 'Cache.DomainBlockSweepFreq' field -func GetCacheDomainBlockSweepFreq() time.Duration { return global.GetCacheDomainBlockSweepFreq() } +// GetCacheGTSDomainBlockSweepFreq safely fetches the value for global configuration 'Cache.GTS.DomainBlockSweepFreq' field +func GetCacheGTSDomainBlockSweepFreq() time.Duration { return global.GetCacheGTSDomainBlockSweepFreq() } -// SetCacheDomainBlockSweepFreq safely sets the value for global configuration 'Cache.DomainBlockSweepFreq' field -func SetCacheDomainBlockSweepFreq(v time.Duration) { global.SetCacheDomainBlockSweepFreq(v) } +// SetCacheGTSDomainBlockSweepFreq safely sets the value for global configuration 'Cache.GTS.DomainBlockSweepFreq' field +func SetCacheGTSDomainBlockSweepFreq(v time.Duration) { global.SetCacheGTSDomainBlockSweepFreq(v) } -// GetCacheEmojiMaxSize safely fetches the Configuration value for state's 'Cache.EmojiMaxSize' field -func (st *ConfigState) GetCacheEmojiMaxSize() (v int) { +// GetCacheGTSEmojiMaxSize safely fetches the Configuration value for state's 'Cache.GTS.EmojiMaxSize' field +func (st *ConfigState) GetCacheGTSEmojiMaxSize() (v int) { st.mutex.Lock() - v = st.config.Cache.EmojiMaxSize + v = st.config.Cache.GTS.EmojiMaxSize st.mutex.Unlock() return } -// SetCacheEmojiMaxSize safely sets the Configuration value for state's 'Cache.EmojiMaxSize' field -func (st *ConfigState) SetCacheEmojiMaxSize(v int) { +// SetCacheGTSEmojiMaxSize safely sets the Configuration value for state's 'Cache.GTS.EmojiMaxSize' field +func (st *ConfigState) SetCacheGTSEmojiMaxSize(v int) { st.mutex.Lock() defer st.mutex.Unlock() - st.config.Cache.EmojiMaxSize = v + st.config.Cache.GTS.EmojiMaxSize = v st.reloadToViper() } -// CacheEmojiMaxSizeFlag returns the flag name for the 'Cache.EmojiMaxSize' field -func CacheEmojiMaxSizeFlag() string { return "cache-emoji-max-size" } +// CacheGTSEmojiMaxSizeFlag returns the flag name for the 'Cache.GTS.EmojiMaxSize' field +func CacheGTSEmojiMaxSizeFlag() string { return "cache-gts-emoji-max-size" } -// GetCacheEmojiMaxSize safely fetches the value for global configuration 'Cache.EmojiMaxSize' field -func GetCacheEmojiMaxSize() int { return global.GetCacheEmojiMaxSize() } +// GetCacheGTSEmojiMaxSize safely fetches the value for global configuration 'Cache.GTS.EmojiMaxSize' field +func GetCacheGTSEmojiMaxSize() int { return global.GetCacheGTSEmojiMaxSize() } -// SetCacheEmojiMaxSize safely sets the value for global configuration 'Cache.EmojiMaxSize' field -func SetCacheEmojiMaxSize(v int) { global.SetCacheEmojiMaxSize(v) } +// SetCacheGTSEmojiMaxSize safely sets the value for global configuration 'Cache.GTS.EmojiMaxSize' field +func SetCacheGTSEmojiMaxSize(v int) { global.SetCacheGTSEmojiMaxSize(v) } -// GetCacheEmojiTTL safely fetches the Configuration value for state's 'Cache.EmojiTTL' field -func (st *ConfigState) GetCacheEmojiTTL() (v time.Duration) { +// GetCacheGTSEmojiTTL safely fetches the Configuration value for state's 'Cache.GTS.EmojiTTL' field +func (st *ConfigState) GetCacheGTSEmojiTTL() (v time.Duration) { st.mutex.Lock() - v = st.config.Cache.EmojiTTL + v = st.config.Cache.GTS.EmojiTTL st.mutex.Unlock() return } -// SetCacheEmojiTTL safely sets the Configuration value for state's 'Cache.EmojiTTL' field -func (st *ConfigState) SetCacheEmojiTTL(v time.Duration) { +// SetCacheGTSEmojiTTL safely sets the Configuration value for state's 'Cache.GTS.EmojiTTL' field +func (st *ConfigState) SetCacheGTSEmojiTTL(v time.Duration) { st.mutex.Lock() defer st.mutex.Unlock() - st.config.Cache.EmojiTTL = v + st.config.Cache.GTS.EmojiTTL = v st.reloadToViper() } -// CacheEmojiTTLFlag returns the flag name for the 'Cache.EmojiTTL' field -func CacheEmojiTTLFlag() string { return "cache-emoji-ttl" } +// CacheGTSEmojiTTLFlag returns the flag name for the 'Cache.GTS.EmojiTTL' field +func CacheGTSEmojiTTLFlag() string { return "cache-gts-emoji-ttl" } -// GetCacheEmojiTTL safely fetches the value for global configuration 'Cache.EmojiTTL' field -func GetCacheEmojiTTL() time.Duration { return global.GetCacheEmojiTTL() } +// GetCacheGTSEmojiTTL safely fetches the value for global configuration 'Cache.GTS.EmojiTTL' field +func GetCacheGTSEmojiTTL() time.Duration { return global.GetCacheGTSEmojiTTL() } -// SetCacheEmojiTTL safely sets the value for global configuration 'Cache.EmojiTTL' field -func SetCacheEmojiTTL(v time.Duration) { global.SetCacheEmojiTTL(v) } +// SetCacheGTSEmojiTTL safely sets the value for global configuration 'Cache.GTS.EmojiTTL' field +func SetCacheGTSEmojiTTL(v time.Duration) { global.SetCacheGTSEmojiTTL(v) } -// GetCacheEmojiSweepFreq safely fetches the Configuration value for state's 'Cache.EmojiSweepFreq' field -func (st *ConfigState) GetCacheEmojiSweepFreq() (v time.Duration) { +// GetCacheGTSEmojiSweepFreq safely fetches the Configuration value for state's 'Cache.GTS.EmojiSweepFreq' field +func (st *ConfigState) GetCacheGTSEmojiSweepFreq() (v time.Duration) { st.mutex.Lock() - v = st.config.Cache.EmojiSweepFreq + v = st.config.Cache.GTS.EmojiSweepFreq st.mutex.Unlock() return } -// SetCacheEmojiSweepFreq safely sets the Configuration value for state's 'Cache.EmojiSweepFreq' field -func (st *ConfigState) SetCacheEmojiSweepFreq(v time.Duration) { +// SetCacheGTSEmojiSweepFreq safely sets the Configuration value for state's 'Cache.GTS.EmojiSweepFreq' field +func (st *ConfigState) SetCacheGTSEmojiSweepFreq(v time.Duration) { st.mutex.Lock() defer st.mutex.Unlock() - st.config.Cache.EmojiSweepFreq = v + st.config.Cache.GTS.EmojiSweepFreq = v st.reloadToViper() } -// CacheEmojiSweepFreqFlag returns the flag name for the 'Cache.EmojiSweepFreq' field -func CacheEmojiSweepFreqFlag() string { return "cache-emoji-sweep-freq" } +// CacheGTSEmojiSweepFreqFlag returns the flag name for the 'Cache.GTS.EmojiSweepFreq' field +func CacheGTSEmojiSweepFreqFlag() string { return "cache-gts-emoji-sweep-freq" } -// GetCacheEmojiSweepFreq safely fetches the value for global configuration 'Cache.EmojiSweepFreq' field -func GetCacheEmojiSweepFreq() time.Duration { return global.GetCacheEmojiSweepFreq() } +// GetCacheGTSEmojiSweepFreq safely fetches the value for global configuration 'Cache.GTS.EmojiSweepFreq' field +func GetCacheGTSEmojiSweepFreq() time.Duration { return global.GetCacheGTSEmojiSweepFreq() } -// SetCacheEmojiSweepFreq safely sets the value for global configuration 'Cache.EmojiSweepFreq' field -func SetCacheEmojiSweepFreq(v time.Duration) { global.SetCacheEmojiSweepFreq(v) } +// SetCacheGTSEmojiSweepFreq safely sets the value for global configuration 'Cache.GTS.EmojiSweepFreq' field +func SetCacheGTSEmojiSweepFreq(v time.Duration) { global.SetCacheGTSEmojiSweepFreq(v) } -// GetCacheEmojiCategoryMaxSize safely fetches the Configuration value for state's 'Cache.EmojiCategoryMaxSize' field -func (st *ConfigState) GetCacheEmojiCategoryMaxSize() (v int) { +// GetCacheGTSEmojiCategoryMaxSize safely fetches the Configuration value for state's 'Cache.GTS.EmojiCategoryMaxSize' field +func (st *ConfigState) GetCacheGTSEmojiCategoryMaxSize() (v int) { st.mutex.Lock() - v = st.config.Cache.EmojiCategoryMaxSize + v = st.config.Cache.GTS.EmojiCategoryMaxSize st.mutex.Unlock() return } -// SetCacheEmojiCategoryMaxSize safely sets the Configuration value for state's 'Cache.EmojiCategoryMaxSize' field -func (st *ConfigState) SetCacheEmojiCategoryMaxSize(v int) { +// SetCacheGTSEmojiCategoryMaxSize safely sets the Configuration value for state's 'Cache.GTS.EmojiCategoryMaxSize' field +func (st *ConfigState) SetCacheGTSEmojiCategoryMaxSize(v int) { st.mutex.Lock() defer st.mutex.Unlock() - st.config.Cache.EmojiCategoryMaxSize = v + st.config.Cache.GTS.EmojiCategoryMaxSize = v st.reloadToViper() } -// CacheEmojiCategoryMaxSizeFlag returns the flag name for the 'Cache.EmojiCategoryMaxSize' field -func CacheEmojiCategoryMaxSizeFlag() string { return "cache-emoji-category-max-size" } +// CacheGTSEmojiCategoryMaxSizeFlag returns the flag name for the 'Cache.GTS.EmojiCategoryMaxSize' field +func CacheGTSEmojiCategoryMaxSizeFlag() string { return "cache-gts-emoji-category-max-size" } -// GetCacheEmojiCategoryMaxSize safely fetches the value for global configuration 'Cache.EmojiCategoryMaxSize' field -func GetCacheEmojiCategoryMaxSize() int { return global.GetCacheEmojiCategoryMaxSize() } +// GetCacheGTSEmojiCategoryMaxSize safely fetches the value for global configuration 'Cache.GTS.EmojiCategoryMaxSize' field +func GetCacheGTSEmojiCategoryMaxSize() int { return global.GetCacheGTSEmojiCategoryMaxSize() } -// SetCacheEmojiCategoryMaxSize safely sets the value for global configuration 'Cache.EmojiCategoryMaxSize' field -func SetCacheEmojiCategoryMaxSize(v int) { global.SetCacheEmojiCategoryMaxSize(v) } +// SetCacheGTSEmojiCategoryMaxSize safely sets the value for global configuration 'Cache.GTS.EmojiCategoryMaxSize' field +func SetCacheGTSEmojiCategoryMaxSize(v int) { global.SetCacheGTSEmojiCategoryMaxSize(v) } -// GetCacheEmojiCategoryTTL safely fetches the Configuration value for state's 'Cache.EmojiCategoryTTL' field -func (st *ConfigState) GetCacheEmojiCategoryTTL() (v time.Duration) { +// GetCacheGTSEmojiCategoryTTL safely fetches the Configuration value for state's 'Cache.GTS.EmojiCategoryTTL' field +func (st *ConfigState) GetCacheGTSEmojiCategoryTTL() (v time.Duration) { st.mutex.Lock() - v = st.config.Cache.EmojiCategoryTTL + v = st.config.Cache.GTS.EmojiCategoryTTL st.mutex.Unlock() return } -// SetCacheEmojiCategoryTTL safely sets the Configuration value for state's 'Cache.EmojiCategoryTTL' field -func (st *ConfigState) SetCacheEmojiCategoryTTL(v time.Duration) { +// SetCacheGTSEmojiCategoryTTL safely sets the Configuration value for state's 'Cache.GTS.EmojiCategoryTTL' field +func (st *ConfigState) SetCacheGTSEmojiCategoryTTL(v time.Duration) { st.mutex.Lock() defer st.mutex.Unlock() - st.config.Cache.EmojiCategoryTTL = v + st.config.Cache.GTS.EmojiCategoryTTL = v st.reloadToViper() } -// CacheEmojiCategoryTTLFlag returns the flag name for the 'Cache.EmojiCategoryTTL' field -func CacheEmojiCategoryTTLFlag() string { return "cache-emoji-category-ttl" } +// CacheGTSEmojiCategoryTTLFlag returns the flag name for the 'Cache.GTS.EmojiCategoryTTL' field +func CacheGTSEmojiCategoryTTLFlag() string { return "cache-gts-emoji-category-ttl" } -// GetCacheEmojiCategoryTTL safely fetches the value for global configuration 'Cache.EmojiCategoryTTL' field -func GetCacheEmojiCategoryTTL() time.Duration { return global.GetCacheEmojiCategoryTTL() } +// GetCacheGTSEmojiCategoryTTL safely fetches the value for global configuration 'Cache.GTS.EmojiCategoryTTL' field +func GetCacheGTSEmojiCategoryTTL() time.Duration { return global.GetCacheGTSEmojiCategoryTTL() } -// SetCacheEmojiCategoryTTL safely sets the value for global configuration 'Cache.EmojiCategoryTTL' field -func SetCacheEmojiCategoryTTL(v time.Duration) { global.SetCacheEmojiCategoryTTL(v) } +// SetCacheGTSEmojiCategoryTTL safely sets the value for global configuration 'Cache.GTS.EmojiCategoryTTL' field +func SetCacheGTSEmojiCategoryTTL(v time.Duration) { global.SetCacheGTSEmojiCategoryTTL(v) } -// GetCacheEmojiCategorySweepFreq safely fetches the Configuration value for state's 'Cache.EmojiCategorySweepFreq' field -func (st *ConfigState) GetCacheEmojiCategorySweepFreq() (v time.Duration) { +// GetCacheGTSEmojiCategorySweepFreq safely fetches the Configuration value for state's 'Cache.GTS.EmojiCategorySweepFreq' field +func (st *ConfigState) GetCacheGTSEmojiCategorySweepFreq() (v time.Duration) { st.mutex.Lock() - v = st.config.Cache.EmojiCategorySweepFreq + v = st.config.Cache.GTS.EmojiCategorySweepFreq st.mutex.Unlock() return } -// SetCacheEmojiCategorySweepFreq safely sets the Configuration value for state's 'Cache.EmojiCategorySweepFreq' field -func (st *ConfigState) SetCacheEmojiCategorySweepFreq(v time.Duration) { +// SetCacheGTSEmojiCategorySweepFreq safely sets the Configuration value for state's 'Cache.GTS.EmojiCategorySweepFreq' field +func (st *ConfigState) SetCacheGTSEmojiCategorySweepFreq(v time.Duration) { st.mutex.Lock() defer st.mutex.Unlock() - st.config.Cache.EmojiCategorySweepFreq = v + st.config.Cache.GTS.EmojiCategorySweepFreq = v st.reloadToViper() } -// CacheEmojiCategorySweepFreqFlag returns the flag name for the 'Cache.EmojiCategorySweepFreq' field -func CacheEmojiCategorySweepFreqFlag() string { return "cache-emoji-category-sweep-freq" } +// CacheGTSEmojiCategorySweepFreqFlag returns the flag name for the 'Cache.GTS.EmojiCategorySweepFreq' field +func CacheGTSEmojiCategorySweepFreqFlag() string { return "cache-gts-emoji-category-sweep-freq" } -// GetCacheEmojiCategorySweepFreq safely fetches the value for global configuration 'Cache.EmojiCategorySweepFreq' field -func GetCacheEmojiCategorySweepFreq() time.Duration { return global.GetCacheEmojiCategorySweepFreq() } +// GetCacheGTSEmojiCategorySweepFreq safely fetches the value for global configuration 'Cache.GTS.EmojiCategorySweepFreq' field +func GetCacheGTSEmojiCategorySweepFreq() time.Duration { + return global.GetCacheGTSEmojiCategorySweepFreq() +} -// SetCacheEmojiCategorySweepFreq safely sets the value for global configuration 'Cache.EmojiCategorySweepFreq' field -func SetCacheEmojiCategorySweepFreq(v time.Duration) { global.SetCacheEmojiCategorySweepFreq(v) } +// SetCacheGTSEmojiCategorySweepFreq safely sets the value for global configuration 'Cache.GTS.EmojiCategorySweepFreq' field +func SetCacheGTSEmojiCategorySweepFreq(v time.Duration) { global.SetCacheGTSEmojiCategorySweepFreq(v) } -// GetCacheMentionMaxSize safely fetches the Configuration value for state's 'Cache.MentionMaxSize' field -func (st *ConfigState) GetCacheMentionMaxSize() (v int) { +// GetCacheGTSMentionMaxSize safely fetches the Configuration value for state's 'Cache.GTS.MentionMaxSize' field +func (st *ConfigState) GetCacheGTSMentionMaxSize() (v int) { st.mutex.Lock() - v = st.config.Cache.MentionMaxSize + v = st.config.Cache.GTS.MentionMaxSize st.mutex.Unlock() return } -// SetCacheMentionMaxSize safely sets the Configuration value for state's 'Cache.MentionMaxSize' field -func (st *ConfigState) SetCacheMentionMaxSize(v int) { +// SetCacheGTSMentionMaxSize safely sets the Configuration value for state's 'Cache.GTS.MentionMaxSize' field +func (st *ConfigState) SetCacheGTSMentionMaxSize(v int) { st.mutex.Lock() defer st.mutex.Unlock() - st.config.Cache.MentionMaxSize = v + st.config.Cache.GTS.MentionMaxSize = v st.reloadToViper() } -// CacheMentionMaxSizeFlag returns the flag name for the 'Cache.MentionMaxSize' field -func CacheMentionMaxSizeFlag() string { return "cache-mention-max-size" } +// CacheGTSMentionMaxSizeFlag returns the flag name for the 'Cache.GTS.MentionMaxSize' field +func CacheGTSMentionMaxSizeFlag() string { return "cache-gts-mention-max-size" } -// GetCacheMentionMaxSize safely fetches the value for global configuration 'Cache.MentionMaxSize' field -func GetCacheMentionMaxSize() int { return global.GetCacheMentionMaxSize() } +// GetCacheGTSMentionMaxSize safely fetches the value for global configuration 'Cache.GTS.MentionMaxSize' field +func GetCacheGTSMentionMaxSize() int { return global.GetCacheGTSMentionMaxSize() } -// SetCacheMentionMaxSize safely sets the value for global configuration 'Cache.MentionMaxSize' field -func SetCacheMentionMaxSize(v int) { global.SetCacheMentionMaxSize(v) } +// SetCacheGTSMentionMaxSize safely sets the value for global configuration 'Cache.GTS.MentionMaxSize' field +func SetCacheGTSMentionMaxSize(v int) { global.SetCacheGTSMentionMaxSize(v) } -// GetCacheMentionTTL safely fetches the Configuration value for state's 'Cache.MentionTTL' field -func (st *ConfigState) GetCacheMentionTTL() (v time.Duration) { +// GetCacheGTSMentionTTL safely fetches the Configuration value for state's 'Cache.GTS.MentionTTL' field +func (st *ConfigState) GetCacheGTSMentionTTL() (v time.Duration) { st.mutex.Lock() - v = st.config.Cache.MentionTTL + v = st.config.Cache.GTS.MentionTTL st.mutex.Unlock() return } -// SetCacheMentionTTL safely sets the Configuration value for state's 'Cache.MentionTTL' field -func (st *ConfigState) SetCacheMentionTTL(v time.Duration) { +// SetCacheGTSMentionTTL safely sets the Configuration value for state's 'Cache.GTS.MentionTTL' field +func (st *ConfigState) SetCacheGTSMentionTTL(v time.Duration) { st.mutex.Lock() defer st.mutex.Unlock() - st.config.Cache.MentionTTL = v + st.config.Cache.GTS.MentionTTL = v st.reloadToViper() } -// CacheMentionTTLFlag returns the flag name for the 'Cache.MentionTTL' field -func CacheMentionTTLFlag() string { return "cache-mention-ttl" } +// CacheGTSMentionTTLFlag returns the flag name for the 'Cache.GTS.MentionTTL' field +func CacheGTSMentionTTLFlag() string { return "cache-gts-mention-ttl" } -// GetCacheMentionTTL safely fetches the value for global configuration 'Cache.MentionTTL' field -func GetCacheMentionTTL() time.Duration { return global.GetCacheMentionTTL() } +// GetCacheGTSMentionTTL safely fetches the value for global configuration 'Cache.GTS.MentionTTL' field +func GetCacheGTSMentionTTL() time.Duration { return global.GetCacheGTSMentionTTL() } -// SetCacheMentionTTL safely sets the value for global configuration 'Cache.MentionTTL' field -func SetCacheMentionTTL(v time.Duration) { global.SetCacheMentionTTL(v) } +// SetCacheGTSMentionTTL safely sets the value for global configuration 'Cache.GTS.MentionTTL' field +func SetCacheGTSMentionTTL(v time.Duration) { global.SetCacheGTSMentionTTL(v) } -// GetCacheMentionSweepFreq safely fetches the Configuration value for state's 'Cache.MentionSweepFreq' field -func (st *ConfigState) GetCacheMentionSweepFreq() (v time.Duration) { +// GetCacheGTSMentionSweepFreq safely fetches the Configuration value for state's 'Cache.GTS.MentionSweepFreq' field +func (st *ConfigState) GetCacheGTSMentionSweepFreq() (v time.Duration) { st.mutex.Lock() - v = st.config.Cache.MentionSweepFreq + v = st.config.Cache.GTS.MentionSweepFreq st.mutex.Unlock() return } -// SetCacheMentionSweepFreq safely sets the Configuration value for state's 'Cache.MentionSweepFreq' field -func (st *ConfigState) SetCacheMentionSweepFreq(v time.Duration) { +// SetCacheGTSMentionSweepFreq safely sets the Configuration value for state's 'Cache.GTS.MentionSweepFreq' field +func (st *ConfigState) SetCacheGTSMentionSweepFreq(v time.Duration) { st.mutex.Lock() defer st.mutex.Unlock() - st.config.Cache.MentionSweepFreq = v + st.config.Cache.GTS.MentionSweepFreq = v st.reloadToViper() } -// CacheMentionSweepFreqFlag returns the flag name for the 'Cache.MentionSweepFreq' field -func CacheMentionSweepFreqFlag() string { return "cache-mention-sweep-freq" } +// CacheGTSMentionSweepFreqFlag returns the flag name for the 'Cache.GTS.MentionSweepFreq' field +func CacheGTSMentionSweepFreqFlag() string { return "cache-gts-mention-sweep-freq" } -// GetCacheMentionSweepFreq safely fetches the value for global configuration 'Cache.MentionSweepFreq' field -func GetCacheMentionSweepFreq() time.Duration { return global.GetCacheMentionSweepFreq() } +// GetCacheGTSMentionSweepFreq safely fetches the value for global configuration 'Cache.GTS.MentionSweepFreq' field +func GetCacheGTSMentionSweepFreq() time.Duration { return global.GetCacheGTSMentionSweepFreq() } -// SetCacheMentionSweepFreq safely sets the value for global configuration 'Cache.MentionSweepFreq' field -func SetCacheMentionSweepFreq(v time.Duration) { global.SetCacheMentionSweepFreq(v) } +// SetCacheGTSMentionSweepFreq safely sets the value for global configuration 'Cache.GTS.MentionSweepFreq' field +func SetCacheGTSMentionSweepFreq(v time.Duration) { global.SetCacheGTSMentionSweepFreq(v) } -// GetCacheNotificationMaxSize safely fetches the Configuration value for state's 'Cache.NotificationMaxSize' field -func (st *ConfigState) GetCacheNotificationMaxSize() (v int) { +// GetCacheGTSNotificationMaxSize safely fetches the Configuration value for state's 'Cache.GTS.NotificationMaxSize' field +func (st *ConfigState) GetCacheGTSNotificationMaxSize() (v int) { st.mutex.Lock() - v = st.config.Cache.NotificationMaxSize + v = st.config.Cache.GTS.NotificationMaxSize st.mutex.Unlock() return } -// SetCacheNotificationMaxSize safely sets the Configuration value for state's 'Cache.NotificationMaxSize' field -func (st *ConfigState) SetCacheNotificationMaxSize(v int) { +// SetCacheGTSNotificationMaxSize safely sets the Configuration value for state's 'Cache.GTS.NotificationMaxSize' field +func (st *ConfigState) SetCacheGTSNotificationMaxSize(v int) { st.mutex.Lock() defer st.mutex.Unlock() - st.config.Cache.NotificationMaxSize = v + st.config.Cache.GTS.NotificationMaxSize = v st.reloadToViper() } -// CacheNotificationMaxSizeFlag returns the flag name for the 'Cache.NotificationMaxSize' field -func CacheNotificationMaxSizeFlag() string { return "cache-notification-max-size" } +// CacheGTSNotificationMaxSizeFlag returns the flag name for the 'Cache.GTS.NotificationMaxSize' field +func CacheGTSNotificationMaxSizeFlag() string { return "cache-gts-notification-max-size" } -// GetCacheNotificationMaxSize safely fetches the value for global configuration 'Cache.NotificationMaxSize' field -func GetCacheNotificationMaxSize() int { return global.GetCacheNotificationMaxSize() } +// GetCacheGTSNotificationMaxSize safely fetches the value for global configuration 'Cache.GTS.NotificationMaxSize' field +func GetCacheGTSNotificationMaxSize() int { return global.GetCacheGTSNotificationMaxSize() } -// SetCacheNotificationMaxSize safely sets the value for global configuration 'Cache.NotificationMaxSize' field -func SetCacheNotificationMaxSize(v int) { global.SetCacheNotificationMaxSize(v) } +// SetCacheGTSNotificationMaxSize safely sets the value for global configuration 'Cache.GTS.NotificationMaxSize' field +func SetCacheGTSNotificationMaxSize(v int) { global.SetCacheGTSNotificationMaxSize(v) } -// GetCacheNotificationTTL safely fetches the Configuration value for state's 'Cache.NotificationTTL' field -func (st *ConfigState) GetCacheNotificationTTL() (v time.Duration) { +// GetCacheGTSNotificationTTL safely fetches the Configuration value for state's 'Cache.GTS.NotificationTTL' field +func (st *ConfigState) GetCacheGTSNotificationTTL() (v time.Duration) { st.mutex.Lock() - v = st.config.Cache.NotificationTTL + v = st.config.Cache.GTS.NotificationTTL st.mutex.Unlock() return } -// SetCacheNotificationTTL safely sets the Configuration value for state's 'Cache.NotificationTTL' field -func (st *ConfigState) SetCacheNotificationTTL(v time.Duration) { +// SetCacheGTSNotificationTTL safely sets the Configuration value for state's 'Cache.GTS.NotificationTTL' field +func (st *ConfigState) SetCacheGTSNotificationTTL(v time.Duration) { st.mutex.Lock() defer st.mutex.Unlock() - st.config.Cache.NotificationTTL = v + st.config.Cache.GTS.NotificationTTL = v st.reloadToViper() } -// CacheNotificationTTLFlag returns the flag name for the 'Cache.NotificationTTL' field -func CacheNotificationTTLFlag() string { return "cache-notification-ttl" } +// CacheGTSNotificationTTLFlag returns the flag name for the 'Cache.GTS.NotificationTTL' field +func CacheGTSNotificationTTLFlag() string { return "cache-gts-notification-ttl" } -// GetCacheNotificationTTL safely fetches the value for global configuration 'Cache.NotificationTTL' field -func GetCacheNotificationTTL() time.Duration { return global.GetCacheNotificationTTL() } +// GetCacheGTSNotificationTTL safely fetches the value for global configuration 'Cache.GTS.NotificationTTL' field +func GetCacheGTSNotificationTTL() time.Duration { return global.GetCacheGTSNotificationTTL() } -// SetCacheNotificationTTL safely sets the value for global configuration 'Cache.NotificationTTL' field -func SetCacheNotificationTTL(v time.Duration) { global.SetCacheNotificationTTL(v) } +// SetCacheGTSNotificationTTL safely sets the value for global configuration 'Cache.GTS.NotificationTTL' field +func SetCacheGTSNotificationTTL(v time.Duration) { global.SetCacheGTSNotificationTTL(v) } -// GetCacheNotificationSweepFreq safely fetches the Configuration value for state's 'Cache.NotificationSweepFreq' field -func (st *ConfigState) GetCacheNotificationSweepFreq() (v time.Duration) { +// GetCacheGTSNotificationSweepFreq safely fetches the Configuration value for state's 'Cache.GTS.NotificationSweepFreq' field +func (st *ConfigState) GetCacheGTSNotificationSweepFreq() (v time.Duration) { st.mutex.Lock() - v = st.config.Cache.NotificationSweepFreq + v = st.config.Cache.GTS.NotificationSweepFreq st.mutex.Unlock() return } -// SetCacheNotificationSweepFreq safely sets the Configuration value for state's 'Cache.NotificationSweepFreq' field -func (st *ConfigState) SetCacheNotificationSweepFreq(v time.Duration) { +// SetCacheGTSNotificationSweepFreq safely sets the Configuration value for state's 'Cache.GTS.NotificationSweepFreq' field +func (st *ConfigState) SetCacheGTSNotificationSweepFreq(v time.Duration) { st.mutex.Lock() defer st.mutex.Unlock() - st.config.Cache.NotificationSweepFreq = v + st.config.Cache.GTS.NotificationSweepFreq = v st.reloadToViper() } -// CacheNotificationSweepFreqFlag returns the flag name for the 'Cache.NotificationSweepFreq' field -func CacheNotificationSweepFreqFlag() string { return "cache-notification-sweep-freq" } +// CacheGTSNotificationSweepFreqFlag returns the flag name for the 'Cache.GTS.NotificationSweepFreq' field +func CacheGTSNotificationSweepFreqFlag() string { return "cache-gts-notification-sweep-freq" } -// GetCacheNotificationSweepFreq safely fetches the value for global configuration 'Cache.NotificationSweepFreq' field -func GetCacheNotificationSweepFreq() time.Duration { return global.GetCacheNotificationSweepFreq() } +// GetCacheGTSNotificationSweepFreq safely fetches the value for global configuration 'Cache.GTS.NotificationSweepFreq' field +func GetCacheGTSNotificationSweepFreq() time.Duration { + return global.GetCacheGTSNotificationSweepFreq() +} -// SetCacheNotificationSweepFreq safely sets the value for global configuration 'Cache.NotificationSweepFreq' field -func SetCacheNotificationSweepFreq(v time.Duration) { global.SetCacheNotificationSweepFreq(v) } +// SetCacheGTSNotificationSweepFreq safely sets the value for global configuration 'Cache.GTS.NotificationSweepFreq' field +func SetCacheGTSNotificationSweepFreq(v time.Duration) { global.SetCacheGTSNotificationSweepFreq(v) } -// GetCacheStatusMaxSize safely fetches the Configuration value for state's 'Cache.StatusMaxSize' field -func (st *ConfigState) GetCacheStatusMaxSize() (v int) { +// GetCacheGTSStatusMaxSize safely fetches the Configuration value for state's 'Cache.GTS.StatusMaxSize' field +func (st *ConfigState) GetCacheGTSStatusMaxSize() (v int) { st.mutex.Lock() - v = st.config.Cache.StatusMaxSize + v = st.config.Cache.GTS.StatusMaxSize st.mutex.Unlock() return } -// SetCacheStatusMaxSize safely sets the Configuration value for state's 'Cache.StatusMaxSize' field -func (st *ConfigState) SetCacheStatusMaxSize(v int) { +// SetCacheGTSStatusMaxSize safely sets the Configuration value for state's 'Cache.GTS.StatusMaxSize' field +func (st *ConfigState) SetCacheGTSStatusMaxSize(v int) { st.mutex.Lock() defer st.mutex.Unlock() - st.config.Cache.StatusMaxSize = v + st.config.Cache.GTS.StatusMaxSize = v st.reloadToViper() } -// CacheStatusMaxSizeFlag returns the flag name for the 'Cache.StatusMaxSize' field -func CacheStatusMaxSizeFlag() string { return "cache-status-max-size" } +// CacheGTSStatusMaxSizeFlag returns the flag name for the 'Cache.GTS.StatusMaxSize' field +func CacheGTSStatusMaxSizeFlag() string { return "cache-gts-status-max-size" } -// GetCacheStatusMaxSize safely fetches the value for global configuration 'Cache.StatusMaxSize' field -func GetCacheStatusMaxSize() int { return global.GetCacheStatusMaxSize() } +// GetCacheGTSStatusMaxSize safely fetches the value for global configuration 'Cache.GTS.StatusMaxSize' field +func GetCacheGTSStatusMaxSize() int { return global.GetCacheGTSStatusMaxSize() } -// SetCacheStatusMaxSize safely sets the value for global configuration 'Cache.StatusMaxSize' field -func SetCacheStatusMaxSize(v int) { global.SetCacheStatusMaxSize(v) } +// SetCacheGTSStatusMaxSize safely sets the value for global configuration 'Cache.GTS.StatusMaxSize' field +func SetCacheGTSStatusMaxSize(v int) { global.SetCacheGTSStatusMaxSize(v) } -// GetCacheStatusTTL safely fetches the Configuration value for state's 'Cache.StatusTTL' field -func (st *ConfigState) GetCacheStatusTTL() (v time.Duration) { +// GetCacheGTSStatusTTL safely fetches the Configuration value for state's 'Cache.GTS.StatusTTL' field +func (st *ConfigState) GetCacheGTSStatusTTL() (v time.Duration) { st.mutex.Lock() - v = st.config.Cache.StatusTTL + v = st.config.Cache.GTS.StatusTTL st.mutex.Unlock() return } -// SetCacheStatusTTL safely sets the Configuration value for state's 'Cache.StatusTTL' field -func (st *ConfigState) SetCacheStatusTTL(v time.Duration) { +// SetCacheGTSStatusTTL safely sets the Configuration value for state's 'Cache.GTS.StatusTTL' field +func (st *ConfigState) SetCacheGTSStatusTTL(v time.Duration) { st.mutex.Lock() defer st.mutex.Unlock() - st.config.Cache.StatusTTL = v + st.config.Cache.GTS.StatusTTL = v st.reloadToViper() } -// CacheStatusTTLFlag returns the flag name for the 'Cache.StatusTTL' field -func CacheStatusTTLFlag() string { return "cache-status-ttl" } +// CacheGTSStatusTTLFlag returns the flag name for the 'Cache.GTS.StatusTTL' field +func CacheGTSStatusTTLFlag() string { return "cache-gts-status-ttl" } -// GetCacheStatusTTL safely fetches the value for global configuration 'Cache.StatusTTL' field -func GetCacheStatusTTL() time.Duration { return global.GetCacheStatusTTL() } +// GetCacheGTSStatusTTL safely fetches the value for global configuration 'Cache.GTS.StatusTTL' field +func GetCacheGTSStatusTTL() time.Duration { return global.GetCacheGTSStatusTTL() } -// SetCacheStatusTTL safely sets the value for global configuration 'Cache.StatusTTL' field -func SetCacheStatusTTL(v time.Duration) { global.SetCacheStatusTTL(v) } +// SetCacheGTSStatusTTL safely sets the value for global configuration 'Cache.GTS.StatusTTL' field +func SetCacheGTSStatusTTL(v time.Duration) { global.SetCacheGTSStatusTTL(v) } -// GetCacheStatusSweepFreq safely fetches the Configuration value for state's 'Cache.StatusSweepFreq' field -func (st *ConfigState) GetCacheStatusSweepFreq() (v time.Duration) { +// GetCacheGTSStatusSweepFreq safely fetches the Configuration value for state's 'Cache.GTS.StatusSweepFreq' field +func (st *ConfigState) GetCacheGTSStatusSweepFreq() (v time.Duration) { st.mutex.Lock() - v = st.config.Cache.StatusSweepFreq + v = st.config.Cache.GTS.StatusSweepFreq st.mutex.Unlock() return } -// SetCacheStatusSweepFreq safely sets the Configuration value for state's 'Cache.StatusSweepFreq' field -func (st *ConfigState) SetCacheStatusSweepFreq(v time.Duration) { +// SetCacheGTSStatusSweepFreq safely sets the Configuration value for state's 'Cache.GTS.StatusSweepFreq' field +func (st *ConfigState) SetCacheGTSStatusSweepFreq(v time.Duration) { st.mutex.Lock() defer st.mutex.Unlock() - st.config.Cache.StatusSweepFreq = v + st.config.Cache.GTS.StatusSweepFreq = v st.reloadToViper() } -// CacheStatusSweepFreqFlag returns the flag name for the 'Cache.StatusSweepFreq' field -func CacheStatusSweepFreqFlag() string { return "cache-status-sweep-freq" } +// CacheGTSStatusSweepFreqFlag returns the flag name for the 'Cache.GTS.StatusSweepFreq' field +func CacheGTSStatusSweepFreqFlag() string { return "cache-gts-status-sweep-freq" } -// GetCacheStatusSweepFreq safely fetches the value for global configuration 'Cache.StatusSweepFreq' field -func GetCacheStatusSweepFreq() time.Duration { return global.GetCacheStatusSweepFreq() } +// GetCacheGTSStatusSweepFreq safely fetches the value for global configuration 'Cache.GTS.StatusSweepFreq' field +func GetCacheGTSStatusSweepFreq() time.Duration { return global.GetCacheGTSStatusSweepFreq() } -// SetCacheStatusSweepFreq safely sets the value for global configuration 'Cache.StatusSweepFreq' field -func SetCacheStatusSweepFreq(v time.Duration) { global.SetCacheStatusSweepFreq(v) } +// SetCacheGTSStatusSweepFreq safely sets the value for global configuration 'Cache.GTS.StatusSweepFreq' field +func SetCacheGTSStatusSweepFreq(v time.Duration) { global.SetCacheGTSStatusSweepFreq(v) } -// GetCacheTombstoneMaxSize safely fetches the Configuration value for state's 'Cache.TombstoneMaxSize' field -func (st *ConfigState) GetCacheTombstoneMaxSize() (v int) { +// GetCacheGTSTombstoneMaxSize safely fetches the Configuration value for state's 'Cache.GTS.TombstoneMaxSize' field +func (st *ConfigState) GetCacheGTSTombstoneMaxSize() (v int) { st.mutex.Lock() - v = st.config.Cache.TombstoneMaxSize + v = st.config.Cache.GTS.TombstoneMaxSize st.mutex.Unlock() return } -// SetCacheTombstoneMaxSize safely sets the Configuration value for state's 'Cache.TombstoneMaxSize' field -func (st *ConfigState) SetCacheTombstoneMaxSize(v int) { +// SetCacheGTSTombstoneMaxSize safely sets the Configuration value for state's 'Cache.GTS.TombstoneMaxSize' field +func (st *ConfigState) SetCacheGTSTombstoneMaxSize(v int) { st.mutex.Lock() defer st.mutex.Unlock() - st.config.Cache.TombstoneMaxSize = v + st.config.Cache.GTS.TombstoneMaxSize = v st.reloadToViper() } -// CacheTombstoneMaxSizeFlag returns the flag name for the 'Cache.TombstoneMaxSize' field -func CacheTombstoneMaxSizeFlag() string { return "cache-tombstone-max-size" } +// CacheGTSTombstoneMaxSizeFlag returns the flag name for the 'Cache.GTS.TombstoneMaxSize' field +func CacheGTSTombstoneMaxSizeFlag() string { return "cache-gts-tombstone-max-size" } -// GetCacheTombstoneMaxSize safely fetches the value for global configuration 'Cache.TombstoneMaxSize' field -func GetCacheTombstoneMaxSize() int { return global.GetCacheTombstoneMaxSize() } +// GetCacheGTSTombstoneMaxSize safely fetches the value for global configuration 'Cache.GTS.TombstoneMaxSize' field +func GetCacheGTSTombstoneMaxSize() int { return global.GetCacheGTSTombstoneMaxSize() } -// SetCacheTombstoneMaxSize safely sets the value for global configuration 'Cache.TombstoneMaxSize' field -func SetCacheTombstoneMaxSize(v int) { global.SetCacheTombstoneMaxSize(v) } +// SetCacheGTSTombstoneMaxSize safely sets the value for global configuration 'Cache.GTS.TombstoneMaxSize' field +func SetCacheGTSTombstoneMaxSize(v int) { global.SetCacheGTSTombstoneMaxSize(v) } -// GetCacheTombstoneTTL safely fetches the Configuration value for state's 'Cache.TombstoneTTL' field -func (st *ConfigState) GetCacheTombstoneTTL() (v time.Duration) { +// GetCacheGTSTombstoneTTL safely fetches the Configuration value for state's 'Cache.GTS.TombstoneTTL' field +func (st *ConfigState) GetCacheGTSTombstoneTTL() (v time.Duration) { st.mutex.Lock() - v = st.config.Cache.TombstoneTTL + v = st.config.Cache.GTS.TombstoneTTL st.mutex.Unlock() return } -// SetCacheTombstoneTTL safely sets the Configuration value for state's 'Cache.TombstoneTTL' field -func (st *ConfigState) SetCacheTombstoneTTL(v time.Duration) { +// SetCacheGTSTombstoneTTL safely sets the Configuration value for state's 'Cache.GTS.TombstoneTTL' field +func (st *ConfigState) SetCacheGTSTombstoneTTL(v time.Duration) { st.mutex.Lock() defer st.mutex.Unlock() - st.config.Cache.TombstoneTTL = v + st.config.Cache.GTS.TombstoneTTL = v st.reloadToViper() } -// CacheTombstoneTTLFlag returns the flag name for the 'Cache.TombstoneTTL' field -func CacheTombstoneTTLFlag() string { return "cache-tombstone-ttl" } +// CacheGTSTombstoneTTLFlag returns the flag name for the 'Cache.GTS.TombstoneTTL' field +func CacheGTSTombstoneTTLFlag() string { return "cache-gts-tombstone-ttl" } -// GetCacheTombstoneTTL safely fetches the value for global configuration 'Cache.TombstoneTTL' field -func GetCacheTombstoneTTL() time.Duration { return global.GetCacheTombstoneTTL() } +// GetCacheGTSTombstoneTTL safely fetches the value for global configuration 'Cache.GTS.TombstoneTTL' field +func GetCacheGTSTombstoneTTL() time.Duration { return global.GetCacheGTSTombstoneTTL() } -// SetCacheTombstoneTTL safely sets the value for global configuration 'Cache.TombstoneTTL' field -func SetCacheTombstoneTTL(v time.Duration) { global.SetCacheTombstoneTTL(v) } +// SetCacheGTSTombstoneTTL safely sets the value for global configuration 'Cache.GTS.TombstoneTTL' field +func SetCacheGTSTombstoneTTL(v time.Duration) { global.SetCacheGTSTombstoneTTL(v) } -// GetCacheTombstoneSweepFreq safely fetches the Configuration value for state's 'Cache.TombstoneSweepFreq' field -func (st *ConfigState) GetCacheTombstoneSweepFreq() (v time.Duration) { +// GetCacheGTSTombstoneSweepFreq safely fetches the Configuration value for state's 'Cache.GTS.TombstoneSweepFreq' field +func (st *ConfigState) GetCacheGTSTombstoneSweepFreq() (v time.Duration) { st.mutex.Lock() - v = st.config.Cache.TombstoneSweepFreq + v = st.config.Cache.GTS.TombstoneSweepFreq st.mutex.Unlock() return } -// SetCacheTombstoneSweepFreq safely sets the Configuration value for state's 'Cache.TombstoneSweepFreq' field -func (st *ConfigState) SetCacheTombstoneSweepFreq(v time.Duration) { +// SetCacheGTSTombstoneSweepFreq safely sets the Configuration value for state's 'Cache.GTS.TombstoneSweepFreq' field +func (st *ConfigState) SetCacheGTSTombstoneSweepFreq(v time.Duration) { st.mutex.Lock() defer st.mutex.Unlock() - st.config.Cache.TombstoneSweepFreq = v + st.config.Cache.GTS.TombstoneSweepFreq = v st.reloadToViper() } -// CacheTombstoneSweepFreqFlag returns the flag name for the 'Cache.TombstoneSweepFreq' field -func CacheTombstoneSweepFreqFlag() string { return "cache-tombstone-sweep-freq" } +// CacheGTSTombstoneSweepFreqFlag returns the flag name for the 'Cache.GTS.TombstoneSweepFreq' field +func CacheGTSTombstoneSweepFreqFlag() string { return "cache-gts-tombstone-sweep-freq" } -// GetCacheTombstoneSweepFreq safely fetches the value for global configuration 'Cache.TombstoneSweepFreq' field -func GetCacheTombstoneSweepFreq() time.Duration { return global.GetCacheTombstoneSweepFreq() } +// GetCacheGTSTombstoneSweepFreq safely fetches the value for global configuration 'Cache.GTS.TombstoneSweepFreq' field +func GetCacheGTSTombstoneSweepFreq() time.Duration { return global.GetCacheGTSTombstoneSweepFreq() } -// SetCacheTombstoneSweepFreq safely sets the value for global configuration 'Cache.TombstoneSweepFreq' field -func SetCacheTombstoneSweepFreq(v time.Duration) { global.SetCacheTombstoneSweepFreq(v) } +// SetCacheGTSTombstoneSweepFreq safely sets the value for global configuration 'Cache.GTS.TombstoneSweepFreq' field +func SetCacheGTSTombstoneSweepFreq(v time.Duration) { global.SetCacheGTSTombstoneSweepFreq(v) } -// GetCacheUserMaxSize safely fetches the Configuration value for state's 'Cache.UserMaxSize' field -func (st *ConfigState) GetCacheUserMaxSize() (v int) { +// GetCacheGTSUserMaxSize safely fetches the Configuration value for state's 'Cache.GTS.UserMaxSize' field +func (st *ConfigState) GetCacheGTSUserMaxSize() (v int) { st.mutex.Lock() - v = st.config.Cache.UserMaxSize + v = st.config.Cache.GTS.UserMaxSize st.mutex.Unlock() return } -// SetCacheUserMaxSize safely sets the Configuration value for state's 'Cache.UserMaxSize' field -func (st *ConfigState) SetCacheUserMaxSize(v int) { +// SetCacheGTSUserMaxSize safely sets the Configuration value for state's 'Cache.GTS.UserMaxSize' field +func (st *ConfigState) SetCacheGTSUserMaxSize(v int) { st.mutex.Lock() defer st.mutex.Unlock() - st.config.Cache.UserMaxSize = v + st.config.Cache.GTS.UserMaxSize = v st.reloadToViper() } -// CacheUserMaxSizeFlag returns the flag name for the 'Cache.UserMaxSize' field -func CacheUserMaxSizeFlag() string { return "cache-user-max-size" } +// CacheGTSUserMaxSizeFlag returns the flag name for the 'Cache.GTS.UserMaxSize' field +func CacheGTSUserMaxSizeFlag() string { return "cache-gts-user-max-size" } -// GetCacheUserMaxSize safely fetches the value for global configuration 'Cache.UserMaxSize' field -func GetCacheUserMaxSize() int { return global.GetCacheUserMaxSize() } +// GetCacheGTSUserMaxSize safely fetches the value for global configuration 'Cache.GTS.UserMaxSize' field +func GetCacheGTSUserMaxSize() int { return global.GetCacheGTSUserMaxSize() } -// SetCacheUserMaxSize safely sets the value for global configuration 'Cache.UserMaxSize' field -func SetCacheUserMaxSize(v int) { global.SetCacheUserMaxSize(v) } +// SetCacheGTSUserMaxSize safely sets the value for global configuration 'Cache.GTS.UserMaxSize' field +func SetCacheGTSUserMaxSize(v int) { global.SetCacheGTSUserMaxSize(v) } -// GetCacheUserTTL safely fetches the Configuration value for state's 'Cache.UserTTL' field -func (st *ConfigState) GetCacheUserTTL() (v time.Duration) { +// GetCacheGTSUserTTL safely fetches the Configuration value for state's 'Cache.GTS.UserTTL' field +func (st *ConfigState) GetCacheGTSUserTTL() (v time.Duration) { st.mutex.Lock() - v = st.config.Cache.UserTTL + v = st.config.Cache.GTS.UserTTL st.mutex.Unlock() return } -// SetCacheUserTTL safely sets the Configuration value for state's 'Cache.UserTTL' field -func (st *ConfigState) SetCacheUserTTL(v time.Duration) { +// SetCacheGTSUserTTL safely sets the Configuration value for state's 'Cache.GTS.UserTTL' field +func (st *ConfigState) SetCacheGTSUserTTL(v time.Duration) { st.mutex.Lock() defer st.mutex.Unlock() - st.config.Cache.UserTTL = v + st.config.Cache.GTS.UserTTL = v st.reloadToViper() } -// CacheUserTTLFlag returns the flag name for the 'Cache.UserTTL' field -func CacheUserTTLFlag() string { return "cache-user-ttl" } +// CacheGTSUserTTLFlag returns the flag name for the 'Cache.GTS.UserTTL' field +func CacheGTSUserTTLFlag() string { return "cache-gts-user-ttl" } -// GetCacheUserTTL safely fetches the value for global configuration 'Cache.UserTTL' field -func GetCacheUserTTL() time.Duration { return global.GetCacheUserTTL() } +// GetCacheGTSUserTTL safely fetches the value for global configuration 'Cache.GTS.UserTTL' field +func GetCacheGTSUserTTL() time.Duration { return global.GetCacheGTSUserTTL() } -// SetCacheUserTTL safely sets the value for global configuration 'Cache.UserTTL' field -func SetCacheUserTTL(v time.Duration) { global.SetCacheUserTTL(v) } +// SetCacheGTSUserTTL safely sets the value for global configuration 'Cache.GTS.UserTTL' field +func SetCacheGTSUserTTL(v time.Duration) { global.SetCacheGTSUserTTL(v) } -// GetCacheUserSweepFreq safely fetches the Configuration value for state's 'Cache.UserSweepFreq' field -func (st *ConfigState) GetCacheUserSweepFreq() (v time.Duration) { +// GetCacheGTSUserSweepFreq safely fetches the Configuration value for state's 'Cache.GTS.UserSweepFreq' field +func (st *ConfigState) GetCacheGTSUserSweepFreq() (v time.Duration) { st.mutex.Lock() - v = st.config.Cache.UserSweepFreq + v = st.config.Cache.GTS.UserSweepFreq st.mutex.Unlock() return } -// SetCacheUserSweepFreq safely sets the Configuration value for state's 'Cache.UserSweepFreq' field -func (st *ConfigState) SetCacheUserSweepFreq(v time.Duration) { +// SetCacheGTSUserSweepFreq safely sets the Configuration value for state's 'Cache.GTS.UserSweepFreq' field +func (st *ConfigState) SetCacheGTSUserSweepFreq(v time.Duration) { st.mutex.Lock() defer st.mutex.Unlock() - st.config.Cache.UserSweepFreq = v + st.config.Cache.GTS.UserSweepFreq = v st.reloadToViper() } -// CacheUserSweepFreqFlag returns the flag name for the 'Cache.UserSweepFreq' field -func CacheUserSweepFreqFlag() string { return "cache-user-sweep-freq" } +// CacheGTSUserSweepFreqFlag returns the flag name for the 'Cache.GTS.UserSweepFreq' field +func CacheGTSUserSweepFreqFlag() string { return "cache-gts-user-sweep-freq" } -// GetCacheUserSweepFreq safely fetches the value for global configuration 'Cache.UserSweepFreq' field -func GetCacheUserSweepFreq() time.Duration { return global.GetCacheUserSweepFreq() } +// GetCacheGTSUserSweepFreq safely fetches the value for global configuration 'Cache.GTS.UserSweepFreq' field +func GetCacheGTSUserSweepFreq() time.Duration { return global.GetCacheGTSUserSweepFreq() } -// SetCacheUserSweepFreq safely sets the value for global configuration 'Cache.UserSweepFreq' field -func SetCacheUserSweepFreq(v time.Duration) { global.SetCacheUserSweepFreq(v) } +// SetCacheGTSUserSweepFreq safely sets the value for global configuration 'Cache.GTS.UserSweepFreq' field +func SetCacheGTSUserSweepFreq(v time.Duration) { global.SetCacheGTSUserSweepFreq(v) } // GetAdminAccountUsername safely fetches the Configuration value for state's 'AdminAccountUsername' field func (st *ConfigState) GetAdminAccountUsername() (v string) { diff --git a/internal/config/testdata/test.yaml b/internal/config/testdata/test.yaml index 2f4bcbb8..3b2b63fe 100644 --- a/internal/config/testdata/test.yaml +++ b/internal/config/testdata/test.yaml @@ -412,6 +412,7 @@ syslog-address: "localhost:514" # Cache configuration cache: - account-max-size: 99 - account-ttl: "3h" - account-sweep-freq: "1s" \ No newline at end of file + gts: + account-max-size: 99 + account-ttl: "3h" + account-sweep-freq: "1s" \ No newline at end of file diff --git a/test/envparsing.sh b/test/envparsing.sh index 1f355968..2fc9c055 100755 --- a/test/envparsing.sh +++ b/test/envparsing.sh @@ -2,7 +2,7 @@ set -eu -EXPECT='{"account-domain":"peepee","accounts-allow-custom-css":true,"accounts-approval-required":false,"accounts-reason-required":false,"accounts-registration-open":true,"advanced-cookies-samesite":"strict","advanced-rate-limit-requests":6969,"application-name":"gts","bind-address":"127.0.0.1","cache":{"account-max-size":100,"account-sweep-freq":10000000000,"account-ttl":300000000000,"block-max-size":100,"block-sweep-freq":10000000000,"block-ttl":300000000000,"domain-block-max-size":1000,"domain-block-sweep-freq":60000000000,"domain-block-ttl":86400000000000,"emoji-category-max-size":100,"emoji-category-sweep-freq":10000000000,"emoji-category-ttl":300000000000,"emoji-max-size":500,"emoji-sweep-freq":10000000000,"emoji-ttl":300000000000,"mention-max-size":500,"mention-sweep-freq":10000000000,"mention-ttl":300000000000,"notification-max-size":500,"notification-sweep-freq":10000000000,"notification-ttl":300000000000,"status-max-size":500,"status-sweep-freq":10000000000,"status-ttl":300000000000,"tombstone-max-size":100,"tombstone-sweep-freq":10000000000,"tombstone-ttl":300000000000,"user-max-size":100,"user-sweep-freq":10000000000,"user-ttl":300000000000},"config-path":"internal/config/testdata/test.yaml","db-address":":memory:","db-database":"gotosocial_prod","db-password":"hunter2","db-port":6969,"db-tls-ca-cert":"","db-tls-mode":"disable","db-type":"sqlite","db-user":"sex-haver","dry-run":false,"email":"","host":"example.com","instance-deliver-to-shared-inboxes":false,"instance-expose-peers":true,"instance-expose-public-timeline":true,"instance-expose-suspended":true,"landing-page-user":"admin","letsencrypt-cert-dir":"/gotosocial/storage/certs","letsencrypt-email-address":"","letsencrypt-enabled":true,"letsencrypt-port":80,"log-db-queries":true,"log-level":"info","media-description-max-chars":5000,"media-description-min-chars":69,"media-emoji-local-max-size":420,"media-emoji-remote-max-size":420,"media-image-max-size":420,"media-remote-cache-days":30,"media-video-max-size":420,"oidc-client-id":"1234","oidc-client-secret":"shhhh its a secret","oidc-enabled":true,"oidc-idp-name":"sex-haver","oidc-issuer":"whoknows","oidc-link-existing":true,"oidc-scopes":["read","write"],"oidc-skip-verification":true,"password":"","path":"","port":6969,"protocol":"http","smtp-from":"queen.rip.in.piss@terfisland.org","smtp-host":"example.com","smtp-password":"hunter2","smtp-port":4269,"smtp-username":"sex-haver","software-version":"","statuses-cw-max-chars":420,"statuses-max-chars":69,"statuses-media-max-files":1,"statuses-poll-max-options":1,"statuses-poll-option-max-chars":50,"storage-backend":"local","storage-local-base-path":"/root/store","storage-s3-access-key":"minio","storage-s3-bucket":"gts","storage-s3-endpoint":"localhost:9000","storage-s3-proxy":true,"storage-s3-secret-key":"miniostorage","storage-s3-use-ssl":false,"syslog-address":"127.0.0.1:6969","syslog-enabled":true,"syslog-protocol":"udp","trusted-proxies":["127.0.0.1/32","docker.host.local"],"username":"","web-asset-base-dir":"/root","web-template-base-dir":"/root"}' +EXPECT='{"account-domain":"peepee","accounts-allow-custom-css":true,"accounts-approval-required":false,"accounts-reason-required":false,"accounts-registration-open":true,"advanced-cookies-samesite":"strict","advanced-rate-limit-requests":6969,"application-name":"gts","bind-address":"127.0.0.1","cache":{"gts":{"account-max-size":99,"account-sweep-freq":1000000000,"account-ttl":10800000000000,"block-max-size":100,"block-sweep-freq":10000000000,"block-ttl":300000000000,"domain-block-max-size":1000,"domain-block-sweep-freq":60000000000,"domain-block-ttl":86400000000000,"emoji-category-max-size":100,"emoji-category-sweep-freq":10000000000,"emoji-category-ttl":300000000000,"emoji-max-size":500,"emoji-sweep-freq":10000000000,"emoji-ttl":300000000000,"mention-max-size":500,"mention-sweep-freq":10000000000,"mention-ttl":300000000000,"notification-max-size":500,"notification-sweep-freq":10000000000,"notification-ttl":300000000000,"status-max-size":500,"status-sweep-freq":10000000000,"status-ttl":300000000000,"tombstone-max-size":100,"tombstone-sweep-freq":10000000000,"tombstone-ttl":300000000000,"user-max-size":100,"user-sweep-freq":10000000000,"user-ttl":300000000000}},"config-path":"internal/config/testdata/test.yaml","db-address":":memory:","db-database":"gotosocial_prod","db-password":"hunter2","db-port":6969,"db-tls-ca-cert":"","db-tls-mode":"disable","db-type":"sqlite","db-user":"sex-haver","dry-run":false,"email":"","host":"example.com","instance-deliver-to-shared-inboxes":false,"instance-expose-peers":true,"instance-expose-public-timeline":true,"instance-expose-suspended":true,"landing-page-user":"admin","letsencrypt-cert-dir":"/gotosocial/storage/certs","letsencrypt-email-address":"","letsencrypt-enabled":true,"letsencrypt-port":80,"log-db-queries":true,"log-level":"info","media-description-max-chars":5000,"media-description-min-chars":69,"media-emoji-local-max-size":420,"media-emoji-remote-max-size":420,"media-image-max-size":420,"media-remote-cache-days":30,"media-video-max-size":420,"oidc-client-id":"1234","oidc-client-secret":"shhhh its a secret","oidc-enabled":true,"oidc-idp-name":"sex-haver","oidc-issuer":"whoknows","oidc-link-existing":true,"oidc-scopes":["read","write"],"oidc-skip-verification":true,"password":"","path":"","port":6969,"protocol":"http","smtp-from":"queen.rip.in.piss@terfisland.org","smtp-host":"example.com","smtp-password":"hunter2","smtp-port":4269,"smtp-username":"sex-haver","software-version":"","statuses-cw-max-chars":420,"statuses-max-chars":69,"statuses-media-max-files":1,"statuses-poll-max-options":1,"statuses-poll-option-max-chars":50,"storage-backend":"local","storage-local-base-path":"/root/store","storage-s3-access-key":"minio","storage-s3-bucket":"gts","storage-s3-endpoint":"localhost:9000","storage-s3-proxy":true,"storage-s3-secret-key":"miniostorage","storage-s3-use-ssl":false,"syslog-address":"127.0.0.1:6969","syslog-enabled":true,"syslog-protocol":"udp","trusted-proxies":["127.0.0.1/32","docker.host.local"],"username":"","web-asset-base-dir":"/root","web-template-base-dir":"/root"}' # Set all the environment variables to # ensure that these are parsed without panic diff --git a/testrig/config.go b/testrig/config.go index 2415b69e..a1d7e5d5 100644 --- a/testrig/config.go +++ b/testrig/config.go @@ -19,8 +19,6 @@ package testrig import ( - "time" - "github.com/coreos/go-oidc/v3/oidc" "github.com/superseriousbusiness/gotosocial/internal/config" ) @@ -113,45 +111,6 @@ var testDefaults = config.Configuration{ SoftwareVersion: "0.0.0-testrig", - Cache: config.CacheConfig{ - AccountMaxSize: 100, - AccountTTL: time.Minute * 5, - AccountSweepFreq: time.Second * 10, - - BlockMaxSize: 100, - BlockTTL: time.Minute * 5, - BlockSweepFreq: time.Second * 10, - - DomainBlockMaxSize: 1000, - DomainBlockTTL: time.Hour * 24, - DomainBlockSweepFreq: time.Minute, - - EmojiMaxSize: 500, - EmojiTTL: time.Minute * 5, - EmojiSweepFreq: time.Second * 10, - - EmojiCategoryMaxSize: 100, - EmojiCategoryTTL: time.Minute * 5, - EmojiCategorySweepFreq: time.Second * 10, - - MentionMaxSize: 500, - MentionTTL: time.Minute * 5, - MentionSweepFreq: time.Second * 10, - - NotificationMaxSize: 500, - NotificationTTL: time.Minute * 5, - NotificationSweepFreq: time.Second * 10, - - StatusMaxSize: 500, - StatusTTL: time.Minute * 5, - StatusSweepFreq: time.Second * 10, - - TombstoneMaxSize: 100, - TombstoneTTL: time.Minute * 5, - TombstoneSweepFreq: time.Second * 10, - - UserMaxSize: 100, - UserTTL: time.Minute * 5, - UserSweepFreq: time.Second * 10, - }, + // simply use cache defaults. + Cache: config.Defaults.Cache, }