Documentation ¶
Index ¶
- type AcquireAsyncCallRow
- type Artefact
- type AssociateArtefactWithDeploymentParams
- type AsyncCall
- type AsyncCallState
- type Controller
- type ControllerState
- type CreateAsyncCallParams
- type CreateCronJobParams
- type CreateIngressRouteParams
- type CronJob
- type DBTX
- type Deployment
- type DeploymentArtefact
- type EncryptionKey
- type EventType
- type FailAsyncCallWithRetryParams
- type FsmInstance
- type FsmNextEvent
- type FsmStatus
- type GetActiveDeploymentSchemasRow
- type GetActiveDeploymentsRow
- type GetActiveIngressRoutesRow
- type GetActiveRunnersRow
- type GetArtefactDigestsRow
- type GetCronJobByKeyRow
- type GetDeploymentArtefactsRow
- type GetDeploymentRow
- type GetDeploymentsWithArtefactsRow
- type GetDeploymentsWithMinReplicasRow
- type GetExistingDeploymentForModuleRow
- type GetIngressRoutesRow
- type GetNextEventForSubscriptionRow
- type GetOnlyEncryptionKeyRow
- type GetProcessListRow
- type GetRandomSubscriberRow
- type GetRouteForRunnerRow
- type GetRoutingTableRow
- type GetRunnerRow
- type GetRunnersForDeploymentRow
- type GetSubscriptionsNeedingUpdateRow
- type GetUnscheduledCronJobsRow
- type IngressRoute
- type InsertSubscriberParams
- type InsertTimelineCallEventParams
- type InsertTimelineDeploymentCreatedEventParams
- type InsertTimelineDeploymentUpdatedEventParams
- type InsertTimelineEventParams
- type InsertTimelineLogEventParams
- type Lease
- type Module
- type ModuleConfiguration
- type ModuleSecret
- type NullAsyncCallState
- type NullControllerState
- type NullEventType
- type NullFsmStatus
- type NullOrigin
- type NullRunnerState
- type NullTopicSubscriptionState
- type Origin
- type PublishEventForTopicParams
- type Querier
- type Queries
- func (q *Queries) AcquireAsyncCall(ctx context.Context, ttl sqltypes.Duration) (AcquireAsyncCallRow, error)
- func (q *Queries) AssociateArtefactWithDeployment(ctx context.Context, arg AssociateArtefactWithDeploymentParams) error
- func (q *Queries) AsyncCallQueueDepth(ctx context.Context) (int64, error)
- func (q *Queries) BeginConsumingTopicEvent(ctx context.Context, subscription model.SubscriptionKey, ...) error
- func (q *Queries) CompleteEventForSubscription(ctx context.Context, name string, module string) error
- func (q *Queries) CreateArtefact(ctx context.Context, digest []byte, content []byte) (int64, error)
- func (q *Queries) CreateAsyncCall(ctx context.Context, arg CreateAsyncCallParams) (int64, error)
- func (q *Queries) CreateCronJob(ctx context.Context, arg CreateCronJobParams) error
- func (q *Queries) CreateDeployment(ctx context.Context, moduleName string, schema []byte, key model.DeploymentKey) error
- func (q *Queries) CreateIngressRoute(ctx context.Context, arg CreateIngressRouteParams) error
- func (q *Queries) CreateOnlyEncryptionKey(ctx context.Context, key []byte) error
- func (q *Queries) CreateRequest(ctx context.Context, origin Origin, key model.RequestKey, sourceAddr string) error
- func (q *Queries) DeleteOldTimelineEvents(ctx context.Context, timeout sqltypes.Duration, type_ EventType) (int64, error)
- func (q *Queries) DeleteSubscribers(ctx context.Context, deployment model.DeploymentKey) ([]model.SubscriberKey, error)
- func (q *Queries) DeleteSubscriptions(ctx context.Context, deployment model.DeploymentKey) ([]model.SubscriptionKey, error)
- func (q *Queries) DeregisterRunner(ctx context.Context, key model.RunnerKey) (int64, error)
- func (q *Queries) FailAsyncCall(ctx context.Context, error string, iD int64) (bool, error)
- func (q *Queries) FailAsyncCallWithRetry(ctx context.Context, arg FailAsyncCallWithRetryParams) (bool, error)
- func (q *Queries) FailFSMInstance(ctx context.Context, fsm schema.RefKey, key string) (bool, error)
- func (q *Queries) FinishFSMTransition(ctx context.Context, fsm schema.RefKey, key string) (bool, error)
- func (q *Queries) GetActiveControllers(ctx context.Context) ([]Controller, error)
- func (q *Queries) GetActiveDeploymentSchemas(ctx context.Context) ([]GetActiveDeploymentSchemasRow, error)
- func (q *Queries) GetActiveDeployments(ctx context.Context) ([]GetActiveDeploymentsRow, error)
- func (q *Queries) GetActiveIngressRoutes(ctx context.Context) ([]GetActiveIngressRoutesRow, error)
- func (q *Queries) GetActiveRunners(ctx context.Context) ([]GetActiveRunnersRow, error)
- func (q *Queries) GetArtefactContentRange(ctx context.Context, start int32, count int32, iD int64) ([]byte, error)
- func (q *Queries) GetArtefactDigests(ctx context.Context, digests [][]byte) ([]GetArtefactDigestsRow, error)
- func (q *Queries) GetCronJobByKey(ctx context.Context, key model.CronJobKey) (GetCronJobByKeyRow, error)
- func (q *Queries) GetDeployment(ctx context.Context, key model.DeploymentKey) (GetDeploymentRow, error)
- func (q *Queries) GetDeploymentArtefacts(ctx context.Context, deploymentID int64) ([]GetDeploymentArtefactsRow, error)
- func (q *Queries) GetDeploymentsByID(ctx context.Context, ids []int64) ([]Deployment, error)
- func (q *Queries) GetDeploymentsWithArtefacts(ctx context.Context, digests [][]byte, schema []byte, count int64) ([]GetDeploymentsWithArtefactsRow, error)
- func (q *Queries) GetDeploymentsWithMinReplicas(ctx context.Context) ([]GetDeploymentsWithMinReplicasRow, error)
- func (q *Queries) GetExistingDeploymentForModule(ctx context.Context, name string) (GetExistingDeploymentForModuleRow, error)
- func (q *Queries) GetFSMInstance(ctx context.Context, fsm schema.RefKey, key string) (FsmInstance, error)
- func (q *Queries) GetIngressRoutes(ctx context.Context, method string) ([]GetIngressRoutesRow, error)
- func (q *Queries) GetModulesByID(ctx context.Context, ids []int64) ([]Module, error)
- func (q *Queries) GetNextEventForSubscription(ctx context.Context, consumptionDelay sqltypes.Duration, topic model.TopicKey, ...) (GetNextEventForSubscriptionRow, error)
- func (q *Queries) GetOnlyEncryptionKey(ctx context.Context) (GetOnlyEncryptionKeyRow, error)
- func (q *Queries) GetProcessList(ctx context.Context) ([]GetProcessListRow, error)
- func (q *Queries) GetRandomSubscriber(ctx context.Context, key model.SubscriptionKey) (GetRandomSubscriberRow, error)
- func (q *Queries) GetRouteForRunner(ctx context.Context, key model.RunnerKey) (GetRouteForRunnerRow, error)
- func (q *Queries) GetRoutingTable(ctx context.Context, modules []string) ([]GetRoutingTableRow, error)
- func (q *Queries) GetRunner(ctx context.Context, key model.RunnerKey) (GetRunnerRow, error)
- func (q *Queries) GetRunnerState(ctx context.Context, key model.RunnerKey) (RunnerState, error)
- func (q *Queries) GetRunnersForDeployment(ctx context.Context, key model.DeploymentKey) ([]GetRunnersForDeploymentRow, error)
- func (q *Queries) GetSchemaForDeployment(ctx context.Context, key model.DeploymentKey) (*schema.Module, error)
- func (q *Queries) GetSubscription(ctx context.Context, column1 string, column2 string) (TopicSubscription, error)
- func (q *Queries) GetSubscriptionsNeedingUpdate(ctx context.Context) ([]GetSubscriptionsNeedingUpdateRow, error)
- func (q *Queries) GetTopic(ctx context.Context, dollar_1 int64) (Topic, error)
- func (q *Queries) GetTopicEvent(ctx context.Context, dollar_1 int64) (TopicEvent, error)
- func (q *Queries) GetUnscheduledCronJobs(ctx context.Context, startTime time.Time) ([]GetUnscheduledCronJobsRow, error)
- func (q *Queries) GetZombieAsyncCalls(ctx context.Context, limit int32) ([]AsyncCall, error)
- func (q *Queries) InsertSubscriber(ctx context.Context, arg InsertSubscriberParams) error
- func (q *Queries) InsertTimelineCallEvent(ctx context.Context, arg InsertTimelineCallEventParams) error
- func (q *Queries) InsertTimelineDeploymentCreatedEvent(ctx context.Context, arg InsertTimelineDeploymentCreatedEventParams) error
- func (q *Queries) InsertTimelineDeploymentUpdatedEvent(ctx context.Context, arg InsertTimelineDeploymentUpdatedEventParams) error
- func (q *Queries) InsertTimelineEvent(ctx context.Context, arg InsertTimelineEventParams) error
- func (q *Queries) InsertTimelineLogEvent(ctx context.Context, arg InsertTimelineLogEventParams) error
- func (q *Queries) IsCronJobPending(ctx context.Context, key model.CronJobKey, startTime time.Time) (bool, error)
- func (q *Queries) KillStaleControllers(ctx context.Context, timeout sqltypes.Duration) (int64, error)
- func (q *Queries) KillStaleRunners(ctx context.Context, timeout sqltypes.Duration) (int64, error)
- func (q *Queries) LoadAsyncCall(ctx context.Context, id int64) (AsyncCall, error)
- func (q *Queries) PopNextFSMEvent(ctx context.Context, fsm schema.RefKey, instanceKey string) (FsmNextEvent, error)
- func (q *Queries) PublishEventForTopic(ctx context.Context, arg PublishEventForTopicParams) error
- func (q *Queries) SetDeploymentDesiredReplicas(ctx context.Context, key model.DeploymentKey, minReplicas int32) error
- func (q *Queries) SetNextFSMEvent(ctx context.Context, arg SetNextFSMEventParams) (int64, error)
- func (q *Queries) SetSubscriptionCursor(ctx context.Context, column1 model.SubscriptionKey, ...) error
- func (q *Queries) StartFSMTransition(ctx context.Context, arg StartFSMTransitionParams) (FsmInstance, error)
- func (q *Queries) SucceedAsyncCall(ctx context.Context, response encryption.OptionalEncryptedAsyncColumn, ...) (bool, error)
- func (q *Queries) SucceedFSMInstance(ctx context.Context, fsm schema.RefKey, key string) (bool, error)
- func (q *Queries) UpdateCronJobExecution(ctx context.Context, arg UpdateCronJobExecutionParams) error
- func (q *Queries) UpdateEncryptionVerification(ctx context.Context, verifyTimeline encryption.OptionalEncryptedTimelineColumn, ...) error
- func (q *Queries) UpsertController(ctx context.Context, key model.ControllerKey, endpoint string) (int64, error)
- func (q *Queries) UpsertModule(ctx context.Context, language string, name string) (int64, error)
- func (q *Queries) UpsertRunner(ctx context.Context, arg UpsertRunnerParams) (int64, error)
- func (q *Queries) UpsertSubscription(ctx context.Context, arg UpsertSubscriptionParams) (UpsertSubscriptionRow, error)
- func (q *Queries) UpsertTopic(ctx context.Context, arg UpsertTopicParams) error
- func (q *Queries) WithTx(tx *sql.Tx) *Queries
- type Request
- type Runner
- type RunnerState
- type SetNextFSMEventParams
- type StartFSMTransitionParams
- type Timeline
- type Topic
- type TopicEvent
- type TopicSubscriber
- type TopicSubscription
- type TopicSubscriptionState
- type UpdateCronJobExecutionParams
- type UpsertRunnerParams
- type UpsertSubscriptionParams
- type UpsertSubscriptionRow
- type UpsertTopicParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AcquireAsyncCallRow ¶
type AcquireAsyncCallRow struct { AsyncCallID int64 LeaseIdempotencyKey uuid.UUID LeaseKey leases.Key QueueDepth int64 Origin string Verb schema.RefKey CatchVerb optional.Option[schema.RefKey] Request encryption.EncryptedAsyncColumn ScheduledAt time.Time RemainingAttempts int32 Error optional.Option[string] Backoff sqltypes.Duration MaxBackoff sqltypes.Duration ParentRequestKey optional.Option[string] TraceContext pqtype.NullRawMessage Catching bool }
type AssociateArtefactWithDeploymentParams ¶
type AssociateArtefactWithDeploymentParams struct { Key model.DeploymentKey ArtefactID int64 Executable bool Path string }
type AsyncCall ¶
type AsyncCall struct { ID int64 CreatedAt time.Time LeaseID optional.Option[int64] Verb schema.RefKey State AsyncCallState Origin string ScheduledAt time.Time Request encryption.EncryptedAsyncColumn Response encryption.OptionalEncryptedAsyncColumn Error optional.Option[string] RemainingAttempts int32 Backoff sqltypes.Duration MaxBackoff sqltypes.Duration CatchVerb optional.Option[schema.RefKey] Catching bool ParentRequestKey optional.Option[string] TraceContext pqtype.NullRawMessage }
type AsyncCallState ¶
type AsyncCallState string
const ( AsyncCallStatePending AsyncCallState = "pending" AsyncCallStateExecuting AsyncCallState = "executing" AsyncCallStateSuccess AsyncCallState = "success" AsyncCallStateError AsyncCallState = "error" )
func (*AsyncCallState) Scan ¶
func (e *AsyncCallState) Scan(src interface{}) error
type Controller ¶
type Controller struct { ID int64 Key model.ControllerKey Created time.Time LastSeen time.Time State ControllerState Endpoint string }
type ControllerState ¶
type ControllerState string
const ( ControllerStateLive ControllerState = "live" ControllerStateDead ControllerState = "dead" )
func (*ControllerState) Scan ¶
func (e *ControllerState) Scan(src interface{}) error
type CreateAsyncCallParams ¶
type CreateAsyncCallParams struct { ScheduledAt time.Time Verb schema.RefKey Origin string Request encryption.EncryptedAsyncColumn RemainingAttempts int32 Backoff sqltypes.Duration MaxBackoff sqltypes.Duration CatchVerb optional.Option[schema.RefKey] ParentRequestKey optional.Option[string] TraceContext json.RawMessage }
type CreateCronJobParams ¶
type Deployment ¶
type DeploymentArtefact ¶
type EncryptionKey ¶
type EncryptionKey struct { ID int64 Key []byte CreatedAt time.Time VerifyTimeline encryption.OptionalEncryptedTimelineColumn VerifyAsync encryption.OptionalEncryptedAsyncColumn }
type FsmInstance ¶
type FsmNextEvent ¶
type GetActiveDeploymentSchemasRow ¶
type GetActiveDeploymentSchemasRow struct { Key model.DeploymentKey Schema *schema.Module }
type GetActiveDeploymentsRow ¶
type GetActiveDeploymentsRow struct { Deployment Deployment ModuleName string Language string Replicas int64 }
type GetActiveRunnersRow ¶
type GetActiveRunnersRow struct { RunnerKey model.RunnerKey Endpoint string State RunnerState Labels json.RawMessage LastSeen time.Time ModuleName optional.Option[string] DeploymentKey model.DeploymentKey }
type GetArtefactDigestsRow ¶
type GetCronJobByKeyRow ¶
type GetCronJobByKeyRow struct { CronJob CronJob Deployment Deployment }
type GetDeploymentRow ¶
type GetDeploymentRow struct { Deployment Deployment Language string ModuleName string MinReplicas int32 }
type GetDeploymentsWithMinReplicasRow ¶
type GetDeploymentsWithMinReplicasRow struct { Deployment Deployment ModuleName string Language string }
type GetIngressRoutesRow ¶
type GetOnlyEncryptionKeyRow ¶
type GetOnlyEncryptionKeyRow struct { Key []byte VerifyTimeline encryption.OptionalEncryptedTimelineColumn VerifyAsync encryption.OptionalEncryptedAsyncColumn }
type GetProcessListRow ¶
type GetProcessListRow struct { MinReplicas int32 DeploymentKey model.DeploymentKey DeploymentLabels json.RawMessage RunnerKey optional.Option[model.RunnerKey] Endpoint optional.Option[string] RunnerLabels pqtype.NullRawMessage }
type GetRandomSubscriberRow ¶
type GetRouteForRunnerRow ¶
type GetRoutingTableRow ¶
type GetRunnerRow ¶
type GetRunnerRow struct { RunnerKey model.RunnerKey Endpoint string State RunnerState Labels json.RawMessage LastSeen time.Time ModuleName optional.Option[string] DeploymentKey model.DeploymentKey }
type GetRunnersForDeploymentRow ¶
type GetRunnersForDeploymentRow struct { ID int64 Key model.RunnerKey Created time.Time LastSeen time.Time State RunnerState Endpoint string ModuleName optional.Option[string] DeploymentID int64 Labels json.RawMessage ID_2 int64 CreatedAt time.Time ModuleID int64 Key_2 model.DeploymentKey Schema *schema.Module Labels_2 json.RawMessage MinReplicas int32 }
type GetSubscriptionsNeedingUpdateRow ¶
type GetSubscriptionsNeedingUpdateRow struct { Key model.SubscriptionKey Cursor optional.Option[model.TopicEventKey] Topic model.TopicKey Name string }
type GetUnscheduledCronJobsRow ¶
type GetUnscheduledCronJobsRow struct { CronJob CronJob Deployment Deployment }
type IngressRoute ¶
type InsertSubscriberParams ¶
type InsertTimelineCallEventParams ¶
type InsertTimelineCallEventParams struct { DeploymentKey model.DeploymentKey RequestKey optional.Option[string] ParentRequestKey optional.Option[string] TimeStamp time.Time SourceModule optional.Option[string] SourceVerb optional.Option[string] DestModule string DestVerb string Payload encryption.EncryptedTimelineColumn }
type InsertTimelineDeploymentCreatedEventParams ¶
type InsertTimelineDeploymentCreatedEventParams struct { DeploymentKey model.DeploymentKey Language string ModuleName string Payload encryption.EncryptedTimelineColumn }
type InsertTimelineDeploymentUpdatedEventParams ¶
type InsertTimelineDeploymentUpdatedEventParams struct { DeploymentKey model.DeploymentKey Language string ModuleName string Payload encryption.EncryptedTimelineColumn }
type InsertTimelineEventParams ¶
type InsertTimelineEventParams struct { DeploymentID int64 RequestID optional.Option[int64] ParentRequestID optional.Option[string] Type EventType CustomKey1 optional.Option[string] CustomKey2 optional.Option[string] CustomKey3 optional.Option[string] CustomKey4 optional.Option[string] Payload encryption.EncryptedTimelineColumn }
type InsertTimelineLogEventParams ¶
type InsertTimelineLogEventParams struct { DeploymentKey model.DeploymentKey RequestKey optional.Option[string] TimeStamp time.Time Level int32 Payload encryption.EncryptedTimelineColumn }
type ModuleConfiguration ¶
type ModuleSecret ¶
type NullAsyncCallState ¶
type NullAsyncCallState struct { AsyncCallState AsyncCallState Valid bool // Valid is true if AsyncCallState is not NULL }
func (*NullAsyncCallState) Scan ¶
func (ns *NullAsyncCallState) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullControllerState ¶
type NullControllerState struct { ControllerState ControllerState Valid bool // Valid is true if ControllerState is not NULL }
func (*NullControllerState) Scan ¶
func (ns *NullControllerState) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullEventType ¶
type NullEventType struct { EventType EventType Valid bool // Valid is true if EventType is not NULL }
func (*NullEventType) Scan ¶
func (ns *NullEventType) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullFsmStatus ¶
type NullFsmStatus struct { FsmStatus FsmStatus Valid bool // Valid is true if FsmStatus is not NULL }
func (*NullFsmStatus) Scan ¶
func (ns *NullFsmStatus) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullOrigin ¶
func (*NullOrigin) Scan ¶
func (ns *NullOrigin) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullRunnerState ¶
type NullRunnerState struct { RunnerState RunnerState Valid bool // Valid is true if RunnerState is not NULL }
func (*NullRunnerState) Scan ¶
func (ns *NullRunnerState) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullTopicSubscriptionState ¶
type NullTopicSubscriptionState struct { TopicSubscriptionState TopicSubscriptionState Valid bool // Valid is true if TopicSubscriptionState is not NULL }
func (*NullTopicSubscriptionState) Scan ¶
func (ns *NullTopicSubscriptionState) Scan(value interface{}) error
Scan implements the Scanner interface.
type PublishEventForTopicParams ¶
type PublishEventForTopicParams struct { Key model.TopicEventKey Module string Topic string Caller string Payload []byte RequestKey string TraceContext json.RawMessage }
type Querier ¶
type Querier interface { // Reserve a pending async call for execution, returning the associated lease // reservation key and accompanying metadata. AcquireAsyncCall(ctx context.Context, ttl sqltypes.Duration) (AcquireAsyncCallRow, error) AssociateArtefactWithDeployment(ctx context.Context, arg AssociateArtefactWithDeploymentParams) error AsyncCallQueueDepth(ctx context.Context) (int64, error) BeginConsumingTopicEvent(ctx context.Context, subscription model.SubscriptionKey, event model.TopicEventKey) error CompleteEventForSubscription(ctx context.Context, name string, module string) error // Create a new artefact and return the artefact ID. CreateArtefact(ctx context.Context, digest []byte, content []byte) (int64, error) CreateAsyncCall(ctx context.Context, arg CreateAsyncCallParams) (int64, error) CreateCronJob(ctx context.Context, arg CreateCronJobParams) error CreateDeployment(ctx context.Context, moduleName string, schema []byte, key model.DeploymentKey) error CreateIngressRoute(ctx context.Context, arg CreateIngressRouteParams) error CreateOnlyEncryptionKey(ctx context.Context, key []byte) error CreateRequest(ctx context.Context, origin Origin, key model.RequestKey, sourceAddr string) error DeleteOldTimelineEvents(ctx context.Context, timeout sqltypes.Duration, type_ EventType) (int64, error) DeleteSubscribers(ctx context.Context, deployment model.DeploymentKey) ([]model.SubscriberKey, error) DeleteSubscriptions(ctx context.Context, deployment model.DeploymentKey) ([]model.SubscriptionKey, error) DeregisterRunner(ctx context.Context, key model.RunnerKey) (int64, error) FailAsyncCall(ctx context.Context, error string, iD int64) (bool, error) FailAsyncCallWithRetry(ctx context.Context, arg FailAsyncCallWithRetryParams) (bool, error) FailFSMInstance(ctx context.Context, fsm schema.RefKey, key string) (bool, error) // Mark an FSM transition as completed, updating the current state and clearing the async call ID. FinishFSMTransition(ctx context.Context, fsm schema.RefKey, key string) (bool, error) GetActiveControllers(ctx context.Context) ([]Controller, error) GetActiveDeploymentSchemas(ctx context.Context) ([]GetActiveDeploymentSchemasRow, error) GetActiveDeployments(ctx context.Context) ([]GetActiveDeploymentsRow, error) GetActiveIngressRoutes(ctx context.Context) ([]GetActiveIngressRoutesRow, error) GetActiveRunners(ctx context.Context) ([]GetActiveRunnersRow, error) GetArtefactContentRange(ctx context.Context, start int32, count int32, iD int64) ([]byte, error) // Return the digests that exist in the database. GetArtefactDigests(ctx context.Context, digests [][]byte) ([]GetArtefactDigestsRow, error) GetCronJobByKey(ctx context.Context, key model.CronJobKey) (GetCronJobByKeyRow, error) GetDeployment(ctx context.Context, key model.DeploymentKey) (GetDeploymentRow, error) // Get all artefacts matching the given digests. GetDeploymentArtefacts(ctx context.Context, deploymentID int64) ([]GetDeploymentArtefactsRow, error) GetDeploymentsByID(ctx context.Context, ids []int64) ([]Deployment, error) // Get all deployments that have artefacts matching the given digests. GetDeploymentsWithArtefacts(ctx context.Context, digests [][]byte, schema []byte, count int64) ([]GetDeploymentsWithArtefactsRow, error) GetDeploymentsWithMinReplicas(ctx context.Context) ([]GetDeploymentsWithMinReplicasRow, error) GetExistingDeploymentForModule(ctx context.Context, name string) (GetExistingDeploymentForModuleRow, error) GetFSMInstance(ctx context.Context, fsm schema.RefKey, key string) (FsmInstance, error) // Get the runner endpoints corresponding to the given ingress route. GetIngressRoutes(ctx context.Context, method string) ([]GetIngressRoutesRow, error) GetModulesByID(ctx context.Context, ids []int64) ([]Module, error) GetNextEventForSubscription(ctx context.Context, consumptionDelay sqltypes.Duration, topic model.TopicKey, cursor optional.Option[model.TopicEventKey]) (GetNextEventForSubscriptionRow, error) GetOnlyEncryptionKey(ctx context.Context) (GetOnlyEncryptionKeyRow, error) GetProcessList(ctx context.Context) ([]GetProcessListRow, error) GetRandomSubscriber(ctx context.Context, key model.SubscriptionKey) (GetRandomSubscriberRow, error) // Retrieve routing information for a runner. GetRouteForRunner(ctx context.Context, key model.RunnerKey) (GetRouteForRunnerRow, error) GetRoutingTable(ctx context.Context, modules []string) ([]GetRoutingTableRow, error) GetRunner(ctx context.Context, key model.RunnerKey) (GetRunnerRow, error) GetRunnerState(ctx context.Context, key model.RunnerKey) (RunnerState, error) GetRunnersForDeployment(ctx context.Context, key model.DeploymentKey) ([]GetRunnersForDeploymentRow, error) GetSchemaForDeployment(ctx context.Context, key model.DeploymentKey) (*schema.Module, error) GetSubscription(ctx context.Context, column1 string, column2 string) (TopicSubscription, error) // Results may not be ready to be scheduled yet due to event consumption delay // Sorting ensures that brand new events (that may not be ready for consumption) // don't prevent older events from being consumed GetSubscriptionsNeedingUpdate(ctx context.Context) ([]GetSubscriptionsNeedingUpdateRow, error) GetTopic(ctx context.Context, dollar_1 int64) (Topic, error) GetTopicEvent(ctx context.Context, dollar_1 int64) (TopicEvent, error) GetUnscheduledCronJobs(ctx context.Context, startTime time.Time) ([]GetUnscheduledCronJobsRow, error) GetZombieAsyncCalls(ctx context.Context, limit int32) ([]AsyncCall, error) InsertSubscriber(ctx context.Context, arg InsertSubscriberParams) error InsertTimelineCallEvent(ctx context.Context, arg InsertTimelineCallEventParams) error InsertTimelineDeploymentCreatedEvent(ctx context.Context, arg InsertTimelineDeploymentCreatedEventParams) error InsertTimelineDeploymentUpdatedEvent(ctx context.Context, arg InsertTimelineDeploymentUpdatedEventParams) error InsertTimelineEvent(ctx context.Context, arg InsertTimelineEventParams) error InsertTimelineLogEvent(ctx context.Context, arg InsertTimelineLogEventParams) error IsCronJobPending(ctx context.Context, key model.CronJobKey, startTime time.Time) (bool, error) // Mark any controller entries that haven't been updated recently as dead. KillStaleControllers(ctx context.Context, timeout sqltypes.Duration) (int64, error) KillStaleRunners(ctx context.Context, timeout sqltypes.Duration) (int64, error) LoadAsyncCall(ctx context.Context, id int64) (AsyncCall, error) PopNextFSMEvent(ctx context.Context, fsm schema.RefKey, instanceKey string) (FsmNextEvent, error) PublishEventForTopic(ctx context.Context, arg PublishEventForTopicParams) error SetDeploymentDesiredReplicas(ctx context.Context, key model.DeploymentKey, minReplicas int32) error SetNextFSMEvent(ctx context.Context, arg SetNextFSMEventParams) (int64, error) SetSubscriptionCursor(ctx context.Context, column1 model.SubscriptionKey, column2 model.TopicEventKey) error // Start a new FSM transition, populating the destination state and async call ID. // // "key" is the unique identifier for the FSM execution. StartFSMTransition(ctx context.Context, arg StartFSMTransitionParams) (FsmInstance, error) SucceedAsyncCall(ctx context.Context, response encryption.OptionalEncryptedAsyncColumn, iD int64) (bool, error) SucceedFSMInstance(ctx context.Context, fsm schema.RefKey, key string) (bool, error) UpdateCronJobExecution(ctx context.Context, arg UpdateCronJobExecutionParams) error UpdateEncryptionVerification(ctx context.Context, verifyTimeline encryption.OptionalEncryptedTimelineColumn, verifyAsync encryption.OptionalEncryptedAsyncColumn) error UpsertController(ctx context.Context, key model.ControllerKey, endpoint string) (int64, error) UpsertModule(ctx context.Context, language string, name string) (int64, error) // Upsert a runner and return the deployment ID that it is assigned to, if any. UpsertRunner(ctx context.Context, arg UpsertRunnerParams) (int64, error) UpsertSubscription(ctx context.Context, arg UpsertSubscriptionParams) (UpsertSubscriptionRow, error) UpsertTopic(ctx context.Context, arg UpsertTopicParams) error }
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) AcquireAsyncCall ¶
func (q *Queries) AcquireAsyncCall(ctx context.Context, ttl sqltypes.Duration) (AcquireAsyncCallRow, error)
Reserve a pending async call for execution, returning the associated lease reservation key and accompanying metadata.
func (*Queries) AssociateArtefactWithDeployment ¶
func (q *Queries) AssociateArtefactWithDeployment(ctx context.Context, arg AssociateArtefactWithDeploymentParams) error
func (*Queries) AsyncCallQueueDepth ¶
func (*Queries) BeginConsumingTopicEvent ¶
func (q *Queries) BeginConsumingTopicEvent(ctx context.Context, subscription model.SubscriptionKey, event model.TopicEventKey) error
func (*Queries) CompleteEventForSubscription ¶
func (*Queries) CreateArtefact ¶
Create a new artefact and return the artefact ID.
func (*Queries) CreateAsyncCall ¶
func (*Queries) CreateCronJob ¶
func (q *Queries) CreateCronJob(ctx context.Context, arg CreateCronJobParams) error
func (*Queries) CreateDeployment ¶
func (*Queries) CreateIngressRoute ¶
func (q *Queries) CreateIngressRoute(ctx context.Context, arg CreateIngressRouteParams) error
func (*Queries) CreateOnlyEncryptionKey ¶
func (*Queries) CreateRequest ¶
func (*Queries) DeleteOldTimelineEvents ¶
func (*Queries) DeleteSubscribers ¶
func (q *Queries) DeleteSubscribers(ctx context.Context, deployment model.DeploymentKey) ([]model.SubscriberKey, error)
func (*Queries) DeleteSubscriptions ¶
func (q *Queries) DeleteSubscriptions(ctx context.Context, deployment model.DeploymentKey) ([]model.SubscriptionKey, error)
func (*Queries) DeregisterRunner ¶
func (*Queries) FailAsyncCall ¶
func (*Queries) FailAsyncCallWithRetry ¶
func (*Queries) FailFSMInstance ¶
func (*Queries) FinishFSMTransition ¶
func (q *Queries) FinishFSMTransition(ctx context.Context, fsm schema.RefKey, key string) (bool, error)
Mark an FSM transition as completed, updating the current state and clearing the async call ID.
func (*Queries) GetActiveControllers ¶
func (q *Queries) GetActiveControllers(ctx context.Context) ([]Controller, error)
func (*Queries) GetActiveDeploymentSchemas ¶
func (q *Queries) GetActiveDeploymentSchemas(ctx context.Context) ([]GetActiveDeploymentSchemasRow, error)
func (*Queries) GetActiveDeployments ¶
func (q *Queries) GetActiveDeployments(ctx context.Context) ([]GetActiveDeploymentsRow, error)
func (*Queries) GetActiveIngressRoutes ¶
func (q *Queries) GetActiveIngressRoutes(ctx context.Context) ([]GetActiveIngressRoutesRow, error)
func (*Queries) GetActiveRunners ¶
func (q *Queries) GetActiveRunners(ctx context.Context) ([]GetActiveRunnersRow, error)
func (*Queries) GetArtefactContentRange ¶
func (*Queries) GetArtefactDigests ¶
func (q *Queries) GetArtefactDigests(ctx context.Context, digests [][]byte) ([]GetArtefactDigestsRow, error)
Return the digests that exist in the database.
func (*Queries) GetCronJobByKey ¶
func (q *Queries) GetCronJobByKey(ctx context.Context, key model.CronJobKey) (GetCronJobByKeyRow, error)
func (*Queries) GetDeployment ¶
func (q *Queries) GetDeployment(ctx context.Context, key model.DeploymentKey) (GetDeploymentRow, error)
func (*Queries) GetDeploymentArtefacts ¶
func (q *Queries) GetDeploymentArtefacts(ctx context.Context, deploymentID int64) ([]GetDeploymentArtefactsRow, error)
Get all artefacts matching the given digests.
func (*Queries) GetDeploymentsByID ¶
func (*Queries) GetDeploymentsWithArtefacts ¶
func (q *Queries) GetDeploymentsWithArtefacts(ctx context.Context, digests [][]byte, schema []byte, count int64) ([]GetDeploymentsWithArtefactsRow, error)
Get all deployments that have artefacts matching the given digests.
func (*Queries) GetDeploymentsWithMinReplicas ¶
func (q *Queries) GetDeploymentsWithMinReplicas(ctx context.Context) ([]GetDeploymentsWithMinReplicasRow, error)
func (*Queries) GetExistingDeploymentForModule ¶
func (*Queries) GetFSMInstance ¶
func (*Queries) GetIngressRoutes ¶
func (q *Queries) GetIngressRoutes(ctx context.Context, method string) ([]GetIngressRoutesRow, error)
Get the runner endpoints corresponding to the given ingress route.
func (*Queries) GetModulesByID ¶
func (*Queries) GetNextEventForSubscription ¶
func (*Queries) GetOnlyEncryptionKey ¶
func (q *Queries) GetOnlyEncryptionKey(ctx context.Context) (GetOnlyEncryptionKeyRow, error)
func (*Queries) GetProcessList ¶
func (q *Queries) GetProcessList(ctx context.Context) ([]GetProcessListRow, error)
func (*Queries) GetRandomSubscriber ¶
func (q *Queries) GetRandomSubscriber(ctx context.Context, key model.SubscriptionKey) (GetRandomSubscriberRow, error)
func (*Queries) GetRouteForRunner ¶
func (q *Queries) GetRouteForRunner(ctx context.Context, key model.RunnerKey) (GetRouteForRunnerRow, error)
Retrieve routing information for a runner.
func (*Queries) GetRoutingTable ¶
func (*Queries) GetRunnerState ¶
func (*Queries) GetRunnersForDeployment ¶
func (q *Queries) GetRunnersForDeployment(ctx context.Context, key model.DeploymentKey) ([]GetRunnersForDeploymentRow, error)
func (*Queries) GetSchemaForDeployment ¶
func (*Queries) GetSubscription ¶
func (*Queries) GetSubscriptionsNeedingUpdate ¶
func (q *Queries) GetSubscriptionsNeedingUpdate(ctx context.Context) ([]GetSubscriptionsNeedingUpdateRow, error)
Results may not be ready to be scheduled yet due to event consumption delay Sorting ensures that brand new events (that may not be ready for consumption) don't prevent older events from being consumed
func (*Queries) GetTopicEvent ¶
func (*Queries) GetUnscheduledCronJobs ¶
func (*Queries) GetZombieAsyncCalls ¶
func (*Queries) InsertSubscriber ¶
func (q *Queries) InsertSubscriber(ctx context.Context, arg InsertSubscriberParams) error
func (*Queries) InsertTimelineCallEvent ¶
func (q *Queries) InsertTimelineCallEvent(ctx context.Context, arg InsertTimelineCallEventParams) error
func (*Queries) InsertTimelineDeploymentCreatedEvent ¶
func (q *Queries) InsertTimelineDeploymentCreatedEvent(ctx context.Context, arg InsertTimelineDeploymentCreatedEventParams) error
func (*Queries) InsertTimelineDeploymentUpdatedEvent ¶
func (q *Queries) InsertTimelineDeploymentUpdatedEvent(ctx context.Context, arg InsertTimelineDeploymentUpdatedEventParams) error
func (*Queries) InsertTimelineEvent ¶
func (q *Queries) InsertTimelineEvent(ctx context.Context, arg InsertTimelineEventParams) error
func (*Queries) InsertTimelineLogEvent ¶
func (q *Queries) InsertTimelineLogEvent(ctx context.Context, arg InsertTimelineLogEventParams) error
func (*Queries) IsCronJobPending ¶
func (*Queries) KillStaleControllers ¶
func (q *Queries) KillStaleControllers(ctx context.Context, timeout sqltypes.Duration) (int64, error)
Mark any controller entries that haven't been updated recently as dead.
func (*Queries) KillStaleRunners ¶
func (*Queries) LoadAsyncCall ¶
func (*Queries) PopNextFSMEvent ¶
func (*Queries) PublishEventForTopic ¶
func (q *Queries) PublishEventForTopic(ctx context.Context, arg PublishEventForTopicParams) error
func (*Queries) SetDeploymentDesiredReplicas ¶
func (*Queries) SetNextFSMEvent ¶
func (*Queries) SetSubscriptionCursor ¶
func (q *Queries) SetSubscriptionCursor(ctx context.Context, column1 model.SubscriptionKey, column2 model.TopicEventKey) error
func (*Queries) StartFSMTransition ¶
func (q *Queries) StartFSMTransition(ctx context.Context, arg StartFSMTransitionParams) (FsmInstance, error)
Start a new FSM transition, populating the destination state and async call ID.
"key" is the unique identifier for the FSM execution.
func (*Queries) SucceedAsyncCall ¶
func (q *Queries) SucceedAsyncCall(ctx context.Context, response encryption.OptionalEncryptedAsyncColumn, iD int64) (bool, error)
func (*Queries) SucceedFSMInstance ¶
func (*Queries) UpdateCronJobExecution ¶
func (q *Queries) UpdateCronJobExecution(ctx context.Context, arg UpdateCronJobExecutionParams) error
func (*Queries) UpdateEncryptionVerification ¶
func (q *Queries) UpdateEncryptionVerification(ctx context.Context, verifyTimeline encryption.OptionalEncryptedTimelineColumn, verifyAsync encryption.OptionalEncryptedAsyncColumn) error
func (*Queries) UpsertController ¶
func (*Queries) UpsertModule ¶
func (*Queries) UpsertRunner ¶
Upsert a runner and return the deployment ID that it is assigned to, if any.
func (*Queries) UpsertSubscription ¶
func (q *Queries) UpsertSubscription(ctx context.Context, arg UpsertSubscriptionParams) (UpsertSubscriptionRow, error)
func (*Queries) UpsertTopic ¶
func (q *Queries) UpsertTopic(ctx context.Context, arg UpsertTopicParams) error
type Request ¶
type Request struct { ID int64 Origin Origin Key model.RequestKey SourceAddr string }
type RunnerState ¶
type RunnerState string
const ( RunnerStateNew RunnerState = "new" RunnerStateReserved RunnerState = "reserved" RunnerStateAssigned RunnerState = "assigned" RunnerStateDead RunnerState = "dead" )
func (*RunnerState) Scan ¶
func (e *RunnerState) Scan(src interface{}) error
type SetNextFSMEventParams ¶
type Timeline ¶
type Timeline struct { ID int64 TimeStamp time.Time DeploymentID int64 RequestID optional.Option[int64] Type EventType CustomKey1 optional.Option[string] CustomKey2 optional.Option[string] CustomKey3 optional.Option[string] CustomKey4 optional.Option[string] Payload encryption.EncryptedTimelineColumn ParentRequestID optional.Option[string] }
type TopicEvent ¶
type TopicSubscriber ¶
type TopicSubscription ¶
type TopicSubscriptionState ¶
type TopicSubscriptionState string
const ( TopicSubscriptionStateIdle TopicSubscriptionState = "idle" TopicSubscriptionStateExecuting TopicSubscriptionState = "executing" )
func (*TopicSubscriptionState) Scan ¶
func (e *TopicSubscriptionState) Scan(src interface{}) error
type UpsertRunnerParams ¶
type UpsertRunnerParams struct { Key model.RunnerKey Endpoint string State RunnerState Labels json.RawMessage DeploymentKey model.DeploymentKey }
type UpsertSubscriptionParams ¶
type UpsertSubscriptionParams struct { Key model.SubscriptionKey TopicModule string TopicName string Module string Deployment model.DeploymentKey Name string }