Documentation ¶
Index ¶
- Constants
- Variables
- func CustomEndpoint(custom bool) attribute.KeyValue
- func DecomposeHTTPRequest(ctx context.Context, req *http.Request) (map[string]any, error)
- func DecomposeResponseHeaders(resp *http.Response) []attribute.KeyValue
- func MaskAWSAccessKey(field []byte) []byte
- func MaskAWSSecretKeys(in []byte)
- func MaskAWSSensitiveValues(field string) string
- func ReadTruncatedBody(reader *textproto.Reader, len int) (string, error)
- func RegisterLogger(ctx context.Context, logger Logger) context.Context
- func RequestHeaderAttributeKey(k string) attribute.Key
- func ResponseHeaderAttributeKey(k string) attribute.Key
- func SigningRegion(region string) attribute.KeyValue
- type HcLogger
- func (l HcLogger) Debug(ctx context.Context, msg string, fields ...map[string]any)
- func (l HcLogger) Info(ctx context.Context, msg string, fields ...map[string]any)
- func (l HcLogger) SetField(ctx context.Context, key string, value any) context.Context
- func (l HcLogger) SubLogger(ctx context.Context, name string) (context.Context, Logger)
- func (l HcLogger) Trace(ctx context.Context, msg string, fields ...map[string]any)
- func (l HcLogger) Warn(ctx context.Context, msg string, fields ...map[string]any)
- type Logger
- type NullLogger
- func (l NullLogger) Debug(ctx context.Context, msg string, fields ...map[string]any)
- func (l NullLogger) Info(ctx context.Context, msg string, fields ...map[string]any)
- func (l NullLogger) SetField(ctx context.Context, key string, value any) context.Context
- func (l NullLogger) SubLogger(ctx context.Context, name string) (context.Context, Logger)
- func (l NullLogger) Trace(ctx context.Context, msg string, fields ...map[string]any)
- func (l NullLogger) Warn(ctx context.Context, msg string, fields ...map[string]any)
- type RequestBodyLogger
- type ResponseBodyLogger
- type S3ObjectResponseBodyLogger
- type TfLogger
- func (l TfLogger) Debug(ctx context.Context, msg string, fields ...map[string]any)
- func (l TfLogger) Info(ctx context.Context, msg string, fields ...map[string]any)
- func (l TfLogger) SetField(ctx context.Context, key string, value any) context.Context
- func (l TfLogger) SubLogger(ctx context.Context, name string) (context.Context, Logger)
- func (l TfLogger) Trace(ctx context.Context, msg string, fields ...map[string]any)
- func (l TfLogger) Warn(ctx context.Context, msg string, fields ...map[string]any)
Constants ¶
View Source
const ( AwsSdkKey attribute.Key = "tf_aws.sdk" SigningRegionKey attribute.Key = "tf_aws.signing_region" CustomEndpointKey attribute.Key = "tf_aws.custom_endpoint" )
View Source
const (
MaxResponseBodyLen = 4096
)
Variables ¶
View Source
var UniqueIDRegex = regexp.MustCompile(`(A3T[A-Z0-9]` +
`|ABIA` +
`|ACCA` +
`|AGPA` +
`|AIDA` +
`|AIPA` +
`|AKIA` +
`|ANPA` +
`|ANVA` +
`|APKA` +
`|AROA` +
`|ASCA` +
`|ASIA` +
`)[A-Z0-9]{16,}`)
IAM Unique ID prefixes from https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-unique-ids
Functions ¶
func CustomEndpoint ¶
func DecomposeHTTPRequest ¶
func MaskAWSAccessKey ¶
func MaskAWSSecretKeys ¶
func MaskAWSSecretKeys(in []byte)
MaskAWSSecretKeys masks likely AWS secret access keys in the input. See https://aws.amazon.com/blogs/security/a-safer-way-to-distribute-aws-credentials-to-ec2/: "Find me 40-character, base-64 strings that don’t have any base 64 characters immediately before or after".
func MaskAWSSensitiveValues ¶
func SigningRegion ¶
Types ¶
type HcLogger ¶
type HcLogger struct{}
func NewHcLogger ¶
type Logger ¶
type Logger interface { Warn(ctx context.Context, msg string, fields ...map[string]any) Info(ctx context.Context, msg string, fields ...map[string]any) Debug(ctx context.Context, msg string, fields ...map[string]any) Trace(ctx context.Context, msg string, fields ...map[string]any) SetField(ctx context.Context, key string, value any) context.Context SubLogger(ctx context.Context, name string) (context.Context, Logger) }
func RetrieveLogger ¶
type NullLogger ¶
type NullLogger struct { }
type RequestBodyLogger ¶
type ResponseBodyLogger ¶
type S3ObjectResponseBodyLogger ¶
type S3ObjectResponseBodyLogger struct{}
Click to show internal directories.
Click to hide internal directories.