Documentation
¶
Index ¶
- Constants
- Variables
- func IsCanonical(key string) bool
- func LooksLikeLoxaEventMap(payload map[string]any) bool
- func MarshalIngestEnvelope(sdk, version, service string, events []json.RawMessage) ([]byte, error)
- func NormalizeEventAliasesCopyMap(payload map[string]any) (map[string]any, bool)
- func NormalizeEventAliasesMap(payload map[string]any) bool
- func ValidateCollectorResponseMap(payload map[string]any) error
- func ValidateEventBytes(raw []byte, strict bool) error
- func ValidateEventMap(payload map[string]any, strict bool) error
- func ValidateFlexibleJSONBytes(raw []byte, strict bool) error
- type CollectorResponse
- type EventAck
- type EventError
- type IngestEnvelope
- type SourceInfo
- type ValidationError
- type ValidationErrors
Constants ¶
View Source
const ( LOXASpecVersion = "v1" LOXAEventVersion = "v1" LOXAIngestAPIVersion = "v1" MaxEventBytes = 1000 )
Variables ¶
View Source
var AllowedEventStates = set("created", "active", "finished", "emitting", "emitted", "failed_validation", "delivery_failed")
View Source
var AllowedKinds = set("event", "http", "job", "queue", "cli", "cron", "log", "checkpoint")
View Source
var AllowedLevels = set("debug", "info", "warn", "error", "fatal")
View Source
var AllowedOutcomes = set("success", "error", "timeout", "cancelled", "rejected", "abandoned", "partial", "unknown")
View Source
var AllowedPartialReasons = set("not_finished", "process_exit", "timeout", "panic", "collector_unavailable")
View Source
var AllowedSourceSDKs = set("loxa-go", "loxa-py", "loxa-rs", "loxa-cli")
View Source
var AllowedTopLevelFields = set("attrs", "delivery_attempts", "deployment", "duration_ms", "environment", "error", "event", "event_id", "event_state", "event_version", "http", "kind", "level", "message", "method", "organization", "outcome", "partial", "partial_reason", "path", "pii", "request_id", "resource", "route", "schema_version", "service", "source", "span_id", "status_code", "tenant", "timestamp", "trace_id", "user", "version", "workspace")
View Source
var CanonicalFieldSet = AllowedTopLevelFields
Functions ¶
func IsCanonical ¶
func LooksLikeLoxaEventMap ¶
func MarshalIngestEnvelope ¶
func MarshalIngestEnvelope(sdk, version, service string, events []json.RawMessage) ([]byte, error)
func ValidateEventBytes ¶
Types ¶
type CollectorResponse ¶
type CollectorResponse struct {
RequestID string `json:"request_id,omitempty"`
Status string `json:"status,omitempty"`
Accepted int `json:"accepted,omitempty"`
Rejected int `json:"rejected,omitempty"`
Invalid int `json:"invalid,omitempty"`
Deduped int `json:"deduped,omitempty"`
Reason string `json:"reason,omitempty"`
Error string `json:"error,omitempty"`
Acks []EventAck `json:"acks,omitempty"`
Errors []EventError `json:"errors,omitempty"`
}
func ParseCollectorResponse ¶
func ParseCollectorResponse(raw []byte) (CollectorResponse, error)
func (CollectorResponse) PermanentFailure ¶
func (r CollectorResponse) PermanentFailure() (bool, string)
func (CollectorResponse) RetryableError ¶
func (r CollectorResponse) RetryableError() (bool, string)
type EventError ¶
type IngestEnvelope ¶
type IngestEnvelope struct {
APIVersion string `json:"api_version"`
Source SourceInfo `json:"source"`
Events []json.RawMessage `json:"events"`
}
func BuildIngestEnvelope ¶
func BuildIngestEnvelope(sdk, version, service string, events []json.RawMessage) IngestEnvelope
type SourceInfo ¶
type ValidationError ¶
type ValidationErrors ¶
type ValidationErrors []ValidationError
func ValidateEventMapDetailed ¶
func ValidateEventMapDetailed(payload map[string]any, strict bool) ValidationErrors
func (ValidationErrors) Error ¶
func (errs ValidationErrors) Error() string
Click to show internal directories.
Click to hide internal directories.