tasklog

package
v0.0.0-...-7086fdf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 1, 2026 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrProviderUnavailable = errors.New("tasklog provider unavailable")
	ErrUnsupported         = errors.New("tasklog operation unsupported")
)

Functions

This section is empty.

Types

type ClickHouseProvider

type ClickHouseProvider struct {
	// contains filtered or unexported fields
}

func NewClickHouseProvider

func NewClickHouseProvider(client *clickhouse.Client) *ClickHouseProvider

func (*ClickHouseProvider) Name

func (p *ClickHouseProvider) Name() string

func (*ClickHouseProvider) QueryLatestTurn

func (p *ClickHouseProvider) QueryLatestTurn(ctx context.Context, taskID uuid.UUID, taskCreatedAt, end time.Time) (*QueryLatestTurnResp, error)

func (*ClickHouseProvider) QueryTurns

func (p *ClickHouseProvider) QueryTurns(ctx context.Context, taskID uuid.UUID, _ time.Time, cursor string, limit int) (*QueryTurnsResp, error)

type Entry

type Entry struct {
	TaskID  uuid.UUID
	TS      time.Time
	Event   string
	Kind    string
	TurnSeq uint32
	Data    string
	MsgSeq  string
	Labels  map[string]string
}

type Gateway

type Gateway struct {
	Loki       Provider
	ClickHouse Provider
}

func (*Gateway) QueryLatestTurn

func (g *Gateway) QueryLatestTurn(ctx context.Context, taskID uuid.UUID, taskCreatedAt, end time.Time, store consts.LogStore) (*QueryLatestTurnResp, error)

func (*Gateway) QueryTurns

func (g *Gateway) QueryTurns(ctx context.Context, taskID uuid.UUID, taskCreatedAt time.Time, cursor string, limit int, store consts.LogStore) (*QueryTurnsResp, error)

type LokiProvider

type LokiProvider struct {
	// contains filtered or unexported fields
}

func NewLokiProvider

func NewLokiProvider(client *loki.Client) *LokiProvider

func (*LokiProvider) Name

func (p *LokiProvider) Name() string

func (*LokiProvider) QueryLatestTurn

func (p *LokiProvider) QueryLatestTurn(ctx context.Context, taskID uuid.UUID, taskCreatedAt, end time.Time) (*QueryLatestTurnResp, error)

func (*LokiProvider) QueryTurns

func (p *LokiProvider) QueryTurns(ctx context.Context, taskID uuid.UUID, taskCreatedAt time.Time, cursor string, limit int) (*QueryTurnsResp, error)

func (*LokiProvider) QueryWindow

func (p *LokiProvider) QueryWindow(ctx context.Context, taskID uuid.UUID, start, end time.Time) ([]Entry, error)

type Provider

type Provider interface {
	Name() string
	QueryLatestTurn(ctx context.Context, taskID uuid.UUID, taskCreatedAt, end time.Time) (*QueryLatestTurnResp, error)
	QueryTurns(ctx context.Context, taskID uuid.UUID, taskCreatedAt time.Time, cursor string, limit int) (*QueryTurnsResp, error)
}

type QueryLatestTurnResp

type QueryLatestTurnResp struct {
	Entries    []Entry
	HasMore    bool
	NextCursor string
}

type QueryTurnsResp

type QueryTurnsResp struct {
	Chunks     []*TurnChunk
	HasMore    bool
	NextCursor string
}

type TurnChunk

type TurnChunk struct {
	Data      []byte
	Event     string
	Kind      string
	Timestamp int64
	Labels    map[string]string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL