model

package
v0.1.20 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EntryIDTime

func EntryIDTime(id EntryID) time.Time

func EntryIDToUint64

func EntryIDToUint64(id EntryID) uint64

func IsZeroSpanID

func IsZeroSpanID(id SpanID) bool

func IsZeroTraceID

func IsZeroTraceID(id TraceID) bool

Types

type Attr

type Attr struct {
	Key   string
	Value string
}

type EntryID

type EntryID = ulid.ULID

func EntryIDFromString

func EntryIDFromString(s string) (EntryID, error)

func MustNewEntryID

func MustNewEntryID() EntryID

func NewEntryID

func NewEntryID() (EntryID, error)

type Level

type Level uint8
const (
	LevelTrace Level = iota
	LevelDebug
	LevelInfo
	LevelWarn
	LevelError
	LevelFatal
)

func LevelFromString

func LevelFromString(s string) (Level, error)

func (Level) MarshalJSON

func (l Level) MarshalJSON() ([]byte, error)

func (Level) String

func (l Level) String() string

type LogEntry

type LogEntry struct {
	ID        EntryID
	Timestamp time.Time
	Level     Level
	Service   string
	Host      string
	TraceID   TraceID
	SpanID    SpanID
	Body      string
	Attrs     []Attr
}

func NewLogEntry

func NewLogEntry(level Level, service, host, body string, attrs ...Attr) (LogEntry, error)

func (*LogEntry) DecodeBytes

func (e *LogEntry) DecodeBytes(data []byte) error

func (*LogEntry) ReadFrom

func (e *LogEntry) ReadFrom(r io.Reader) (int64, error)

func (*LogEntry) WriteTo

func (e *LogEntry) WriteTo(w io.Writer) (int64, error)

type SpanEntry

type SpanEntry struct {
	ID        EntryID
	TraceID   TraceID
	SpanID    SpanID
	ParentID  SpanID
	Service   string
	Operation string
	StartTime time.Time
	EndTime   time.Time
	Status    SpanStatus
	Attrs     []Attr
}

func NewSpanEntry

func NewSpanEntry(traceID TraceID, spanID SpanID, parentID SpanID, service, operation string) (SpanEntry, error)

func (*SpanEntry) DecodeBytes

func (s *SpanEntry) DecodeBytes(data []byte) error

func (*SpanEntry) Duration

func (s *SpanEntry) Duration() time.Duration

func (*SpanEntry) IsRoot

func (s *SpanEntry) IsRoot() bool

func (*SpanEntry) ReadFrom

func (s *SpanEntry) ReadFrom(r io.Reader) (int64, error)

func (*SpanEntry) WriteTo

func (s *SpanEntry) WriteTo(w io.Writer) (int64, error)

type SpanID

type SpanID [8]byte

func ZeroSpanID

func ZeroSpanID() SpanID

func (SpanID) MarshalJSON

func (id SpanID) MarshalJSON() ([]byte, error)

type SpanStatus

type SpanStatus uint8
const (
	SpanStatusUnset SpanStatus = iota
	SpanStatusOK
	SpanStatusError
)

func (SpanStatus) String

func (s SpanStatus) String() string

type TraceID

type TraceID [16]byte

func ZeroTraceID

func ZeroTraceID() TraceID

func (TraceID) MarshalJSON

func (id TraceID) MarshalJSON() ([]byte, error)

Jump to

Keyboard shortcuts

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