secret

package
v0.14.0-beta1 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Secret

type Secret[T any] struct {
	// contains filtered or unexported fields
}

Secret define a wrapper of T to prevent unwanted exposure of a secret (in logs for example).

func New

func New[T any](secret T) Secret[T]

New wrapps the given secret in Secret type and returns it.

func (Secret[T]) ExposeSecret

func (s Secret[T]) ExposeSecret() T

ExposeSecret returns the underlying secret. It is best practice to never store the secret and expose it only when needed.

func (*Secret[T]) Scan

func (s *Secret[T]) Scan(src any) error

Scan implements sql.Scanner.

func (Secret[T]) String

func (s Secret[T]) String() string

String implements fmt.Stringer.

Jump to

Keyboard shortcuts

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