Documentation
¶
Index ¶
- Variables
- func FormatLogs(logs []TaskLogEntry) string
- type ReadRecord
- type S2Client
- func (c *S2Client) Append(ctx context.Context, stream string, data interface{}) error
- func (c *S2Client) AppendLog(ctx context.Context, taskID, stream, data string) error
- func (c *S2Client) AppendStatus(ctx context.Context, taskID, status string, exitCode *int, errorMsg string) error
- func (c *S2Client) Enabled() bool
- func (c *S2Client) Read(ctx context.Context, stream string, seqNum int64, count int) ([]ReadRecord, error)
- func (c *S2Client) ReadLogs(ctx context.Context, taskID string, seqNum int64) ([]TaskLogEntry, int64, error)
- type S2Config
- type StreamNames
- type TaskLogEntry
- type TaskStatusEntry
Constants ¶
This section is empty.
Variables ¶
var Streams = StreamNames{}
Streams provides access to stream names
Functions ¶
func FormatLogs ¶
func FormatLogs(logs []TaskLogEntry) string
FormatLogs converts log entries to plain text (one line per entry). Used by filesystem and CLI for consistent output formatting.
Types ¶
type ReadRecord ¶
type ReadRecord struct {
SeqNum int64 `json:"seq_num"`
Timestamp int64 `json:"timestamp"`
Body string `json:"body"` // S2 returns body as a JSON-encoded string
}
ReadRecord represents a record read from S2
type S2Client ¶
type S2Client struct {
// contains filtered or unexported fields
}
S2Client provides access to S2 streams for append-only log storage
func NewS2Client ¶
NewS2Client creates a new S2 stream client
func (*S2Client) AppendStatus ¶
func (c *S2Client) AppendStatus(ctx context.Context, taskID, status string, exitCode *int, errorMsg string) error
AppendStatus is a convenience method for appending a status entry
func (*S2Client) Read ¶
func (c *S2Client) Read(ctx context.Context, stream string, seqNum int64, count int) ([]ReadRecord, error)
Read reads records from a stream
func (*S2Client) ReadLogs ¶
func (c *S2Client) ReadLogs(ctx context.Context, taskID string, seqNum int64) ([]TaskLogEntry, int64, error)
ReadLogs reads log entries for a task. Returns the logs, the next sequence number for pagination, and any error. Pass nextSeqNum to subsequent calls to fetch logs beyond the first page.
type S2Config ¶
type S2Config struct {
// Token is the S2 API token
Token string
// Basin is the S2 basin name (e.g., "airstore")
Basin string
// Timeout for HTTP requests
Timeout time.Duration
}
S2Config configures the S2 stream client
type StreamNames ¶
type StreamNames struct{}
StreamNames provides consistent stream naming
func (StreamNames) TaskLogs ¶
func (StreamNames) TaskLogs(taskID string) string
TaskLogs returns the stream name for a task's logs
func (StreamNames) TaskStatus ¶
func (StreamNames) TaskStatus(taskID string) string
TaskStatus returns the stream name for a task's status events