redaction

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package redaction scrubs secrets from content on the way into the store.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func KindCounts

func KindCounts(hits []Hit) map[string]int

func Kinds

func Kinds() []string

Types

type Config

type Config struct {
	BuiltinKinds []string
	Custom       []CustomPattern
}

func DefaultConfig

func DefaultConfig() Config

type CustomPattern

type CustomPattern struct {
	Kind    string
	Pattern string
}

type Hit

type Hit struct {
	Kind  string
	Start int
	End   int
}

type Redactor

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

func New

func New(cfg Config) (*Redactor, error)

func (*Redactor) Scrub

func (r *Redactor) Scrub(s string) (string, []Hit)

A nil receiver is a no-op that returns the input unchanged.

Jump to

Keyboard shortcuts

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