cloudlogging

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: May 23, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package cloudlogging provides an in-memory mock implementation of GCP Cloud Logging.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mock

type Mock struct {
	// contains filtered or unexported fields
}

Mock is an in-memory mock implementation of GCP Cloud Logging.

func New

func New(opts *config.Options) *Mock

New creates a new Cloud Logging mock with the given configuration options.

func (*Mock) CreateLogGroup

func (m *Mock) CreateLogGroup(_ context.Context, cfg driver.LogGroupConfig) (*driver.LogGroupInfo, error)

CreateLogGroup creates a new Cloud Logging log bucket.

func (*Mock) CreateLogStream

func (m *Mock) CreateLogStream(_ context.Context, logGroup, streamName string) (*driver.LogStreamInfo, error)

CreateLogStream creates a new log stream in a log bucket.

func (*Mock) DeleteLogGroup

func (m *Mock) DeleteLogGroup(_ context.Context, name string) error

DeleteLogGroup deletes a Cloud Logging log bucket by name.

func (*Mock) DeleteLogStream

func (m *Mock) DeleteLogStream(_ context.Context, logGroup, streamName string) error

DeleteLogStream deletes a log stream from a log bucket.

func (*Mock) DeleteMetricFilter added in v1.3.2

func (m *Mock) DeleteMetricFilter(
	_ context.Context,
	logGroup, filterName string,
) error

DeleteMetricFilter deletes a metric filter from a log group.

func (*Mock) DescribeMetricFilters added in v1.3.2

func (m *Mock) DescribeMetricFilters(
	_ context.Context,
	logGroup string,
) ([]driver.MetricFilterInfo, error)

DescribeMetricFilters lists all metric filters for a log group.

func (*Mock) FilterLogEvents added in v1.3.2

func (m *Mock) FilterLogEvents(
	_ context.Context,
	input *driver.FilterLogEventsInput,
) ([]driver.FilteredLogEvent, error)

FilterLogEvents filters log events across streams using a pattern.

func (*Mock) GetLogEvents

func (m *Mock) GetLogEvents(_ context.Context, input *driver.LogQueryInput) ([]driver.LogEvent, error)

GetLogEvents retrieves log events matching the query.

func (*Mock) GetLogGroup

func (m *Mock) GetLogGroup(_ context.Context, name string) (*driver.LogGroupInfo, error)

GetLogGroup retrieves information about a Cloud Logging log bucket.

func (*Mock) ListLogGroups

func (m *Mock) ListLogGroups(_ context.Context) ([]driver.LogGroupInfo, error)

ListLogGroups lists all Cloud Logging log buckets.

func (*Mock) ListLogStreams

func (m *Mock) ListLogStreams(_ context.Context, logGroup string) ([]driver.LogStreamInfo, error)

ListLogStreams lists all log streams in a log bucket.

func (*Mock) PutLogEvents

func (m *Mock) PutLogEvents(ctx context.Context, groupName, streamName string, events []driver.LogEvent) error

PutLogEvents writes log events to a stream.

func (*Mock) PutMetricFilter added in v1.3.2

func (m *Mock) PutMetricFilter(
	_ context.Context,
	cfg *driver.MetricFilterConfig,
) error

PutMetricFilter creates or updates a metric filter for a log group.

func (*Mock) SetMonitoring

func (m *Mock) SetMonitoring(mon mondriver.Monitoring)

SetMonitoring sets the monitoring backend for auto-metric generation.

Jump to

Keyboard shortcuts

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