event

package
v0.0.0-...-fef9524 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MethodToOperation

func MethodToOperation(method string) string

MethodToOperation converts HTTP method to operation

func Redact

func Redact(payload string, sensitiveAttributes []string) string

Redact replaces sensitive attributes in the JSON payload with "***"

Types

type ResolveIDToNameFunc

type ResolveIDToNameFunc func(string) string

ResolveIDToNameFunc is the function to resolve the resource name from resource id

type Resolver

type Resolver struct {
	ResourceType string
	SucceedCodes []int
	// SensitiveAttributes is the attributes that need to be redacted
	SensitiveAttributes []string
	// ShouldResolveName indicates if the resource name should be resolved before delete, if true, need to resolve the resource name before delete
	ShouldResolveName bool
	// IDToNameFunc is used to resolve the resource name from resource id
	IDToNameFunc ResolveIDToNameFunc
	// ResourceIDPattern the URL pattern to match the resourceID
	ResourceIDPattern string
}

func (*Resolver) PreCheck

func (e *Resolver) PreCheck(ctx context.Context, url string, method string) (capture bool, resourceName string)

PreCheck check if the event should be captured and resolve the resource name if needed, if need to resolve the resource name, return the resource name

func (*Resolver) Resolve

func (e *Resolver) Resolve(ce *commonevent.Metadata, event *event.Event) error

Resolve ...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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