Documentation
¶
Index ¶
- type Config
- type EmbeddedRuntime
- type Option
- func WithBlobStoreURI(uri string) Option
- func WithConfigurationLimits(limits jobdb.ConfigurationLimits) Option
- func WithLogger(logger *slog.Logger) Option
- func WithMaxInlineArtifactBytes(limit int64) Option
- func WithSecretLimits(limits jobdb.SecretLimits) Option
- func WithSecretProvider(provider jobdb.SecretProvider) Option
- func WithWorkerID(workerID string) Option
- type Runtime
- func (r *Runtime) ArchiveJobSchema(ctx context.Context, key jobdb.JobSchemaKey) (jobdb.JobSchemaInfo, error)
- func (r *Runtime) ArchiveSchedule(ctx context.Context, req jobdb.ScheduleMutationRequest) (jobdb.ScheduleInfo, error)
- func (r *Runtime) CancelJob(ctx context.Context, req jobdb.CancelJobRequest) error
- func (r *Runtime) Close(ctx context.Context) error
- func (r *Runtime) CompleteJobWithLeaseByID(ctx context.Context, jobKey jobdb.JobKey, leaseID string, workerID string, ...) error
- func (r *Runtime) CompleteTaskIfWaiting(ctx context.Context, req jobdb.CompleteTaskIfWaitingRequest) error
- func (r *Runtime) GetChapter(ctx context.Context, ref jobdb.ChapterRef) (jobdb.Chapter, error)
- func (r *Runtime) GetConfiguration(ctx context.Context, req jobdb.GetConfigurationRequest) (jobdb.ConfigurationSnapshot, error)
- func (r *Runtime) GetJob(ctx context.Context, jobKey jobdb.JobKey) (jobdb.JobInfo, error)
- func (r *Runtime) GetJobLease(ctx context.Context, req jobdb.GetJobLeaseRequest) (jobdb.ExecutionLease, error)
- func (r *Runtime) GetJobSchema(ctx context.Context, key jobdb.JobSchemaKey) (jobdb.JobSchemaInfo, error)
- func (r *Runtime) GetSchedule(ctx context.Context, key jobdb.ScheduleKey) (jobdb.ScheduleInfo, error)
- func (r *Runtime) KeepAliveLeaseByID(ctx context.Context, jobKey jobdb.JobKey, leaseID string, workerID string, ...) error
- func (r *Runtime) KeepAliveLeaseByIDWithExpiry(ctx context.Context, jobKey jobdb.JobKey, leaseID string, workerID string, ...) (time.Time, error)
- func (r *Runtime) ListChapters(ctx context.Context, req jobdb.ListChaptersRequest) ([]jobdb.Chapter, error)
- func (r *Runtime) ListJobSchemas(ctx context.Context, req jobdb.ListJobSchemasRequest) (jobdb.ListJobSchemasResponse, error)
- func (r *Runtime) ListJobs(ctx context.Context, req jobdb.ListJobsRequest) (jobdb.ListJobsResponse, error)
- func (r *Runtime) ListScheduleRuns(ctx context.Context, req jobdb.ListScheduleRunsRequest) (jobdb.ListScheduleRunsResponse, error)
- func (r *Runtime) ListSchedules(ctx context.Context, req jobdb.ListSchedulesRequest) (jobdb.ListSchedulesResponse, error)
- func (r *Runtime) OpenArtifact(ctx context.Context, ref jobdb.ArtifactRef) (jobdb.ArtifactReader, error)
- func (r *Runtime) PauseSchedule(ctx context.Context, req jobdb.ScheduleMutationRequest) (jobdb.ScheduleInfo, error)
- func (r *Runtime) PollWork(ctx context.Context, req jobdb.PollWorkRequest) ([]jobdb.ExecutionLease, error)
- func (r *Runtime) PutChapter(ctx context.Context, req jobdb.PutChapterRequest) error
- func (r *Runtime) RegisterJobSchema(ctx context.Context, req jobdb.RegisterJobSchemaRequest) (jobdb.JobSchemaInfo, error)
- func (r *Runtime) RemoveDevSecret(ctx context.Context, tenant, name string) error
- func (r *Runtime) RenewExecutionLeaseByID(ctx context.Context, key jobdb.JobKey, leaseID, workerID string, ...) (jobdb.RenewableExecutionLease, error)
- func (r *Runtime) RescheduleJobWithLeaseByID(ctx context.Context, jobKey jobdb.JobKey, leaseID string, workerID string, ...) error
- func (r *Runtime) ResolveSecrets(ctx context.Context, req jobdb.ResolveSecretsRequest) (jobdb.SecretResolveResult, error)
- func (r *Runtime) ResumeSchedule(ctx context.Context, req jobdb.ScheduleMutationRequest) (jobdb.ScheduleInfo, error)
- func (r *Runtime) SecretResolutionLimits() jobdb.SecretLimits
- func (r *Runtime) SetDevSecret(ctx context.Context, tenant, name, value string) error
- func (r *Runtime) SubmitJob(ctx context.Context, req jobdb.SubmitJobRequest) (jobdb.JobHandle, error)
- func (r *Runtime) SubmitJobWithLeaseByID(ctx context.Context, parentJobKey jobdb.JobKey, leaseID string, ...) (jobdb.JobHandle, error)
- func (r *Runtime) SubmitRestartJob(ctx context.Context, req jobdb.SubmitRestartJobRequest) (jobdb.JobHandle, error)
- func (r *Runtime) SubmitRestartJobWithLeaseByID(ctx context.Context, parentJobKey jobdb.JobKey, leaseID string, ...) (jobdb.JobHandle, error)
- func (r *Runtime) TriggerSchedule(ctx context.Context, req jobdb.TriggerScheduleRequest) (jobdb.JobHandle, error)
- func (r *Runtime) UpsertSchedule(ctx context.Context, req jobdb.UpsertScheduleRequest) (jobdb.ScheduleInfo, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
ConfigurationLimits jobdb.ConfigurationLimits
// SecretProvider is independent of job storage and remains caller-owned.
// If nil, a development store opens at <main database>.secrets.db (or in memory).
SecretProvider jobdb.SecretProvider
SecretLimits jobdb.SecretLimits
// DSN is passed to modernc.org/sqlite. If empty, DBPath is used.
DSN string
// DBPath is the durable SQLite database path used when DSN is empty.
DBPath string
// BlobDir stores large chapter artifacts on local blobfs. If empty, it is derived from DBPath.
BlobDir string
// BlobStoreURI is a blob bucket URL for large chapter artifacts. If set, it overrides BlobDir.
// blobfs:// is supported by default. Other schemes require an explicit provider import.
BlobStoreURI string
// MaxInlineArtifactBytes controls when artifacts move from rows to blobstore.
MaxInlineArtifactBytes int64
// Logger is used for runtime diagnostics.
Logger *slog.Logger
// WorkerID overrides the runtime's fallback worker id.
WorkerID string
}
Config describes a local SQLite-backed jobdb runtime.
type EmbeddedRuntime ¶
type EmbeddedRuntime struct {
Runtime *Runtime
// contains filtered or unexported fields
}
func StartEmbeddedRuntime ¶
func StartEmbeddedRuntime(ctx context.Context) (*EmbeddedRuntime, error)
func (*EmbeddedRuntime) Shutdown ¶
func (e *EmbeddedRuntime) Shutdown()
type Option ¶
type Option func(*runtimeOptions)
Option customizes New.
func WithBlobStoreURI ¶ added in v0.0.10
func WithConfigurationLimits ¶ added in v0.0.33
func WithConfigurationLimits(limits jobdb.ConfigurationLimits) Option
WithConfigurationLimits bounds tenant configuration reads and writes.
func WithLogger ¶
func WithMaxInlineArtifactBytes ¶ added in v0.0.10
func WithSecretLimits ¶ added in v0.0.30
func WithSecretLimits(limits jobdb.SecretLimits) Option
WithSecretLimits bounds provider calls and their results.
func WithSecretProvider ¶ added in v0.0.30
func WithSecretProvider(provider jobdb.SecretProvider) Option
WithSecretProvider sets a caller-owned provider independently of job storage.
func WithWorkerID ¶
type Runtime ¶
type Runtime struct {
*configuration.Service
// contains filtered or unexported fields
}
Runtime is a SQLite WorkflowRuntime that composes scheduler rows, chapter rows, and Go CDK blob artifact storage.
func NewFromConfig ¶
NewFromConfig opens a SQLite database, creates a chapter store over the same *sql.DB rowstore, and returns the composed runtime.
func (*Runtime) ArchiveJobSchema ¶ added in v0.0.9
func (r *Runtime) ArchiveJobSchema(ctx context.Context, key jobdb.JobSchemaKey) (jobdb.JobSchemaInfo, error)
func (*Runtime) ArchiveSchedule ¶
func (r *Runtime) ArchiveSchedule(ctx context.Context, req jobdb.ScheduleMutationRequest) (jobdb.ScheduleInfo, error)
func (*Runtime) Close ¶
Close releases runtime-owned resources, including the default secrets store. Caller-supplied database handles and secret providers remain open.
func (*Runtime) CompleteJobWithLeaseByID ¶
func (*Runtime) CompleteTaskIfWaiting ¶
func (*Runtime) GetChapter ¶
func (*Runtime) GetConfiguration ¶ added in v0.0.33
func (r *Runtime) GetConfiguration(ctx context.Context, req jobdb.GetConfigurationRequest) (jobdb.ConfigurationSnapshot, error)
func (*Runtime) GetJobLease ¶
func (r *Runtime) GetJobLease(ctx context.Context, req jobdb.GetJobLeaseRequest) (jobdb.ExecutionLease, error)
func (*Runtime) GetJobSchema ¶ added in v0.0.9
func (r *Runtime) GetJobSchema(ctx context.Context, key jobdb.JobSchemaKey) (jobdb.JobSchemaInfo, error)
func (*Runtime) GetSchedule ¶
func (r *Runtime) GetSchedule(ctx context.Context, key jobdb.ScheduleKey) (jobdb.ScheduleInfo, error)
func (*Runtime) KeepAliveLeaseByID ¶
func (*Runtime) KeepAliveLeaseByIDWithExpiry ¶
func (*Runtime) ListChapters ¶
func (*Runtime) ListJobSchemas ¶ added in v0.0.9
func (r *Runtime) ListJobSchemas(ctx context.Context, req jobdb.ListJobSchemasRequest) (jobdb.ListJobSchemasResponse, error)
func (*Runtime) ListJobs ¶
func (r *Runtime) ListJobs(ctx context.Context, req jobdb.ListJobsRequest) (jobdb.ListJobsResponse, error)
func (*Runtime) ListScheduleRuns ¶
func (r *Runtime) ListScheduleRuns(ctx context.Context, req jobdb.ListScheduleRunsRequest) (jobdb.ListScheduleRunsResponse, error)
func (*Runtime) ListSchedules ¶
func (r *Runtime) ListSchedules(ctx context.Context, req jobdb.ListSchedulesRequest) (jobdb.ListSchedulesResponse, error)
func (*Runtime) OpenArtifact ¶
func (r *Runtime) OpenArtifact(ctx context.Context, ref jobdb.ArtifactRef) (jobdb.ArtifactReader, error)
func (*Runtime) PauseSchedule ¶
func (r *Runtime) PauseSchedule(ctx context.Context, req jobdb.ScheduleMutationRequest) (jobdb.ScheduleInfo, error)
func (*Runtime) PollWork ¶
func (r *Runtime) PollWork(ctx context.Context, req jobdb.PollWorkRequest) ([]jobdb.ExecutionLease, error)
func (*Runtime) PutChapter ¶
func (*Runtime) RegisterJobSchema ¶ added in v0.0.9
func (r *Runtime) RegisterJobSchema(ctx context.Context, req jobdb.RegisterJobSchemaRequest) (jobdb.JobSchemaInfo, error)
func (*Runtime) RemoveDevSecret ¶ added in v0.0.29
func (*Runtime) RenewExecutionLeaseByID ¶ added in v0.0.22
func (r *Runtime) RenewExecutionLeaseByID(ctx context.Context, key jobdb.JobKey, leaseID, workerID string, duration time.Duration) (jobdb.RenewableExecutionLease, error)
RenewExecutionLeaseByID renews an exact live lease and loads its execution snapshot.
func (*Runtime) RescheduleJobWithLeaseByID ¶
func (*Runtime) ResolveSecrets ¶ added in v0.0.29
func (r *Runtime) ResolveSecrets(ctx context.Context, req jobdb.ResolveSecretsRequest) (jobdb.SecretResolveResult, error)
ResolveSecrets accepts claims verified by the HTTP transport. Embedded workers use their issued lease's ResolveSecrets method instead of presenting raw IDs.
func (*Runtime) ResumeSchedule ¶
func (r *Runtime) ResumeSchedule(ctx context.Context, req jobdb.ScheduleMutationRequest) (jobdb.ScheduleInfo, error)
func (*Runtime) SecretResolutionLimits ¶ added in v0.0.29
func (r *Runtime) SecretResolutionLimits() jobdb.SecretLimits
func (*Runtime) SetDevSecret ¶ added in v0.0.29
SetDevSecret and RemoveDevSecret are development administration operations. HTTP exposure is deliberately limited to runtimes implementing these methods.
func (*Runtime) SubmitJobWithLeaseByID ¶ added in v0.0.13
func (*Runtime) SubmitRestartJob ¶
func (*Runtime) SubmitRestartJobWithLeaseByID ¶ added in v0.0.13
func (*Runtime) TriggerSchedule ¶
func (*Runtime) UpsertSchedule ¶
func (r *Runtime) UpsertSchedule(ctx context.Context, req jobdb.UpsertScheduleRequest) (jobdb.ScheduleInfo, error)