rotator

package
v1.12.4 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Assigner

type Assigner func(s string)

Assigner is a function that's called after the keys are rotated. Use it to set external dependencies.

type Rotator

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

Rotator is a struct that holds the keys and the function to call after the keys are rotated.

func New

func New(rotateFn Assigner, keyNames ...string) *Rotator

New creates a new Rotator instance. The rotateFn is called with the next key name when RotateKeys is called.

func (*Rotator) RotateKeys

func (r *Rotator) RotateKeys(ctx context.Context)

RotateKeys rotates the keys and calls the rotateFn with the next key name.

Jump to

Keyboard shortcuts

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