driver

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package driver defines the interface for logging service implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogEvent

type LogEvent struct {
	Timestamp time.Time
	Message   string
}

LogEvent represents a single log entry.

type LogGroupConfig

type LogGroupConfig struct {
	Name          string
	RetentionDays int
	Tags          map[string]string
}

LogGroupConfig describes a log group to create.

type LogGroupInfo

type LogGroupInfo struct {
	Name          string
	ResourceID    string
	RetentionDays int
	CreatedAt     string
	StoredBytes   int64
	Tags          map[string]string
}

LogGroupInfo describes a log group.

type LogQueryInput

type LogQueryInput struct {
	LogGroup  string
	LogStream string // empty means all streams
	StartTime time.Time
	EndTime   time.Time
	Pattern   string // filter pattern, empty means all
	Limit     int
}

LogQueryInput configures a log query operation.

type LogStreamInfo

type LogStreamInfo struct {
	Name      string
	CreatedAt string
	LastEvent string
}

LogStreamInfo describes a log stream within a log group.

type Logging

type Logging interface {
	CreateLogGroup(ctx context.Context, config LogGroupConfig) (*LogGroupInfo, error)
	DeleteLogGroup(ctx context.Context, name string) error
	GetLogGroup(ctx context.Context, name string) (*LogGroupInfo, error)
	ListLogGroups(ctx context.Context) ([]LogGroupInfo, error)

	CreateLogStream(ctx context.Context, logGroup, streamName string) (*LogStreamInfo, error)
	DeleteLogStream(ctx context.Context, logGroup, streamName string) error
	ListLogStreams(ctx context.Context, logGroup string) ([]LogStreamInfo, error)

	PutLogEvents(ctx context.Context, logGroup, streamName string, events []LogEvent) error
	GetLogEvents(ctx context.Context, input *LogQueryInput) ([]LogEvent, error)
}

Logging is the interface that logging provider implementations must satisfy.

Jump to

Keyboard shortcuts

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