driver

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 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 FilterLogEventsInput added in v1.3.2

type FilterLogEventsInput struct {
	LogGroup      string
	LogStream     string
	FilterPattern string
	StartTime     time.Time
	EndTime       time.Time
	Limit         int
}

FilterLogEventsInput configures a filter log events operation.

type FilteredLogEvent added in v1.3.2

type FilteredLogEvent struct {
	LogStream string
	Timestamp time.Time
	Message   string
}

FilteredLogEvent represents a log event returned by FilterLogEvents.

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)

	FilterLogEvents(ctx context.Context, input *FilterLogEventsInput) ([]FilteredLogEvent, error)
	PutMetricFilter(ctx context.Context, config *MetricFilterConfig) error
	DeleteMetricFilter(ctx context.Context, logGroup, filterName string) error
	DescribeMetricFilters(ctx context.Context, logGroup string) ([]MetricFilterInfo, error)
}

Logging is the interface that logging provider implementations must satisfy.

type MetricFilterConfig added in v1.3.2

type MetricFilterConfig struct {
	Name            string
	LogGroup        string
	FilterPattern   string
	MetricName      string
	MetricNamespace string
	MetricValue     string
}

MetricFilterConfig describes a metric filter to create.

type MetricFilterInfo added in v1.3.2

type MetricFilterInfo struct {
	Name            string
	LogGroup        string
	FilterPattern   string
	MetricName      string
	MetricNamespace string
	MetricValue     string
	CreatedAt       time.Time
}

MetricFilterInfo describes a metric filter.

Jump to

Keyboard shortcuts

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