fxmodules

package
v0.19.1132 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2026 License: AGPL-3.0 Imports: 165 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

ActionsWorkerModule provides the actions namespace worker.

View Source
var AdminDashboardAPIModule = fx.Module("admin-dashboard-api",
	fx.Provide(api.NewEndpointAudit),
	fx.Provide(api.AsAPI(api.NewAdminDashboardAPI)),
	fx.Invoke(db.DBGroupParam(func([]*gorm.DB) {})),
	fx.Invoke(api.APIGroupParam(func([]*api.API) {})),
)

AdminDashboardAPIModule provides the admin dashboard API server.

View Source
var AdminDashboardServicesModule = fx.Module("admin-dashboard-services",
	sharedServices,
	fx.Provide(psql.AsPSQLReplica(psql.NewReplica)),
)

AdminDashboardServicesModule provides services for the admin dashboard API.

AllAPIsModule provides all API servers (for running all in one process).

View Source
var AllServicesModule = fx.Module("all-services",
	sharedServices,
	fx.Provide(api.AsService(authservice.New)),
)

AllServicesModule provides all services including authservice (for dev mode).

AppsWorkerModule provides the apps namespace worker.

View Source
var AuthAPIModule = fx.Module("auth-api",
	fx.Provide(api.NewEndpointAudit),
	fx.Provide(api.AsAPI(api.NewAuthAPI)),
	fx.Invoke(db.DBGroupParam(func([]*gorm.DB) {})),
	fx.Invoke(api.APIGroupParam(func([]*api.API) {})),
)

AuthAPIModule provides the auth API server.

View Source
var AuthServicesModule = fx.Module("auth-services",
	sharedServices,
	fx.Provide(api.AsService(authservice.New)),
)

AuthServicesModule provides services for the auth API (includes authservice).

ComponentsWorkerModule provides the components namespace worker.

GeneralWorkerModule provides the general namespace worker.

HelpersModule provides all domain-specific helper functions used across different parts of the application.

View Source
var InfrastructureModule = fx.Module("infrastructure",

	fx.Provide(internal.NewConfig),
	fx.WithLogger(pkglog.NewFXLog),
	fx.Provide(log.New),
	fx.Provide(dblog.New),
	fx.Provide(audit.New),

	fx.Provide(func(cfg *internal.Config) *querycollector.Collector {
		if cfg.DebugEnableQueryCollector {
			return querycollector.NewCollector(5000)
		}
		return nil
	}),

	fx.Provide(psql.AsPSQL(psql.New)),
	fx.Provide(ch.AsCH(ch.New)),

	fx.Provide(kafka.New),

	fx.Invoke(func(lc fx.Lifecycle, p queryWriterParams) {
		if p.Collector == nil {
			return
		}

		disabledTables := make(map[string]struct{})
		if p.Cfg.QueryCollectorDisabledTables != "" {
			for _, t := range strings.Split(p.Cfg.QueryCollectorDisabledTables, ",") {
				t = strings.TrimSpace(t)
				if t != "" {
					disabledTables[t] = struct{}{}
				}
			}
		}

		w := querycollector.NewWriter(querycollector.WriterConfig{
			DB:             p.CHDB,
			Logger:         p.L,
			DisabledTables: disabledTables,
		})
		p.Collector.SetWriter(w)

		lc.Append(fx.Hook{
			OnStart: func(context.Context) error {
				w.Start()
				return nil
			},
			OnStop: func(context.Context) error {
				w.Stop()
				return nil
			},
		})
	}),

	fx.Provide(blobstore.NewService),

	fx.Provide(func(cfg *internal.Config, l *zap.Logger) *filecache.FileCache {
		cache, err := filecache.New(filecache.Options{
			Dir:      cfg.TemporalBlobCacheDir,
			MaxCount: cfg.TemporalBlobCacheMaxCount,
			MaxBytes: int64(cfg.TemporalBlobCacheMaxSizeMB) * 1024 * 1024,
		})
		if err != nil {
			l.Warn("failed to create blob cache, caching disabled", zap.Error(err))
			return nil
		}
		return cache
	}),

	fx.Provide(gzip.AsGzip(gzip.New)),
	fx.Provide(largepayload.AsLargePayload(largepayload.New)),
	fx.Provide(blob.AsBlob(blob.New)),
	fx.Provide(signaldb.NewPayloadConverter),
	fx.Provide(dataconverter.New),
	fx.Provide(temporal.New),

	fx.Provide(loops.New),
	fx.Provide(salesforce.New),
	fx.Provide(github.New),
	fx.Provide(metrics.New),
	fx.Provide(propagator.New),
	fx.Provide(validator.New),
	fx.Provide(notifications.New),
	fx.Provide(terraform.New),
	fx.Provide(authz.New),
	fx.Provide(features.New),
	fx.Provide(account.New),
	fx.Provide(analytics.New),
	fx.Provide(analytics.NewTemporal),
	fx.Provide(cloudformation.NewTemplates),
	fx.Provide(arm.NewTemplates),
	fx.Provide(secretsmanager.NewService),
	fx.Provide(enqueuer.New),
	fx.Provide(queueclient.New),
	fx.Provide(emitterclient.New),
	fx.Provide(flowclient.New),
	fx.Provide(notebookclient.New),
)

InfrastructureModule provides all core infrastructure dependencies including config, logging, databases, temporal, and other shared services.

View Source
var InstallCronWorkerModule = fx.Module("worker-install-crons",
	fx.Provide(worker.AsWorker(installsworker.NewCronWorker)),
)

InstallCronWorkerModule provides the install crons worker (install-crons task queue).

InstallWorkerProvidersModule provides the install workflow/activity constructors shared by the installs worker and the install crons worker. Kept separate so either worker can run standalone without double-providing.

View Source
var InstallsWorkerModule = fx.Module("worker-installs",
	fx.Provide(worker.AsWorker(installsworker.New)),
)

InstallsWorkerModule provides the installs namespace worker (api task queue).

View Source
var InternalAPIModule = fx.Module("internal-api",
	fx.Provide(api.NewEndpointAudit),
	fx.Provide(api.AsAPI(api.NewInternalAPI)),
	fx.Invoke(db.DBGroupParam(func([]*gorm.DB) {})),
	fx.Invoke(api.APIGroupParam(func([]*api.API) {})),
)

InternalAPIModule provides the internal API server.

View Source
var InternalServicesModule = fx.Module("internal-services", sharedServices)

InternalServicesModule provides services for the internal API (excludes authservice).

KafkaConsumersModule wires every Kafka consumer, domain ones alongside the DLQ consumer from the runtime package. Which of them actually run is decided by `consumer --name`, not by what's registered here: each consumer keeps its own topic, consumer group and client, and a deployment runs one or more of them (the `otel` deployment runs otel-logs and otel-traces together). Locally `--name=all` runs them all in one process. Each also no-ops unless KAFKA_ENABLED.

So registering a new consumer here is safe — it does not join any existing deployment. What it does need is its own entry in `consumer.Names()`, and either a new deployment instance in the ctl-api chart's `consumer.instances` or an added name on an existing instance's `--name`, or nothing will ever select it.

MiddlewaresModule provides all HTTP middlewares used by the API services.

View Source
var OnboardingsWorkerModule = fx.Module("worker-onboardings",
	fx.Provide(worker.AsWorker(onboardingworker.New)),
)

OnboardingsWorkerModule provides the onboardings namespace worker.

View Source
var OrgsWorkerModule = fx.Module("worker-orgs",
	fx.Provide(orgsactivities.New),
	fx.Provide(fx.Annotate(appsactivities.New, fx.ResultTags(`name:"org-trigger-activities"`))),
	fx.Provide(orgsworker.NewWorkflows),
	fx.Provide(worker.AsWorker(orgsworker.New)),
)

OrgsWorkerModule provides the orgs namespace worker.

View Source
var PublicAPIModule = fx.Module("public-api",
	fx.Provide(api.NewEndpointAudit),
	fx.Provide(api.AsAPI(api.NewPublicAPI)),
	fx.Invoke(db.DBGroupParam(func([]*gorm.DB) {})),
	fx.Invoke(api.APIGroupParam(func([]*api.API) {})),
)

PublicAPIModule provides the public-facing API server.

View Source
var PublicServicesModule = fx.Module("public-services", sharedServices)

PublicServicesModule provides services for the public API (excludes authservice).

View Source
var RunnerAPIModule = fx.Module("runner-api",
	fx.Provide(api.NewEndpointAudit),
	fx.Provide(api.AsAPI(api.NewRunnerAPI)),
	fx.Invoke(db.DBGroupParam(func([]*gorm.DB) {})),
	fx.Invoke(api.APIGroupParam(func([]*api.API) {})),
)

RunnerAPIModule provides the runner API server.

View Source
var RunnerHealthcheckCronWorkerModule = fx.Module("worker-runner-healthcheck-crons",
	fx.Provide(worker.AsWorker(runnersworker.NewHealthcheckCronWorker)),
)

RunnerHealthcheckCronWorkerModule provides the runner healthcheck crons worker.

View Source
var RunnerServicesModule = fx.Module("runner-services", sharedServices)

RunnerServicesModule provides services for the runner API (excludes authservice).

View Source
var RunnerWorkerProvidersModule = fx.Module("worker-runners-providers",
	fx.Provide(runnersactivities.New),
	fx.Provide(runnersworker.NewWorkflows),
)

RunnerWorkerProvidersModule provides the runner workflow/activity constructors shared by the runners worker and the runner healthcheck crons worker.

View Source
var RunnersWorkerModule = fx.Module("worker-runners",
	fx.Provide(worker.AsWorker(runnersworker.New)),
)

RunnersWorkerModule provides the runners namespace worker (api task queue).

View Source
var ServicesModule = AllServicesModule

ServicesModule is deprecated, use API-specific modules instead. Kept for backwards compatibility.

SharedWorkflowsModule provides shared workflow activities and workflows used across multiple worker namespaces.

View Source
var SlackAPIModule = fx.Module("slack-api",
	fx.Provide(api.NewEndpointAudit),
	fx.Provide(api.AsAPI(api.NewSlackAPI)),
	fx.Invoke(db.DBGroupParam(func([]*gorm.DB) {})),
	fx.Invoke(api.APIGroupParam(func([]*api.API) {})),
)

SlackAPIModule provides the dedicated Slack-facing API server (OAuth callback, slash commands, Events API webhooks).

View Source
var SlackLibsModule = fx.Module("slack-libs",
	fx.Provide(func() *slackclient.Client {
		return slackclient.New()
	}),
	fx.Provide(func(cfg *internal.Config) (*statejwt.Encoder, error) {
		return statejwt.New(cfg.SlackStateJWTSecret)
	}),
	fx.Provide(autolink.New),
)

SlackLibsModule provides the shared Slack helper libraries (Web API client and OAuth state JWT encoder) used by the slack service package as well as the Slack-listener handlers in Phase 4.

The state-JWT encoder requires the SlackStateJWTSecret config value; in dev environments where the secret is unset, statejwt.New() returns an error and the surface that depends on it (install URL endpoint) will fail to start. That's intentional — install flows must not silently issue unsigned state values.

View Source
var SlackServicesModule = fx.Module("slack-services", sharedServices)

SlackServicesModule provides services for the dedicated Slack API.

View Source
var VCSWorkerModule = fx.Module("worker-vcs",
	fx.Provide(func(h *vcshelpers.Helpers) vcsactivities.GithubClient { return h }),
	fx.Provide(vcsactivities.New),
	fx.Provide(worker.AsWorker(vcsworker.New)),
)

VCSWorkerModule provides the vcs namespace worker.

WorkerInterceptorsModule provides interceptors for temporal workers.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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