Documentation ¶
Overview ¶
Package secrets provides a synchronizable set of keys backed by a key-value store.
Index ¶
- Constants
- func NewID(n int) []byte
- func NewRotation(callback Callback, withOptions ...Option) (err error)
- type Callback
- type Option
- func WithDefaultEntropySizeOf32() Option
- func WithDefaultExpiryOfOneWeek() Option
- func WithDefaultIDSizeOfSix() Option
- func WithDefaultLogger() Option
- func WithDefaultRotationWindow() Option
- func WithEntropySize(length int) Option
- func WithExpiry(d time.Duration) Option
- func WithIDSize(length int) Option
- func WithLogger(logger *slog.Logger) Option
- func WithRotationWindow(d time.Duration) Option
- type Rotation
- type Secret
- type Snapshot
Constants ¶
View Source
const ( UniqueIdentifierCharacterSet = "abcdefghijklmnopqrstuvwxyz" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" VisuallyUnambiguousLowerCaseCharacterSet = `abcdefhijkmnoprstwxy34` VisuallyUnambiguousCharacterSet = VisuallyUnambiguousLowerCaseCharacterSet + `ABCDEFHIJKMNOPRSTWXY` )
Variables ¶
This section is empty.
Functions ¶
func NewID ¶
FastRandom is inspired by Ketan Parmar's work:
- https://github.com/kpbird/golang_random_string/blob/master/main.go - https://kpbird.medium.com/golang-generate-fixed-size-random-string-dd6dbd5e63c0
func NewRotation ¶
Types ¶
type Option ¶
type Option func(*options) error
func WithDefaultEntropySizeOf32 ¶
func WithDefaultEntropySizeOf32() Option
func WithDefaultExpiryOfOneWeek ¶
func WithDefaultExpiryOfOneWeek() Option
func WithDefaultIDSizeOfSix ¶
func WithDefaultIDSizeOfSix() Option
func WithDefaultLogger ¶
func WithDefaultLogger() Option
func WithDefaultRotationWindow ¶
func WithDefaultRotationWindow() Option
func WithEntropySize ¶
func WithExpiry ¶
func WithIDSize ¶
func WithLogger ¶
func WithRotationWindow ¶
Click to show internal directories.
Click to hide internal directories.