config

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 9, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCurrentConfig

func GetCurrentConfig() *types.ConfigFile

func ReadAndStoreConfig

func ReadAndStoreConfig(fsys fs.FS, path string) error

func ReadConfigFromFS

func ReadConfigFromFS(fsys fs.FS, path string) (*types.ConfigFile, error)

func StoreConfig

func StoreConfig(cfg *types.ConfigFile)

func StoreCurrentSource

func StoreCurrentSource(source *SpiffeConnectorSource)

Types

type DynamicSource

type DynamicSource struct{}

DynamicSource represents the most up-to-date SVID / Trust bundle we have from the most recently loaded source config file

var (
	CurrentSource DynamicSource
)

func (DynamicSource) GetX509BundleForTrustDomain

func (d DynamicSource) GetX509BundleForTrustDomain(trustDomain spiffeid.TrustDomain) (*x509bundle.Bundle, error)

func (DynamicSource) GetX509SVID

func (d DynamicSource) GetX509SVID() (*x509svid.SVID, error)

type SpiffeConnectorSource

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

SpiffeConnectorSource implements x509svid.Source and x509bundle.Source by either reading files or communicating with the SPIRE workload API.

func ConstructSpiffeConnectorSource

func ConstructSpiffeConnectorSource(ctx context.Context, cancel context.CancelFunc, config *types.SpiffeConfig) (*SpiffeConnectorSource, error)

ConstructSpiffeConnectorSource constructs a new SPIFFE Connector source ready to become the current source. When disposing of the source be sure to cancel the Context, as this will clean up the fsnotify watchers.

func GetCurrentSource

func GetCurrentSource() *SpiffeConnectorSource

func (*SpiffeConnectorSource) Cancel

func (s *SpiffeConnectorSource) Cancel()

func (*SpiffeConnectorSource) GetX509BundleForTrustDomain

func (s *SpiffeConnectorSource) GetX509BundleForTrustDomain(trustDomain spiffeid.TrustDomain) (*x509bundle.Bundle, error)

func (*SpiffeConnectorSource) GetX509SVID

func (s *SpiffeConnectorSource) GetX509SVID() (*x509svid.SVID, error)

type Watcher

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

Watcher is an opinionated fsnotify.Watcher that is designed to watch Kubernetes config maps and perform actions on change.

func NewWatcher

func NewWatcher(ctx context.Context, filePath string, actions ...func() error) (*Watcher, error)

func (*Watcher) Notify

func (w *Watcher) Notify()

Notify manually runs all actions in a watcher

Jump to

Keyboard shortcuts

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