Documentation
¶
Index ¶
- Constants
- func GetRDSConnection(ctx context.Context, args *GetRDSConnectionArgs) (string, error)
- func SsmParameterName(projectName string, env string, paramName string) string
- type CustomS3EndpointResolverV2
- type EventPayload
- type GetRDSConnectionArgs
- type Handler
- func (h *Handler) APIHandler(ctx context.Context, request events.LambdaFunctionURLRequest) (events.LambdaFunctionURLResponse, error)
- func (h *Handler) EventHandler(ctx context.Context, event lambdaevents.SQSEvent) error
- func (h *Handler) FlowHandler(ctx context.Context, event lambdaevents.SQSEvent) error
- func (h *Handler) JobHandler(ctx context.Context, event *RunJobPayload) error
- func (h *Handler) Stop() error
- type HandlerArgs
- type JobStatusWebhookPayload
- type LambdaErrorResponse
- type NoopExporter
- type ResponseWriter
- type RunJobPayload
Constants ¶
View Source
const ( // Handles API requests. RuntimeModeApi = "api" // Handles events from SQS. RuntimeModeSubscriber = "subscriber" // Handles both manual and scheduled jobs. RuntimeModeJob = "job" // Handles flows. RuntimeModeFlow = "flow" )
View Source
const ( JobStatusProcessing = "processing" JobStatusSuccess = "success" JobStatusFailed = "failed" )
Variables ¶
This section is empty.
Functions ¶
func GetRDSConnection ¶
func GetRDSConnection(ctx context.Context, args *GetRDSConnectionArgs) (string, error)
Types ¶
type CustomS3EndpointResolverV2 ¶
type CustomS3EndpointResolverV2 struct {
// contains filtered or unexported fields
}
CustomS3EndpointResolverV2 allows us to use a custom endpoint.
If a custom endpoint is set we need to use a custom resolver. Just settng the base endpoint isn't enough for S3 as the default resolver uses the bucket name as a sub-domain, which likely won't work with the custom endpoint. By implementing a full resolver we can force it to be the endpoint we want.
func (*CustomS3EndpointResolverV2) ResolveEndpoint ¶
func (e *CustomS3EndpointResolverV2) ResolveEndpoint(ctx context.Context, params s3.EndpointParameters) (endpoints.Endpoint, error)
type EventPayload ¶
type GetRDSConnectionArgs ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func (*Handler) APIHandler ¶
func (h *Handler) APIHandler(ctx context.Context, request events.LambdaFunctionURLRequest) (events.LambdaFunctionURLResponse, error)
func (*Handler) EventHandler ¶
func (*Handler) FlowHandler ¶ added in v0.413.1
func (*Handler) JobHandler ¶
func (h *Handler) JobHandler(ctx context.Context, event *RunJobPayload) error
type HandlerArgs ¶
type HandlerArgs struct {
// One of the logrus log levels, if omitted defaults to "error"
LogLevel string
// File-system path for the proto JSON for the Keel schema
SchemaPath string
// File-system path to a JSON file containing the Keel config. Note this should be a JSON file, not YAML.
ConfigPath string
// The project name. This needs to be provided as for local environments there won't necessarily be a project name in the config.
ProjectName string
// The env. For local environments will be "development" or "test", for deployed environments it's the user-provided env name.
Env string
// URL of SQS queue for subscriber events
EventsQueueURL string
// URL of SQS queue used to trigger orchestrate flows
FlowsQueueURL string
// ARN fo the iam role for scheduling
SchedulerRoleARN string
// Full ARN of functions Lambda.
FunctionsARN string
// Bucket name used for files and job inputs
BucketName string
// List of secret names to looad from SSM
SecretNames []string
// Webhook URL to use for sending job run updates
JobsWebhookURL string
// If true then tracing data will be exported using the GRPC exporter, otherwise a no-nop exporter will be used.
TracingEnabled bool
// RDS config (can be omitted if using an external db or local postgres)
DBEndpoint string
DBName string
DBSecretArn string
// If this is set all AWS operations will be directed to this endpoint by configuring the clients to use it.
// This is used for mocking the API calls in integration tests
AWSEndpoint string
}
type JobStatusWebhookPayload ¶
type JobStatusWebhookPayload struct {
// The ID provided in the payload
ID string `json:"id"`
// The name of the job
Name string `json:"name"`
ProjectName string `json:"projectName"`
Env string `json:"env"`
// One of "processing", "success", or "failed"
Status string `json:"status"`
// The OTEL trace ID for the job run
TraceID string `json:"traceId"`
Timestamp string `json:"timestamp"`
}
type LambdaErrorResponse ¶
type NoopExporter ¶
type NoopExporter struct {
}
func (*NoopExporter) ExportSpans ¶
func (n *NoopExporter) ExportSpans(ctx context.Context, spans []sdktrace.ReadOnlySpan) error
type ResponseWriter ¶
ResponseWriter is a minimal implementation of http.ResponseWriter that simply stores the response for later inspection.
func (*ResponseWriter) Header ¶
func (c *ResponseWriter) Header() http.Header
Header needed to implement http.ResponseWriter.
func (*ResponseWriter) Write ¶
func (c *ResponseWriter) Write(b []byte) (int, error)
Write needed to implement http.ResponseWriter.
func (*ResponseWriter) WriteHeader ¶
func (c *ResponseWriter) WriteHeader(statusCode int)
WriteHeader needed to implement http.ResponseWriter.
type RunJobPayload ¶
type RunJobPayload struct {
// An ID for this job, if provided then it will be sent in the webhook status payload. Will be empty for scheduled jobs.
ID string `json:"id"`
// The name of the job to run e.g. MySpecialJob
Name string `json:"name"`
// An auth token to use to determine the identity running the job. Will be empty for scheduled jobs.
Token string `json:"token"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.