Documentation
¶
Index ¶
- Constants
- func AddPlatformUsageMetricsSchedule(ctx context.Context, temporalClient client.Client) error
- func AddRefreshBillingUsageSchedule(ctx context.Context, temporalClient client.Client) error
- func CollectPlatformUsageMetricsWorkflow(ctx workflow.Context) error
- func CustomDomainRegistrationWorkflow(ctx workflow.Context, params CustomDomainRegistrationParams) error
- func ExecuteOpenrouterKeyRefreshWorkflow(ctx context.Context, temporalClient client.Client, ...) (client.WorkflowRun, error)
- func ExecuteProcessDeploymentWorkflow(ctx context.Context, temporalClient client.Client, ...) (client.WorkflowRun, error)
- func ExecuteProcessSlackEventWorkflow(ctx context.Context, temporalClient client.Client, ...) (client.WorkflowRun, error)
- func NewTemporalWorker(client client.Client, logger *slog.Logger, tracerProvider trace.TracerProvider, ...) worker.Worker
- func OpenrouterKeyRefreshWorkflow(ctx workflow.Context, params OpenRouterKeyRefreshParams) error
- func RefreshBillingUsageWorkflow(ctx workflow.Context) error
- type Activities
- func (a *Activities) CollectPlatformUsageMetrics(ctx context.Context) ([]activities.PlatformUsageMetrics, error)
- func (a *Activities) CustomDomainIngress(ctx context.Context, input activities.CustomDomainIngressArgs) error
- func (a *Activities) DeployFunctionRunners(ctx context.Context, req activities.DeployFunctionRunnersRequest) error
- func (a *Activities) FirePlatformUsageMetrics(ctx context.Context, metrics []activities.PlatformUsageMetrics) error
- func (a *Activities) FreeTierReportingUsageMetrics(ctx context.Context, orgIDs []string) error
- func (a *Activities) GetAllOrganizations(ctx context.Context) ([]string, error)
- func (a *Activities) GetSlackProjectContext(ctx context.Context, event slacktypes.SlackEvent) (*activities.SlackProjectContextResponse, error)
- func (a *Activities) PostSlackMessage(ctx context.Context, input activities.PostSlackMessageInput) error
- func (a *Activities) ProcessDeployment(ctx context.Context, projectID uuid.UUID, deploymentID uuid.UUID) error
- func (a *Activities) ProvisionFunctionsAccess(ctx context.Context, projectID uuid.UUID, deploymentID uuid.UUID) error
- func (a *Activities) RefreshBillingUsage(ctx context.Context, orgIDs []string) error
- func (a *Activities) RefreshOpenRouterKey(ctx context.Context, input activities.RefreshOpenRouterKeyArgs) error
- func (a *Activities) SlackChatCompletion(ctx context.Context, input activities.SlackChatCompletionInput) (string, error)
- func (a *Activities) TransitionDeployment(ctx context.Context, projectID uuid.UUID, deploymentID uuid.UUID, ...) (*activities.TransitionDeploymentResult, error)
- func (a *Activities) ValidateDeployment(ctx context.Context, projectID uuid.UUID, deploymentID uuid.UUID) error
- func (a *Activities) VerifyCustomDomain(ctx context.Context, input activities.VerifyCustomDomainArgs) error
- type CustomDomainRegistrationClient
- func (c *CustomDomainRegistrationClient) ExecuteCustomDomainRegistration(ctx context.Context, orgID string, domain string) (client.WorkflowRun, error)
- func (c *CustomDomainRegistrationClient) GetID(orgID string, domain string) string
- func (c *CustomDomainRegistrationClient) GetWorkflowInfo(ctx context.Context, orgID string, domain string) (*workflowservice.DescribeWorkflowExecutionResponse, error)
- type CustomDomainRegistrationParams
- type OpenRouterKeyRefreshParams
- type OpenRouterKeyRefresher
- type PlatformUsageMetricsClient
- type ProcessDeploymentWorkflowParams
- type ProcessDeploymentWorkflowResult
- type ProcessSlackEventResult
- type ProcessSlackWorkflowParams
- type RefreshBillingUsageClient
- type TaskQueue
- type WorkerOptions
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 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
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 (*Activities) ProvisionFunctionsAccess ¶
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 (*Activities) VerifyCustomDomain ¶
func (a *Activities) VerifyCustomDomain(ctx context.Context, input activities.VerifyCustomDomainArgs) error
type CustomDomainRegistrationClient ¶
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 ¶
func (c *CustomDomainRegistrationClient) GetWorkflowInfo(ctx context.Context, orgID string, domain string) (*workflowservice.DescribeWorkflowExecutionResponse, error)
type OpenRouterKeyRefreshParams ¶
type OpenRouterKeyRefreshParams struct {
OrgID string
}
type OpenRouterKeyRefresher ¶
func (*OpenRouterKeyRefresher) ScheduleOpenRouterKeyRefresh ¶
func (w *OpenRouterKeyRefresher) ScheduleOpenRouterKeyRefresh(ctx context.Context, orgID string) error
type PlatformUsageMetricsClient ¶
func (*PlatformUsageMetricsClient) StartCollectPlatformUsageMetrics ¶
func (c *PlatformUsageMetricsClient) StartCollectPlatformUsageMetrics(ctx context.Context) (client.WorkflowRun, error)
type ProcessDeploymentWorkflowResult ¶
type ProcessDeploymentWorkflowResult struct {
ProjectID uuid.UUID
DeploymentID uuid.UUID
Status string
}
func ProcessDeploymentWorkflow ¶
func ProcessDeploymentWorkflow(ctx workflow.Context, params ProcessDeploymentWorkflowParams) (*ProcessDeploymentWorkflowResult, error)
type ProcessSlackEventResult ¶
type ProcessSlackEventResult struct {
Status string
}
func SlackEventWorkflow ¶
func SlackEventWorkflow(ctx workflow.Context, params ProcessSlackWorkflowParams) (*ProcessSlackEventResult, error)
type ProcessSlackWorkflowParams ¶
type ProcessSlackWorkflowParams struct {
Event types.SlackEvent
}
type RefreshBillingUsageClient ¶
func (*RefreshBillingUsageClient) StartRefreshBillingUsage ¶
func (c *RefreshBillingUsageClient) StartRefreshBillingUsage(ctx context.Context) (client.WorkflowRun, error)
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 ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.