forked from ejholmes/cloudwatch
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinterface.go
39 lines (29 loc) · 1.18 KB
/
interface.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package cloudwatch
import (
"context"
"io"
"github.com/aws/aws-sdk-go/service/cloudwatchlogs/cloudwatchlogsiface"
"github.com/aws/aws-sdk-go/service/cloudwatchlogs"
)
// RejectedLogEventsInfoError wraps `cloudwatchlogs.RejectedLogEventsInfo` from
// the AWS SDK, and makes it an implementation of Go's error interface.
type RejectedLogEventsInfoError struct {
Info *cloudwatchlogs.RejectedLogEventsInfo
}
func (e *RejectedLogEventsInfoError) Error() string {
return "log messages were rejected"
}
// CreateOption allows setting various options on the resulting writer.
type CreateOption func(*writerImpl)
// Group is an abstraction over AWS CloudWatch Logs Group, allowing one to treat
// it like a remote io.ReadWriter.
type Group interface {
cloudwatchlogsiface.CloudWatchLogsAPI
// Create creates a log stream in the managed group and returns an
// implementation of io.Writer to write to it.
Create(ctx context.Context, streamName string, opts ...CreateOption) (io.WriteCloser, error)
// Name of the CloudWatch Logs group owned by this proxy.
Name() string
// Open returns an io.Readcloser to read from the log stream.
Open(ctx context.Context, streamName string) io.ReadCloser
}