Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrNotSupported = errors.New("not supported") ErrDSNEmpty = errors.New("dsn is empty") ErrConnClosed = errors.New("connection closed") ErrInvalidScheme = errors.New("invalid scheme") )
var CloudwatchLogsClientConstructor func(ctx context.Context, cfg *CloudwatchLogsInsightsConfig) (CloudwatchLogsClient, error)
CloudwatchLogsClientConstructor is the constructor for the Cloudwatch Logs Insights client.
Functions ¶
func SetDebugLogger ¶
Types ¶
type CloudwatchLogsClient ¶
type CloudwatchLogsClient interface { StartQuery(ctx context.Context, params *cloudwatchlogs.StartQueryInput, optFns ...func(*cloudwatchlogs.Options)) (*cloudwatchlogs.StartQueryOutput, error) GetQueryResults(ctx context.Context, params *cloudwatchlogs.GetQueryResultsInput, optFns ...func(*cloudwatchlogs.Options)) (*cloudwatchlogs.GetQueryResultsOutput, error) StopQuery(ctx context.Context, params *cloudwatchlogs.StopQueryInput, optFns ...func(*cloudwatchlogs.Options)) (*cloudwatchlogs.StopQueryOutput, error) }
CloudwatchLogsClient is the interface for the Cloudwatch Logs Insights client.
func DefaultCloudwatchLogsClientConstructor ¶
func DefaultCloudwatchLogsClientConstructor(ctx context.Context, cfg *CloudwatchLogsInsightsConfig) (CloudwatchLogsClient, error)
DefaultCloudwatchLogsClientConstructor is the default constructor for the Cloudwatch Logs Insights client.
type CloudwatchLogsInsightsConfig ¶
type CloudwatchLogsInsightsConfig struct { OptFns []func(*cloudwatchlogs.Options) Timeout time.Duration // Default: 10s Polling time.Duration // Default: 100ms LogGroupNames []string Region string Limit *int32 Params url.Values }
CloudwatchLogsConfig is the configuration for the Cloudwatch Logs Insights.
func ParseDSN ¶
func ParseDSN(dsn string) (*CloudwatchLogsInsightsConfig, error)
ParseDSN is the function that constructs Config from the given DSN. For example, there is the following example. cloudwatch://?log_group_names=/aws/lambda/hoge,/aws/lambda/bar&limit=100&polling=1s&timeout=10s®ion=ap-northeast-1 In this case, the following Config is constructed.
CloudwatchLogsInsightsConfig{ OptFns: []func(*cloudwatchlogs.Options){}, Timeout: 10s, Polling: 1s, LogGroupNames: []string{"/aws/lambda/hoge", "/aws/lambda/bar"}, Region: "ap-northeast-1", Limit: 100, }
Also, you can specify log_group_name instead of log_group_names. However, you can not specify log_group_name and log_group_names at the same time.
func (*CloudwatchLogsInsightsConfig) String ¶
func (cfg *CloudwatchLogsInsightsConfig) String() string