background

package
v0.0.0-...-4ae6852 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2025 License: AGPL-3.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const OpenRouterKeyRefreshWindow = 30

TODO: This will be 30 just setting to a lower value initially to test

Variables

This section is empty.

Functions

func AddPlatformUsageMetricsSchedule

func AddPlatformUsageMetricsSchedule(ctx context.Context, temporalClient client.Client) error

func AddRefreshBillingUsageSchedule

func AddRefreshBillingUsageSchedule(ctx context.Context, temporalClient client.Client) error

func CollectPlatformUsageMetricsWorkflow

func CollectPlatformUsageMetricsWorkflow(ctx workflow.Context) error

func CustomDomainRegistrationWorkflow

func CustomDomainRegistrationWorkflow(ctx workflow.Context, params CustomDomainRegistrationParams) error

func ExecuteOpenrouterKeyRefreshWorkflow

func ExecuteOpenrouterKeyRefreshWorkflow(ctx context.Context, temporalClient client.Client, params OpenRouterKeyRefreshParams) (client.WorkflowRun, error)

Called by your service to start (or restart) the workflow

func ExecuteProcessDeploymentWorkflow

func ExecuteProcessDeploymentWorkflow(ctx context.Context, temporalClient client.Client, params ProcessDeploymentWorkflowParams) (client.WorkflowRun, error)

func ExecuteProcessSlackEventWorkflow

func ExecuteProcessSlackEventWorkflow(ctx context.Context, temporalClient client.Client, params ProcessSlackWorkflowParams) (client.WorkflowRun, error)

func NewTemporalWorker

func NewTemporalWorker(
	client client.Client,
	logger *slog.Logger,
	tracerProvider trace.TracerProvider,
	meterProvider metric.MeterProvider,
	options ...*WorkerOptions,
) worker.Worker

func OpenrouterKeyRefreshWorkflow

func OpenrouterKeyRefreshWorkflow(ctx workflow.Context, params OpenRouterKeyRefreshParams) error

func RefreshBillingUsageWorkflow

func RefreshBillingUsageWorkflow(ctx workflow.Context) error

Types

type Activities

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

func NewActivities

func NewActivities(
	logger *slog.Logger,
	tracerProvider trace.TracerProvider,
	meterProvider metric.MeterProvider,
	db *pgxpool.Pool,
	encryption *encryption.Client,
	features feature.Provider,
	assetStorage assets.BlobStore,
	slackClient *slack_client.SlackClient,
	chatClient *chat.ChatClient,
	openrouter openrouter.Provisioner,
	k8sClient *k8s.KubernetesClients,
	expectedTargetCNAME string,
	billingTracker billing.Tracker,
	billingRepo billing.Repository,
	posthogClient *posthog.Posthog,
	functionsDeployer functions.Deployer,
	functionsVersion functions.RunnerVersion,
) *Activities

func (*Activities) CollectPlatformUsageMetrics

func (a *Activities) CollectPlatformUsageMetrics(ctx context.Context) ([]activities.PlatformUsageMetrics, error)

func (*Activities) CustomDomainIngress

func (a *Activities) CustomDomainIngress(ctx context.Context, input activities.CustomDomainIngressArgs) error

func (*Activities) DeployFunctionRunners

func (a *Activities) DeployFunctionRunners(ctx context.Context, req activities.DeployFunctionRunnersRequest) error

func (*Activities) FirePlatformUsageMetrics

func (a *Activities) FirePlatformUsageMetrics(ctx context.Context, metrics []activities.PlatformUsageMetrics) error

func (*Activities) FreeTierReportingUsageMetrics

func (a *Activities) FreeTierReportingUsageMetrics(ctx context.Context, orgIDs []string) error

func (*Activities) GetAllOrganizations

func (a *Activities) GetAllOrganizations(ctx context.Context) ([]string, error)

func (*Activities) GetSlackProjectContext

func (a *Activities) GetSlackProjectContext(ctx context.Context, event slacktypes.SlackEvent) (*activities.SlackProjectContextResponse, error)

func (*Activities) PostSlackMessage

func (a *Activities) PostSlackMessage(ctx context.Context, input activities.PostSlackMessageInput) error

func (*Activities) ProcessDeployment

func (a *Activities) ProcessDeployment(ctx context.Context, projectID uuid.UUID, deploymentID uuid.UUID) error

func (*Activities) ProvisionFunctionsAccess

func (a *Activities) ProvisionFunctionsAccess(ctx context.Context, projectID uuid.UUID, deploymentID uuid.UUID) error

func (*Activities) RefreshBillingUsage

func (a *Activities) RefreshBillingUsage(ctx context.Context, orgIDs []string) error

func (*Activities) RefreshOpenRouterKey

func (a *Activities) RefreshOpenRouterKey(ctx context.Context, input activities.RefreshOpenRouterKeyArgs) error

func (*Activities) SlackChatCompletion

func (a *Activities) SlackChatCompletion(ctx context.Context, input activities.SlackChatCompletionInput) (string, error)

func (*Activities) TransitionDeployment

func (a *Activities) TransitionDeployment(ctx context.Context, projectID uuid.UUID, deploymentID uuid.UUID, status string) (*activities.TransitionDeploymentResult, error)

func (*Activities) ValidateDeployment

func (a *Activities) ValidateDeployment(ctx context.Context, projectID uuid.UUID, deploymentID uuid.UUID) error

func (*Activities) VerifyCustomDomain

func (a *Activities) VerifyCustomDomain(ctx context.Context, input activities.VerifyCustomDomainArgs) error

type CustomDomainRegistrationClient

type CustomDomainRegistrationClient struct {
	Temporal client.Client
}

func (*CustomDomainRegistrationClient) ExecuteCustomDomainRegistration

func (c *CustomDomainRegistrationClient) ExecuteCustomDomainRegistration(ctx context.Context, orgID string, domain string) (client.WorkflowRun, error)

func (*CustomDomainRegistrationClient) GetID

func (c *CustomDomainRegistrationClient) GetID(orgID string, domain string) string

func (*CustomDomainRegistrationClient) GetWorkflowInfo

type CustomDomainRegistrationParams

type CustomDomainRegistrationParams struct {
	OrgID  string
	Domain string
}

type OpenRouterKeyRefreshParams

type OpenRouterKeyRefreshParams struct {
	OrgID string
}

type OpenRouterKeyRefresher

type OpenRouterKeyRefresher struct {
	Temporal client.Client
}

func (*OpenRouterKeyRefresher) ScheduleOpenRouterKeyRefresh

func (w *OpenRouterKeyRefresher) ScheduleOpenRouterKeyRefresh(ctx context.Context, orgID string) error

type PlatformUsageMetricsClient

type PlatformUsageMetricsClient struct {
	Temporal client.Client
}

func (*PlatformUsageMetricsClient) StartCollectPlatformUsageMetrics

func (c *PlatformUsageMetricsClient) StartCollectPlatformUsageMetrics(ctx context.Context) (client.WorkflowRun, error)

type ProcessDeploymentWorkflowParams

type ProcessDeploymentWorkflowParams struct {
	ProjectID      uuid.UUID
	DeploymentID   uuid.UUID
	IdempotencyKey string
}

type ProcessDeploymentWorkflowResult

type ProcessDeploymentWorkflowResult struct {
	ProjectID    uuid.UUID
	DeploymentID uuid.UUID
	Status       string
}

type ProcessSlackEventResult

type ProcessSlackEventResult struct {
	Status string
}

type ProcessSlackWorkflowParams

type ProcessSlackWorkflowParams struct {
	Event types.SlackEvent
}

type RefreshBillingUsageClient

type RefreshBillingUsageClient struct {
	Temporal client.Client
}

func (*RefreshBillingUsageClient) StartRefreshBillingUsage

func (c *RefreshBillingUsageClient) StartRefreshBillingUsage(ctx context.Context) (client.WorkflowRun, error)

type TaskQueue

type TaskQueue string
const (
	TaskQueueMain TaskQueue = "main"
)

type WorkerOptions

type WorkerOptions struct {
	DB                  *pgxpool.Pool
	EncryptionClient    *encryption.Client
	FeatureProvider     feature.Provider
	AssetStorage        assets.BlobStore
	SlackClient         *slack_client.SlackClient
	ChatClient          *chat.ChatClient
	OpenRouter          openrouter.Provisioner
	K8sClient           *k8s.KubernetesClients
	ExpectedTargetCNAME string
	BillingTracker      billing.Tracker
	BillingRepository   billing.Repository
	RedisClient         *redis.Client
	PosthogClient       *posthog.Posthog
	FunctionsDeployer   functions.Deployer
	FunctionsVersion    functions.RunnerVersion
}

func ForDeploymentProcessing

func ForDeploymentProcessing(
	db *pgxpool.Pool,
	f feature.Provider,
	assetStorage assets.BlobStore,
	enc *encryption.Client,
	deployer functions.Deployer,
) *WorkerOptions

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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