corev1

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package corev1 provides storage-neutral common reference types for LogSchema v1.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsCanonicalDecimal

func IsCanonicalDecimal(data []byte) bool

IsCanonicalDecimal reports whether data is a canonical quoted decimal.

Types

type Attributes

type Attributes map[string]any

func (Attributes) MarshalJSON

func (a Attributes) MarshalJSON() ([]byte, error)

MarshalJSON validates attributes and encodes a nil map as an empty object.

func (*Attributes) UnmarshalJSON

func (a *Attributes) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes an attribute object while preserving JSON numbers exactly.

func (Attributes) Validate

func (a Attributes) Validate() error

type DecimalInt64

type DecimalInt64 int64

DecimalInt64 is encoded as a quoted base-10 integer in JSON.

func (DecimalInt64) MarshalJSON

func (v DecimalInt64) MarshalJSON() ([]byte, error)

func (*DecimalInt64) UnmarshalJSON

func (v *DecimalInt64) UnmarshalJSON(data []byte) error

type DecimalUint64

type DecimalUint64 uint64

DecimalUint64 is encoded as a quoted base-10 unsigned integer in JSON.

func (DecimalUint64) MarshalJSON

func (v DecimalUint64) MarshalJSON() ([]byte, error)

func (*DecimalUint64) UnmarshalJSON

func (v *DecimalUint64) UnmarshalJSON(data []byte) error

type Fingerprint

type Fingerprint struct {
	Value     string `json:"value"`
	Algorithm string `json:"algorithm"`
	Version   string `json:"version"`
}

Fingerprint identifies a value together with the versioned algorithm that produced it. The producing algorithm defines whether the value is safe to disclose.

func (Fingerprint) Validate

func (f Fingerprint) Validate() error

Validate verifies that all fingerprint identity components are present.

type Resource

type Resource struct {
	ServiceName *string    `json:"service_name"`
	Attributes  Attributes `json:"attributes"`
}

func (Resource) Validate

func (r Resource) Validate() error

type Source

type Source struct {
	Kind        SourceKind   `json:"kind"`
	Name        *string      `json:"name"`
	Fingerprint *Fingerprint `json:"fingerprint"`
	// Attributes contains producer-defined metadata about the input source or
	// how records were obtained from it.
	Attributes Attributes `json:"attributes"`

	OffsetStart *DecimalUint64 `json:"offset_start"`
	OffsetEnd   *DecimalUint64 `json:"offset_end"`
	LineStart   *DecimalUint64 `json:"line_start"`
	LineEnd     *DecimalUint64 `json:"line_end"`
}

func (Source) Validate

func (s Source) Validate() error

type SourceKind

type SourceKind string
const (
	SourceFile     SourceKind = "file"
	SourceStdin    SourceKind = "stdin"
	SourceOTLPFile SourceKind = "otlp_file"
	SourceOther    SourceKind = "other"
)

type TraceContext

type TraceContext struct {
	TraceID    string  `json:"trace_id"`
	SpanID     *string `json:"span_id"`
	TraceFlags *uint8  `json:"trace_flags"`
	// TraceState contains the serialized W3C tracestate field value. Producers
	// are responsible for validating the complete W3C member grammar.
	TraceState *string `json:"trace_state"`
}

func (TraceContext) Validate

func (c TraceContext) Validate() error

Jump to

Keyboard shortcuts

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