Documentation
¶
Overview ¶
Package globalconfig serves the runtime global config as a lock-free atomic snapshot loaded from the instance_config singleton, shared by the service and server layers. Load at boot; refresh after every write (write-through).
Index ¶
- type Accessor
- func (a *Accessor) AdminEmails() string
- func (a *Accessor) CandidatePool() int
- func (a *Accessor) CleanupEnabled() bool
- func (a *Accessor) CleanupIntervalHours() int
- func (a *Accessor) CleanupScanDefault() bool
- func (a *Accessor) DuplicateGuardDefault() bool
- func (a *Accessor) DuplicateThreshold() float64
- func (a *Accessor) HistoryEnabled() bool
- func (a *Accessor) HistoryRetentionDays() int
- func (a *Accessor) Load(ctx context.Context) error
- func (a *Accessor) LogLevel() string
- func (a *Accessor) MMRLambda() float64
- func (a *Accessor) MaxRequestBytes() int64
- func (a *Accessor) RateLimitBurst() int
- func (a *Accessor) RateLimitRPS() float64
- func (a *Accessor) Refresh(ctx context.Context) error
- func (a *Accessor) SelfServicePolicy() string
- func (a *Accessor) SignupDomains() string
- func (a *Accessor) Snapshot() *Snapshot
- func (a *Accessor) SnippetChars() int
- func (a *Accessor) StalenessDefault() string
- func (a *Accessor) StalenessPenalty() float64
- func (a *Accessor) TrustedProxyDepth() int
- func (a *Accessor) WebhookURL() string
- type Loader
- type Snapshot
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Accessor ¶
type Accessor struct {
// contains filtered or unexported fields
}
Accessor holds the current global-config snapshot behind an atomic pointer.
func (*Accessor) AdminEmails ¶
func (*Accessor) CandidatePool ¶
func (*Accessor) CleanupEnabled ¶
func (*Accessor) CleanupIntervalHours ¶
func (*Accessor) CleanupScanDefault ¶
func (*Accessor) DuplicateGuardDefault ¶
func (*Accessor) DuplicateThreshold ¶
func (*Accessor) HistoryEnabled ¶
func (*Accessor) HistoryRetentionDays ¶
func (*Accessor) MaxRequestBytes ¶
func (*Accessor) RateLimitBurst ¶
func (*Accessor) RateLimitRPS ¶
func (*Accessor) SelfServicePolicy ¶
func (*Accessor) SignupDomains ¶
func (*Accessor) SnippetChars ¶
func (*Accessor) StalenessDefault ¶
func (*Accessor) StalenessPenalty ¶
func (*Accessor) TrustedProxyDepth ¶
func (*Accessor) WebhookURL ¶
type Loader ¶
type Loader interface {
Get(ctx context.Context) (*models.InstanceConfig, error)
}
Loader fetches the singleton instance_config row. *repository.InstanceConfigRepository satisfies it.
type Snapshot ¶
type Snapshot struct {
MMRLambda float64
StalenessPenalty float64
CandidatePool int
SnippetChars int
HistoryRetentionDays int
HistoryEnabled bool
StalenessDefault string
DuplicateGuardDefault bool
CleanupScanDefault bool
DuplicateThreshold float64
SelfServicePolicy string
SignupDomains string
AdminEmails string
CleanupEnabled bool
CleanupIntervalHours int
RateLimitRPS float64
RateLimitBurst int
TrustedProxyDepth int
MaxRequestBytes int64
LogLevel string
WebhookURL string
}
Snapshot is an immutable typed view of the globals, swapped atomically on refresh.
Click to show internal directories.
Click to hide internal directories.