Documentation
¶
Overview ¶
Package obsx 定义观测接口和脱敏工具,不绑定具体日志或指标 SDK。
Index ¶
- type Field
- type Logger
- type Metrics
- type NoopLogger
- type NoopMetrics
- type NoopSpan
- type NoopTracer
- type Sanitizer
- type SecretString
- func (s SecretString) Format(state fmt.State, verb rune)
- func (s SecretString) GoString() string
- func (s SecretString) IsZero() bool
- func (s SecretString) MarshalJSON() ([]byte, error)
- func (s SecretString) Reveal() string
- func (s SecretString) Sanitize() string
- func (s SecretString) String() string
- type Span
- type Tracer
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NoopLogger ¶
type NoopLogger struct{}
type NoopMetrics ¶
type NoopMetrics struct{}
type NoopTracer ¶
type NoopTracer struct{}
type Sanitizer ¶
type Sanitizer interface{ Sanitize() string }
Sanitizer 定义敏感数据脱敏接口。 实现应确保 Sanitize() 返回脱敏后的安全表示,不泄露原始值。
type SecretString ¶
type SecretString string
func NewSecretString ¶
func NewSecretString(value string) SecretString
Example ¶
package main
import (
"github.com/ZoneCNH/kernel/obsx"
)
func main() {
secret := obsx.NewSecretString("token")
_ = secret.Sanitize()
}
Output:
func (SecretString) Format ¶ added in v0.8.0
func (s SecretString) Format(state fmt.State, verb rune)
func (SecretString) GoString ¶ added in v0.8.0
func (s SecretString) GoString() string
func (SecretString) IsZero ¶
func (s SecretString) IsZero() bool
func (SecretString) MarshalJSON ¶
func (s SecretString) MarshalJSON() ([]byte, error)
func (SecretString) Reveal ¶
func (s SecretString) Reveal() string
func (SecretString) Sanitize ¶
func (s SecretString) Sanitize() string
func (SecretString) String ¶
func (s SecretString) String() string
Click to show internal directories.
Click to hide internal directories.