settings

package
v0.7.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 7, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyToConfig

func ApplyToConfig(base *config.Config, runtime *RuntimeSettings) *config.Config

apply runtime-editable settings on top of bootstrap config.

func ValidateArrIntegrations

func ValidateArrIntegrations(integrations []ArrIntegrationRuntimeSettings) error

Types

type AggregatorRuntimeSettings added in v0.7.1

type AggregatorRuntimeSettings = app.AggregatorRuntimeSettings

type ArrIntegrationRuntimeSettings

type ArrIntegrationRuntimeSettings = app.ArrIntegrationRuntimeSettings

type DownloadRuntimeSettings

type DownloadRuntimeSettings = app.DownloadRuntimeSettings

type IndexerRuntimeSettings

type IndexerRuntimeSettings = app.IndexerRuntimeSettings

type IndexingRuntimeSettings

type IndexingRuntimeSettings = app.IndexingRuntimeSettings

type RuntimeSettings

type RuntimeSettings = app.RuntimeSettings

runtime-editable settings model for Milestone 8.X chunk 1. Bootstrap-only fields stay in config.yaml/env and are not represented here.

func ApplyPatch

func ApplyPatch(current *RuntimeSettings, patch *RuntimeSettingsPatch) *RuntimeSettings

exported patch helper for admin API preview/validation path.

func CloneRuntimeSettings

func CloneRuntimeSettings(in *RuntimeSettings) *RuntimeSettings

explicit clone used when persisting a validated full snapshot.

func DefaultRuntimeSettings added in v0.7.1

func DefaultRuntimeSettings() *RuntimeSettings

func FromConfig

func FromConfig(cfg *config.Config) *RuntimeSettings

derive editable runtime state from current effective config.

func RedactedCopy

func RedactedCopy(in *RuntimeSettings) *RuntimeSettings

redact runtime secrets before returning settings through API.

func WithRuntimeDefaults added in v0.7.1

func WithRuntimeDefaults(in *RuntimeSettings) *RuntimeSettings

type RuntimeSettingsPatch

type RuntimeSettingsPatch = app.RuntimeSettingsPatch

type ServerRuntimeSettings

type ServerRuntimeSettings = app.ServerRuntimeSettings

type Store

type Store struct {
	// contains filtered or unexported fields
}

func NewStore

func NewStore(dbPath string) (*Store, error)

func (*Store) Close

func (s *Store) Close() error

func (*Store) CountAuthUsers added in v0.7.0

func (s *Store) CountAuthUsers(ctx context.Context) (int, error)

func (*Store) CreateAuthSession added in v0.7.0

func (s *Store) CreateAuthSession(ctx context.Context, session auth.Session) error

func (*Store) CreateAuthToken added in v0.7.0

func (s *Store) CreateAuthToken(ctx context.Context, token auth.StoredToken) error

func (*Store) CreateInitialAuthUser added in v0.7.0

func (s *Store) CreateInitialAuthUser(ctx context.Context, user auth.StoredUser, roleIDs []string) error

func (*Store) DeleteAuthRole added in v0.7.0

func (s *Store) DeleteAuthRole(ctx context.Context, roleID string) error

func (*Store) DeleteAuthSession added in v0.7.0

func (s *Store) DeleteAuthSession(ctx context.Context, sessionID string) error

func (*Store) DeleteAuthUser added in v0.7.0

func (s *Store) DeleteAuthUser(ctx context.Context, userID string) error

func (*Store) EnsureAuthDefaults added in v0.7.0

func (s *Store) EnsureAuthDefaults(ctx context.Context, roles []auth.Role) error

func (*Store) ExpectedSchemaVersion

func (s *Store) ExpectedSchemaVersion() int

func (*Store) GetAuthSession added in v0.7.0

func (s *Store) GetAuthSession(ctx context.Context, sessionID string) (*auth.Session, error)

func (*Store) GetAuthTokenByHash added in v0.7.0

func (s *Store) GetAuthTokenByHash(ctx context.Context, tokenHash string) (*auth.StoredToken, error)

func (*Store) GetAuthTokenByID added in v0.7.0

func (s *Store) GetAuthTokenByID(ctx context.Context, tokenID string) (*auth.StoredToken, error)

func (*Store) GetAuthUserByID added in v0.7.0

func (s *Store) GetAuthUserByID(ctx context.Context, userID string) (*auth.StoredUser, error)

func (*Store) GetAuthUserByUsername added in v0.7.0

func (s *Store) GetAuthUserByUsername(ctx context.Context, username string) (*auth.StoredUser, error)

func (*Store) GetRuntimeSettings

func (s *Store) GetRuntimeSettings(ctx context.Context, base ...*config.Config) (*RuntimeSettings, error)

return the latest persisted runtime settings revision. If no row exists yet, fall back to bootstrap-derived defaults.

func (*Store) ListAuthRoles added in v0.7.0

func (s *Store) ListAuthRoles(ctx context.Context) ([]auth.Role, error)

func (*Store) ListAuthTokens added in v0.7.0

func (s *Store) ListAuthTokens(ctx context.Context) ([]auth.Token, error)

func (*Store) ListAuthTokensByUserID added in v0.7.0

func (s *Store) ListAuthTokensByUserID(ctx context.Context, userID string) ([]auth.Token, error)

func (*Store) ListAuthUserRoleIDs added in v0.7.0

func (s *Store) ListAuthUserRoleIDs(ctx context.Context, userID string) ([]string, error)

func (*Store) ListAuthUsers added in v0.7.0

func (s *Store) ListAuthUsers(ctx context.Context) ([]auth.StoredUser, error)

func (*Store) LoadEffectiveSettings

func (s *Store) LoadEffectiveSettings(ctx context.Context, base *config.Config) (*config.Config, error)

load latest runtime settings revision and overlay it onto bootstrap config.

func (*Store) Ping

func (s *Store) Ping(ctx context.Context) error

func (*Store) ReplaceAuthUserRoles added in v0.7.0

func (s *Store) ReplaceAuthUserRoles(ctx context.Context, userID string, roleIDs []string) error

func (*Store) RevokeAuthToken added in v0.7.0

func (s *Store) RevokeAuthToken(ctx context.Context, tokenID string) error

func (*Store) RunMigrations

func (s *Store) RunMigrations() error

func (*Store) SchemaVersion

func (s *Store) SchemaVersion(ctx context.Context) (int, error)

func (*Store) TouchAuthSession added in v0.7.0

func (s *Store) TouchAuthSession(ctx context.Context, sessionID string, seenAt time.Time) error

func (*Store) TouchAuthToken added in v0.7.0

func (s *Store) TouchAuthToken(ctx context.Context, tokenID string, seenAt time.Time) error

func (*Store) UpdateSettings

func (s *Store) UpdateSettings(ctx context.Context, next *RuntimeSettings) error

patch and persist the latest runtime settings state as a new atomic revision.

func (*Store) UpsertAuthRole added in v0.7.0

func (s *Store) UpsertAuthRole(ctx context.Context, role auth.Role) error

func (*Store) UpsertAuthUser added in v0.7.0

func (s *Store) UpsertAuthUser(ctx context.Context, user auth.StoredUser) error

func (*Store) ValidateSchema

func (s *Store) ValidateSchema(ctx context.Context) error

func (*Store) WatchSettingsChanges

func (s *Store) WatchSettingsChanges(ctx context.Context) (<-chan struct{}, error)

poll settings_revision for new ids and publish a lightweight signal. This is intentionally simple for the first live-reload slice.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL