pii

package module
v0.0.0-...-e0908da Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2023 License: MIT Imports: 9 Imported by: 1

README

pii

CI Status

PII/GDPR components library in Go.

Warning: Unstable API!

This project is work in progress and the public API can change until the v1.0.0 is released.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AESAnonymizer

type AESAnonymizer[K any] struct {
	// contains filtered or unexported fields
}

func NewAESAnonymizer

func NewAESAnonymizer[K any](secretProvider SecretProvider[K]) AESAnonymizer[K]

func (AESAnonymizer[K]) AnonymizeString

func (a AESAnonymizer[K]) AnonymizeString(ctx context.Context, key K, value string) (string, error)

func (AESAnonymizer[K]) DeanonymizeString

func (a AESAnonymizer[K]) DeanonymizeString(ctx context.Context, key K, value string) (string, error)

type MaskingAnonymizer

type MaskingAnonymizer[T any] struct{}

MaskingAnonymizer masks struct fields, losing the original value in progress. This might be useful for things like avoiding logging of sensitive information.

func NewMaskingAnonymizer

func NewMaskingAnonymizer[T any](mask T) MaskingAnonymizer[T]

func (MaskingAnonymizer[T]) AnonymizeString

func (m MaskingAnonymizer[T]) AnonymizeString(_ context.Context, key T, value string) (string, error)

func (MaskingAnonymizer[T]) DeanonymizeString

func (m MaskingAnonymizer[T]) DeanonymizeString(_ context.Context, _ T, value string) (string, error)

type SecretProvider

type SecretProvider[K any] interface {
	SecretForKey(ctx context.Context, key K) ([]byte, error)
}

type StringAnonymizer

type StringAnonymizer[K any] interface {
	AnonymizeString(ctx context.Context, key K, value string) (string, error)
	DeanonymizeString(ctx context.Context, key K, value string) (string, error)
}

StringAnonymizer anonymizes and deanonymizes strings. K is the type of key used to anonymize the string.

type StructAnonymizer

type StructAnonymizer[K any, T any] struct {
	// contains filtered or unexported fields
}

StructAnonymizer anonymizes and deanonymizes structs. K is the type of key used to anonymize the struct. T is the type of struct to be anonymized.

func NewStructAnonymizer

func NewStructAnonymizer[K any, T any](
	stringAnonymizer StringAnonymizer[K],
) StructAnonymizer[K, T]

func (StructAnonymizer[K, T]) Anonymize

func (a StructAnonymizer[K, T]) Anonymize(ctx context.Context, key K, data T) (T, error)

func (StructAnonymizer[K, T]) Deanonymize

func (a StructAnonymizer[K, T]) Deanonymize(ctx context.Context, key K, data T) (T, error)

Jump to

Keyboard shortcuts

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