apiintegrations

package
v2.11.46 Latest Latest
Warning

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

Go to latest
Published: May 2, 2026 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxIngestPartialLineBytes = 512 * 1024
)

Variables

This section is empty.

Functions

This section is empty.

Types

type IngestState

type IngestState struct {
	SourcePath           string
	Offset               int64
	FileSize             int64
	FileModTime          time.Time
	PartialLine          string
	PartialLineBytes     int
	PartialLineOversized bool
	UpdatedAt            time.Time
}

IngestState stores the persistent cursor for a tailed JSONL file.

type UsageEvent

type UsageEvent struct {
	Timestamp        time.Time
	Integration      string
	Provider         string
	Account          string
	Model            string
	RequestID        string
	PromptTokens     int
	CompletionTokens int
	TotalTokens      int
	CostUSD          *float64
	LatencyMS        *int
	MetadataJSON     string
	SourcePath       string
	Fingerprint      string
}

UsageEvent is the normalized API integration telemetry event stored by onWatch.

func ParseUsageEventLine

func ParseUsageEventLine(line []byte, sourcePath string) (*UsageEvent, error)

ParseUsageEventLine validates and normalizes a single JSONL event line.

Jump to

Keyboard shortcuts

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