refresh

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

following the same pattern in of jwk lib https://github.com/lestrrat-go/jwx/blob/main/jwk/refresh.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AutoRefreshX

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

AutoRefreshX is the object taking care of refreshing tls secrets from secretsmanager can handle both Writer and Reader structs, due to the core.RefreshableInterface it runs a ticker which when triggered will run the machinery to fetch a new set of secrets and refresh the refreshable object handles the fetching of this object via mutex

func (*AutoRefreshX) Configure

func (af *AutoRefreshX) Configure(ctx context.Context, tlsConfig config.TLSConfigInterface, saslConfig config.SASLConfigInterface)

Configure allows to pass a new tls config to the autorefresh

func (*AutoRefreshX) Object

Object will return the refreshable object (will need to be casted to Writer or Reader)

func (*AutoRefreshX) Refresh

Refresh force a manual refresh of the secrets

func (*AutoRefreshX) Stats

func (af *AutoRefreshX) Stats() interface{}

Stats returns reader or writer stats (will need to be casted)

func (*AutoRefreshX) Stop

func (af *AutoRefreshX) Stop()

Stop sends a message on the shutdown channel which will bring the infinite loop to a halt

type AutoRefreshXConfigInterface added in v1.2.0

type AutoRefreshXConfigInterface interface {
	config.ConfigInterface
	GetMutexObj() *sync.RWMutex
}

AutoRefreshXConfigInterface is the refresh.AutoRefreshX config interface, embeds ConfigInterface

type AutoRefreshXInterface

type AutoRefreshXInterface interface {
	Configure(context.Context, config.TLSConfigInterface, config.SASLConfigInterface)
	Object(context.Context) (core.RefreshableInterface, error)
	Stats() interface{}
	Refresh(context.Context) (core.RefreshableInterface, error)
	Stop()
}

AutoRefreshXInterface is the interface for the autorefresh functionality

func NewAutoRefreshX

NewAutoRefreshX creates an object implementing AutoRefreshXInterface

Jump to

Keyboard shortcuts

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