db

package
v0.140.1 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBSanitizerConfig

type DBSanitizerConfig struct {
	SQLConfig        SQLConfig        `mapstructure:"sql"`
	RedisConfig      RedisConfig      `mapstructure:"redis"`
	ValkeyConfig     ValkeyConfig     `mapstructure:"valkey"`
	MemcachedConfig  MemcachedConfig  `mapstructure:"memcached"`
	MongoConfig      MongoConfig      `mapstructure:"mongo"`
	OpenSearchConfig OpenSearchConfig `mapstructure:"opensearch"`
	ESConfig         ESConfig         `mapstructure:"es"`
}

type ESConfig

type ESConfig struct {
	Enabled bool `mapstructure:"enabled"`

	// Attributes specifies which attribute keys to apply Elasticsearch sanitization to.
	// If empty, Elasticsearch sanitization is applied to all string values in log bodies
	// but not to span/metric attributes
	Attributes []string `mapstructure:"attributes"`
}

type MemcachedConfig

type MemcachedConfig struct {
	Enabled bool `mapstructure:"enabled"`

	// Attributes specifies which attribute keys to apply Memcached sanitization to.
	// If empty, Memcached sanitization is applied to all string values in log bodies
	// but not to span/metric attributes
	Attributes []string `mapstructure:"attributes"`
}

type MongoConfig

type MongoConfig struct {
	Enabled bool `mapstructure:"enabled"`

	// Attributes specifies which attribute keys to apply MongoDB sanitization to.
	// If empty, MongoDB sanitization is applied to all string values in log bodies
	// but not to span/metric attributes
	Attributes []string `mapstructure:"attributes"`
}

type Obfuscator

type Obfuscator struct {
	// contains filtered or unexported fields
}

func NewObfuscator

func NewObfuscator(cfg DBSanitizerConfig) *Obfuscator

func (*Obfuscator) HasObfuscators added in v0.139.0

func (o *Obfuscator) HasObfuscators() bool

func (*Obfuscator) HasSpecificAttributes

func (o *Obfuscator) HasSpecificAttributes() bool

func (*Obfuscator) Obfuscate

func (o *Obfuscator) Obfuscate(s string) (string, error)

func (*Obfuscator) ObfuscateAttribute

func (o *Obfuscator) ObfuscateAttribute(attributeValue, attributeKey string) (string, error)

type OpenSearchConfig

type OpenSearchConfig struct {
	Enabled bool `mapstructure:"enabled"`

	// Attributes specifies which attribute keys to apply OpenSearch sanitization to.
	// If empty, OpenSearch sanitization is applied to all string values in log bodies
	// but not to span/metric attributes
	Attributes []string `mapstructure:"attributes"`
}

type RedisConfig

type RedisConfig struct {
	Enabled bool `mapstructure:"enabled"`

	// Attributes specifies which attribute keys to apply Redis sanitization to.
	// If empty, Redis sanitization is applied to all string values in log bodies
	// but not to span/metric attributes
	Attributes []string `mapstructure:"attributes"`
}

type SQLConfig

type SQLConfig struct {
	Enabled bool `mapstructure:"enabled"`

	// Attributes specifies which attribute keys to apply SQL sanitization to.
	// If empty, SQL sanitization is applied to all string values in log bodies
	// but not to span/metric attributes
	Attributes []string `mapstructure:"attributes"`
}

type ValkeyConfig

type ValkeyConfig struct {
	Enabled bool `mapstructure:"enabled"`

	// Attributes specifies which attribute keys to apply Valkey sanitization to.
	// If empty, Valkey sanitization is applied to all string values in log bodies
	// but not to span/metric attributes
	Attributes []string `mapstructure:"attributes"`
}

Jump to

Keyboard shortcuts

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