Documentation
¶
Index ¶
- func ValidateJobCapabilities(required, available JobCapabilities) error
- type BackupDriver
- type BlobStorage
- type Cache
- type EnqueueOptions
- type I18n
- type JobCapabilities
- type JobHandler
- type JobListFilter
- type JobRecord
- type JobStatus
- type Jobs
- type JobsInspector
- type MailAddress
- type MailAttachment
- type MailMessage
- type Mailer
- type MessageHandler
- type Module
- type PubSub
- type PutObjectInput
- type RestoreDriver
- type RoutableModule
- type Router
- type Store
- type StoredObject
- type Subscription
- type TxFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateJobCapabilities ¶
func ValidateJobCapabilities(required, available JobCapabilities) error
ValidateJobCapabilities fails fast when required job features are not available.
Types ¶
type BackupDriver ¶
type BackupDriver interface {
Create(ctx context.Context, req backupcontract.CreateRequest) (backupcontract.Manifest, error)
}
BackupDriver creates framework backup manifests from runtime state.
type BlobStorage ¶
type BlobStorage interface {
Put(ctx context.Context, in PutObjectInput) (StoredObject, error)
Delete(ctx context.Context, bucket, key string) error
PresignGet(ctx context.Context, bucket, key string, expiry time.Duration) (string, error)
}
BlobStorage is the app-facing object storage boundary.
type Cache ¶
type Cache interface {
Get(ctx context.Context, key string) (value []byte, found bool, err error)
Set(ctx context.Context, key string, value []byte, ttl time.Duration) error
Delete(ctx context.Context, key string) error
InvalidatePrefix(ctx context.Context, prefix string) error
Close() error
}
Cache is the app-facing cache boundary.
type EnqueueOptions ¶
type EnqueueOptions struct {
Queue string
RunAt time.Time
MaxRetries int
Timeout time.Duration
Retention time.Duration
Priority int
}
EnqueueOptions controls queue execution behavior.
type I18n ¶
type I18n interface {
DefaultLanguage() string
SupportedLanguages() []string
NormalizeLanguage(raw string) string
T(ctx context.Context, key string, templateData ...map[string]any) string
TC(ctx context.Context, key string, count any, templateData ...map[string]any) string
TS(ctx context.Context, key string, choice string, templateData ...map[string]any) string
}
I18n is the app-facing localization boundary.
type JobCapabilities ¶
type JobCapabilities struct {
Delayed bool
Retries bool
Cron bool
Priority bool
DeadLetter bool
Dashboard bool
}
JobCapabilities declares backend-supported jobs features.
func (JobCapabilities) Missing ¶
func (c JobCapabilities) Missing(required JobCapabilities) []string
Missing returns required capability names not supported by the current backend.
type JobHandler ¶
JobHandler processes an enqueued job payload.
type JobListFilter ¶
type Jobs ¶
type Jobs interface {
Register(name string, handler JobHandler) error
Enqueue(ctx context.Context, name string, payload []byte, opts EnqueueOptions) (jobID string, err error)
StartWorker(ctx context.Context) error
StartScheduler(ctx context.Context) error
Stop(ctx context.Context) error
Capabilities() JobCapabilities
}
Jobs is the app-facing background jobs boundary.
type JobsInspector ¶
type MailAddress ¶
MailAddress represents an email identity.
type MailAttachment ¶
MailAttachment represents one attachment for a message.
type MailMessage ¶
type MailMessage struct {
From MailAddress
To []MailAddress
CC []MailAddress
BCC []MailAddress
ReplyTo *MailAddress
Subject string
TextBody string
HTMLBody string
Headers map[string]string
Attachments []MailAttachment
}
MailMessage is the app-facing portable mail payload.
type Mailer ¶
type Mailer interface {
Send(ctx context.Context, msg MailMessage) error
}
Mailer is the app-facing mail delivery boundary.
type MessageHandler ¶
MessageHandler processes pubsub payloads.
type PubSub ¶
type PubSub interface {
Publish(ctx context.Context, topic string, payload []byte) error
Subscribe(ctx context.Context, topic string, handler MessageHandler) (Subscription, error)
Close() error
}
PubSub is the app-facing pubsub boundary.
type PutObjectInput ¶
type PutObjectInput struct {
Bucket string
Key string
ContentType string
Reader io.Reader
Size int64
Metadata map[string]string
}
PutObjectInput describes an object upload request.
type RestoreDriver ¶
type RestoreDriver interface {
Restore(ctx context.Context, req backupcontract.RestoreRequest) error
}
RestoreDriver validates and applies restore operations from backup manifests.
type RoutableModule ¶
RoutableModule registers HTTP routes in addition to base module metadata.
type Router ¶
type Router interface {
Group(prefix string, middleware ...echo.MiddlewareFunc) *echo.Group
GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
}
Router is the minimal Echo routing surface exposed to modules.
type Store ¶
type Store interface {
Ping(ctx context.Context) error
WithTx(ctx context.Context, fn TxFunc) error
}
Store is the app-facing database boundary.
type StoredObject ¶
StoredObject describes an object written to blob storage.
type Subscription ¶
type Subscription interface {
Close() error
}
Subscription represents an active pubsub subscription.