Help us shape the future of Go! Take the 2026 Go Developer Survey

masking

package
v0.1.1392 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package masking is Settings → Privacy's masking as the gateway's masker (gwmw.Masker): secrets, personal data and the user's own words go to a vendor as placeholders (internal/redact), and come back as they were. It reads the settings on each call. plugins/redact serves it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Preview added in v0.1.1317

func Preview(s string) (out string, hits []gwmw.Hit, off bool)

Preview is s as the settings would send it, and what was found in it, with nothing remembered: no placeholder is kept for the replies, and none of its values is masked again later as one seen before. With masking off it is as masking would be turned on (Off says so), so the user can try it first.

func Wanted

func Wanted(st settings.Settings) bool

Wanted says settings st ask for anything to be masked.

Types

type Masker

type Masker struct{}

Masker masks as the settings say, read on each call.

func (Masker) JSON

func (Masker) JSON(body []byte) ([]byte, int)

func (Masker) JSONHits added in v0.1.1305

func (Masker) JSONHits(body []byte) ([]byte, []gwmw.Hit)

JSONHits is JSON, with what it masked (gwmw.Teller).

func (Masker) Restore

func (Masker) Restore(s string, escaped bool) string

func (Masker) Text

func (Masker) Text(s string) (string, int)

func (Masker) TextHits added in v0.1.1305

func (Masker) TextHits(s string) (string, []gwmw.Hit)

TextHits is Text, with what it masked.

func (Masker) Value added in v0.1.1305

func (Masker) Value(p string) (string, bool)

func (Masker) Writer

func (Masker) Writer(w http.ResponseWriter) (http.ResponseWriter, func())

Jump to

Keyboard shortcuts

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