Documentation
¶
Index ¶
- type CloudWatchLogsService
- func (s *CloudWatchLogsService) Actions() []service.Action
- func (s *CloudWatchLogsService) ExportState() (json.RawMessage, error)
- func (s *CloudWatchLogsService) HandleRequest(ctx *service.RequestContext) (*service.Response, error)
- func (s *CloudWatchLogsService) HealthCheck() error
- func (s *CloudWatchLogsService) ImportState(data json.RawMessage) error
- func (s *CloudWatchLogsService) Name() string
- func (s *CloudWatchLogsService) ResourceSchemas() []schema.ResourceSchema
- type LogEvent
- type LogGroup
- type LogStream
- type Store
- func (s *Store) CreateLogGroup(name string) *service.AWSError
- func (s *Store) CreateLogStream(groupName, streamName string) *service.AWSError
- func (s *Store) DeleteLogGroup(name string) *service.AWSError
- func (s *Store) DeleteLogStream(groupName, streamName string) *service.AWSError
- func (s *Store) DeleteRetentionPolicy(groupName string) *service.AWSError
- func (s *Store) DescribeLogGroups(prefix string) []*LogGroup
- func (s *Store) DescribeLogStreams(groupName, prefix string) ([]*LogStream, *service.AWSError)
- func (s *Store) FilterLogEvents(groupName string, streamNames []string, filterPattern string, ...) ([]LogEvent, *service.AWSError)
- func (s *Store) GetLogEvents(groupName, streamName string, startTime, endTime int64, limit int) ([]LogEvent, string, string, *service.AWSError)
- func (s *Store) ListTagsLogGroup(groupName string) (map[string]string, *service.AWSError)
- func (s *Store) PutLogEvents(groupName, streamName string, events []LogEvent) (string, *service.AWSError)
- func (s *Store) PutRetentionPolicy(groupName string, retentionDays int) *service.AWSError
- func (s *Store) TagLogGroup(groupName string, tags map[string]string) *service.AWSError
- func (s *Store) UntagLogGroup(groupName string, tagKeys []string) *service.AWSError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CloudWatchLogsService ¶
type CloudWatchLogsService struct {
// contains filtered or unexported fields
}
CloudWatchLogsService is the cloudmock implementation of the AWS CloudWatch Logs API.
func New ¶
func New(accountID, region string) *CloudWatchLogsService
New returns a new CloudWatchLogsService for the given AWS account ID and region.
func (*CloudWatchLogsService) Actions ¶
func (s *CloudWatchLogsService) Actions() []service.Action
Actions returns the list of CloudWatch Logs API actions supported by this service.
func (*CloudWatchLogsService) ExportState ¶
func (s *CloudWatchLogsService) ExportState() (json.RawMessage, error)
ExportState returns a JSON snapshot of all CloudWatch Logs log groups.
func (*CloudWatchLogsService) HandleRequest ¶
func (s *CloudWatchLogsService) HandleRequest(ctx *service.RequestContext) (*service.Response, error)
HandleRequest routes an incoming CloudWatch Logs request to the appropriate handler. CloudWatch Logs uses the JSON protocol with X-Amz-Target: Logs_20140328.<Action>.
func (*CloudWatchLogsService) HealthCheck ¶
func (s *CloudWatchLogsService) HealthCheck() error
HealthCheck always returns nil (no external dependencies).
func (*CloudWatchLogsService) ImportState ¶
func (s *CloudWatchLogsService) ImportState(data json.RawMessage) error
ImportState restores CloudWatch Logs state from a JSON snapshot.
func (*CloudWatchLogsService) Name ¶
func (s *CloudWatchLogsService) Name() string
Name returns the AWS service name used for routing. CloudWatch Logs uses "logs" in the credential scope and X-Amz-Target prefix.
func (*CloudWatchLogsService) ResourceSchemas ¶
func (s *CloudWatchLogsService) ResourceSchemas() []schema.ResourceSchema
ResourceSchemas returns the schema for CloudWatch Logs resource types.
type LogGroup ¶
type LogGroup struct {
Name string
ARN string
CreationTime int64
RetentionDays int
StoredBytes int64
Tags map[string]string
Streams map[string]*LogStream
}
LogGroup holds metadata and streams for a single log group.
type LogStream ¶
type LogStream struct {
Name string
ARN string
CreationTime int64
FirstEventTimestamp int64
LastEventTimestamp int64
LastIngestionTime int64
UploadSequenceToken string
Events []LogEvent
}
LogStream holds metadata and events for a single log stream.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is the in-memory store for CloudWatch Logs resources.
func (*Store) CreateLogGroup ¶
CreateLogGroup creates a new log group. Returns AlreadyExistsException if it exists.
func (*Store) CreateLogStream ¶
CreateLogStream creates a new stream inside a group.
func (*Store) DeleteLogGroup ¶
DeleteLogGroup removes a log group and all its streams.
func (*Store) DeleteLogStream ¶
DeleteLogStream removes a stream from a group.
func (*Store) DeleteRetentionPolicy ¶
DeleteRetentionPolicy removes the retention policy from a log group.
func (*Store) DescribeLogGroups ¶
DescribeLogGroups returns log groups, optionally filtered by prefix.
func (*Store) DescribeLogStreams ¶
DescribeLogStreams returns streams for a group, optionally filtered by prefix.
func (*Store) FilterLogEvents ¶
func (s *Store) FilterLogEvents(groupName string, streamNames []string, filterPattern string, startTime, endTime int64) ([]LogEvent, *service.AWSError)
FilterLogEvents searches across one or more streams for events matching a substring pattern.
func (*Store) GetLogEvents ¶
func (s *Store) GetLogEvents(groupName, streamName string, startTime, endTime int64, limit int) ([]LogEvent, string, string, *service.AWSError)
GetLogEvents retrieves events from a stream with optional time filtering and limit.
func (*Store) ListTagsLogGroup ¶
ListTagsLogGroup returns the tags for a log group.
func (*Store) PutLogEvents ¶
func (s *Store) PutLogEvents(groupName, streamName string, events []LogEvent) (string, *service.AWSError)
PutLogEvents appends events to a stream and returns the next sequence token.
func (*Store) PutRetentionPolicy ¶
PutRetentionPolicy sets retentionInDays on a log group.
func (*Store) TagLogGroup ¶
TagLogGroup adds or updates tags on a log group.