Documentation
¶
Index ¶
- type DependencyManager
- func (dm *DependencyManager) AutoMigrateAll()
- func (dm *DependencyManager) AutoMigrateCore()
- func (dm *DependencyManager) AutoMigrateDatabase()
- func (dm *DependencyManager) AutoMigrateLogStorageService()
- func (dm *DependencyManager) AutoMigratePredefinedActors()
- func (dm *DependencyManager) AutoMigrateSyncKeysToDatabase()
- func (dm *DependencyManager) GetAsyncClient() apasynq.Client
- func (dm *DependencyManager) GetAsyncDefaultOptions() []asynq.Option
- func (dm *DependencyManager) GetAsyncInspector() *asynq.Inspector
- func (dm *DependencyManager) GetConfig() config.C
- func (dm *DependencyManager) GetConfigRoot() *sconfig.Root
- func (dm *DependencyManager) GetCoreService() coreIface.C
- func (dm *DependencyManager) GetDatabase() database.DB
- func (dm *DependencyManager) GetEncryptService() encrypt.E
- func (dm *DependencyManager) GetHttpf() httpf.F
- func (dm *DependencyManager) GetLogBuilder() aplog.Builder
- func (dm *DependencyManager) GetLogStorageService() *request_log.StorageService
- func (dm *DependencyManager) GetLogger() *slog.Logger
- func (dm *DependencyManager) GetRateLimitCache() ratelimit.Cache
- func (dm *DependencyManager) GetRateLimitEnforcerFactory() *ratelimit.EnforcerFactory
- func (dm *DependencyManager) GetRateLimitFactory() *ratelimit.Factory
- func (dm *DependencyManager) GetRedisClient() apredis.Client
- func (dm *DependencyManager) GetRootLogger() *slog.Logger
- func (dm *DependencyManager) GetServiceId() string
- func (dm *DependencyManager) GetTelemetry() *aptelemetry.Providers
- func (dm *DependencyManager) RegisterAsynqClientPing()
- func (dm *DependencyManager) RegisterDatabasePing()
- func (dm *DependencyManager) RegisterLogStoragePing()
- func (dm *DependencyManager) RegisterPing(name string, fn PingFunc)
- func (dm *DependencyManager) RegisterRedisPing()
- func (dm *DependencyManager) RunPings(ctx context.Context) (map[string]bool, bool)
- func (dm *DependencyManager) ShutdownTelemetry()
- func (dm *DependencyManager) StartRateLimitRefresher(ctx context.Context) (stop func())
- type PingFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DependencyManager ¶
type DependencyManager struct {
// contains filtered or unexported fields
}
func NewDependencyManager ¶
func NewDependencyManager(serviceId string, cfg config.C) *DependencyManager
func (*DependencyManager) AutoMigrateAll ¶
func (dm *DependencyManager) AutoMigrateAll()
func (*DependencyManager) AutoMigrateCore ¶
func (dm *DependencyManager) AutoMigrateCore()
TODO: this automigrate should not be specific to the connectors config
func (*DependencyManager) AutoMigrateDatabase ¶
func (dm *DependencyManager) AutoMigrateDatabase()
AutoMigrateDatabase will attempt to migrate the database if the root config has auto migrate enabled.
func (*DependencyManager) AutoMigrateLogStorageService ¶
func (dm *DependencyManager) AutoMigrateLogStorageService()
func (*DependencyManager) AutoMigratePredefinedActors ¶
func (dm *DependencyManager) AutoMigratePredefinedActors()
AutoMigratePredefinedActors synchronizes actors from ConfiguredActorsList configuration to the database. This only runs for ConfiguredActorsList configuration (not ConfiguredActorsExternalSource which uses cron). Uses a distributed Redis lock to ensure only one instance performs the migration.
func (*DependencyManager) AutoMigrateSyncKeysToDatabase ¶
func (dm *DependencyManager) AutoMigrateSyncKeysToDatabase()
AutoMigrateSyncKeysToDatabase syncs encryption key versions from config into the database. Uses a Redis sentinel to avoid redundant runs across processes.
func (*DependencyManager) GetAsyncClient ¶
func (dm *DependencyManager) GetAsyncClient() apasynq.Client
func (*DependencyManager) GetAsyncDefaultOptions ¶
func (dm *DependencyManager) GetAsyncDefaultOptions() []asynq.Option
func (*DependencyManager) GetAsyncInspector ¶
func (dm *DependencyManager) GetAsyncInspector() *asynq.Inspector
func (*DependencyManager) GetConfig ¶
func (dm *DependencyManager) GetConfig() config.C
func (*DependencyManager) GetConfigRoot ¶
func (dm *DependencyManager) GetConfigRoot() *sconfig.Root
func (*DependencyManager) GetCoreService ¶
func (dm *DependencyManager) GetCoreService() coreIface.C
func (*DependencyManager) GetDatabase ¶
func (dm *DependencyManager) GetDatabase() database.DB
func (*DependencyManager) GetEncryptService ¶
func (dm *DependencyManager) GetEncryptService() encrypt.E
func (*DependencyManager) GetHttpf ¶
func (dm *DependencyManager) GetHttpf() httpf.F
func (*DependencyManager) GetLogBuilder ¶
func (dm *DependencyManager) GetLogBuilder() aplog.Builder
func (*DependencyManager) GetLogStorageService ¶
func (dm *DependencyManager) GetLogStorageService() *request_log.StorageService
func (*DependencyManager) GetLogger ¶
func (dm *DependencyManager) GetLogger() *slog.Logger
func (*DependencyManager) GetRateLimitCache ¶
func (dm *DependencyManager) GetRateLimitCache() ratelimit.Cache
GetRateLimitCache returns the lazily-initialised in-memory rate-limit cache for this process. The cache starts empty; call StartRateLimitRefresher() to populate and keep it fresh from the database.
func (*DependencyManager) GetRateLimitEnforcerFactory ¶
func (dm *DependencyManager) GetRateLimitEnforcerFactory() *ratelimit.EnforcerFactory
GetRateLimitEnforcerFactory returns the middleware factory that evaluates proxy-side RateLimit resources against in-flight requests (#223). Reads from the same in-memory cache that the Refresher (#219) populates. Construction is cheap; the heavy lifting happens per-request inside the round-tripper.
func (*DependencyManager) GetRateLimitFactory ¶
func (dm *DependencyManager) GetRateLimitFactory() *ratelimit.Factory
func (*DependencyManager) GetRedisClient ¶
func (dm *DependencyManager) GetRedisClient() apredis.Client
func (*DependencyManager) GetRootLogger ¶
func (dm *DependencyManager) GetRootLogger() *slog.Logger
func (*DependencyManager) GetServiceId ¶
func (dm *DependencyManager) GetServiceId() string
func (*DependencyManager) GetTelemetry ¶
func (dm *DependencyManager) GetTelemetry() *aptelemetry.Providers
GetTelemetry returns the OTel providers for this service. When telemetry is disabled or unconfigured, the returned Providers are no-op implementations.
The first call lazily initialises the SDK; subsequent calls return the same Providers. Initialisation failure is panicked, matching the pattern used by other dependencies on this manager. Use ShutdownTelemetry to flush and tear down before exit.
func (*DependencyManager) RegisterAsynqClientPing ¶
func (dm *DependencyManager) RegisterAsynqClientPing()
RegisterAsynqClientPing registers a ping for the Asynq client.
func (*DependencyManager) RegisterDatabasePing ¶
func (dm *DependencyManager) RegisterDatabasePing()
RegisterDatabasePing registers a ping for the database.
func (*DependencyManager) RegisterLogStoragePing ¶
func (dm *DependencyManager) RegisterLogStoragePing()
RegisterLogStoragePing registers a ping for the log storage service.
func (*DependencyManager) RegisterPing ¶
func (dm *DependencyManager) RegisterPing(name string, fn PingFunc)
RegisterPing registers a named ping function for health checking.
func (*DependencyManager) RegisterRedisPing ¶
func (dm *DependencyManager) RegisterRedisPing()
RegisterRedisPing registers a ping for Redis.
func (*DependencyManager) RunPings ¶
RunPings runs all registered ping functions concurrently and returns a map of results and whether all pings succeeded.
func (*DependencyManager) ShutdownTelemetry ¶
func (dm *DependencyManager) ShutdownTelemetry()
ShutdownTelemetry flushes and tears down OTel providers if they were initialised. Safe to call multiple times. Bounded by aptelemetry.ShutdownTimeout.
func (*DependencyManager) StartRateLimitRefresher ¶
func (dm *DependencyManager) StartRateLimitRefresher(ctx context.Context) (stop func())
StartRateLimitRefresher boots the background goroutine that keeps the in-memory rate-limit cache fresh from the database. The returned stop function cancels the goroutine and waits for it to exit; api/admin-api callers should defer it.
Multiple calls within the same process are safe but only the first actually starts a goroutine — subsequent calls return a no-op stop.
Directories
¶
| Path | Synopsis |
|---|---|
|
swagger
Package swagger contains the Swagger documentation configuration
|
Package swagger contains the Swagger documentation configuration |
|
swagger
Package swagger contains the Swagger documentation configuration
|
Package swagger contains the Swagger documentation configuration |