Versions in this module Expand all Collapse all v0 v0.0.2 Sep 12, 2026 v0.0.1 Sep 11, 2026 Changes in this version + const MeterCacheReadTokens + const MeterCacheWriteTokens + const MeterInputTokens + const MeterMessages + const MeterOutputTokens + const MeterToolInvocations + const ResourceGroup + const ResourceKind + const ServiceName + func IsULID(value string) bool + func NewULID(nowMillis int64) string + type BuildToolInvocationInput struct + ConversationID string + ConversationUID string + Namespace string + NowMillis int64 + ProjectName string + ServiceName string + type BuildUsageInput struct + ConversationID string + ConversationUID string + Model string + Namespace string + NowMillis int64 + ProjectName string + Tokens UsageTokens + type CloudEvent struct + Data CloudEventData + DataContentType string + ID string + Source string + SpecVersion string + Subject string + Time string + Type string + func ToCloudEvent(e Event, source string) CloudEvent + type CloudEventData struct + Dimensions map[string]string + Resource *CloudEventResource + Value string + type CloudEventResource struct + Group string + Kind string + Name string + Namespace string + UID string + type EmitResult struct + Count int + Error string + Noop bool + OK bool + Status int + type Emitter struct + func NewEmitter(cfg EmitterConfig) *Emitter + func (e *Emitter) Emit(ctx context.Context, events []Event) EmitResult + type EmitterConfig struct + APIKey string + GatewayURL string + HTTPClient *http.Client + Logger *slog.Logger + Source string + type Event struct + Dimensions map[string]string + EventID string + MeterName string + ProjectRef ProjectRef + Resource EventResource + Timestamp string + Value string + func BuildToolInvocationEvent(in BuildToolInvocationInput) Event + func BuildUsageEvents(in BuildUsageInput) []Event + type EventResource struct + Labels map[string]string + Ref ResourceRef + type ProjectRef struct + Name string + type ResourceRef struct + Group string + Kind string + Name string + Namespace string + ProjectRef ProjectRef + UID string + type UsageTokens struct + CacheCreationInputTokens int64 + CachedInputTokens int64 + InputTokens int64 + Messages *int64 + OutputTokens int64