Documentation
¶
Overview ¶
Package whwrite files a webhook source's events as raw segments, the way the HTTP receiver writes a request's: one gzipped JSON-lines object per window, the window recorded before and after the write, its raw partition registered after, and the scripts naming the source told (#2332). The inputs the platform reads itself rather than being posted to, a mailbox (#2247) and an application database (#2408), write through it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Objects Objects
Bucket string
Recorder Recorder
RawWindows RawWindows
// Writer names the writer in each segment's key: "imap-<replica>".
Writer string
Logger *slog.Logger
Now func() time.Time
}
Config assembles a writer.
type Objects ¶
type Objects interface {
PutObject(ctx context.Context, bucket, key string, data []byte, contentType string) error
}
Objects writes a segment to the managed-resources bucket.
type RawWindows ¶
type RawWindows interface {
EnsureRawWindow(ctx context.Context, src whsource.Source, start time.Time) error
}
RawWindows registers a window's raw partition so its events are queryable before compaction.
type Recorder ¶
type Recorder interface {
MarkSegment(ctx context.Context, source string, start time.Time, length time.Duration, bytes int64) error
}
Recorder records a window a segment was written to.