certupdater

package
v0.0.0-...-be26699 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2015 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCertificateUpdater

func NewCertificateUpdater(addressWatcher AddressWatcher, getter StateServingInfoGetter,
	configGetter EnvironConfigGetter, setter StateServingInfoSetter, certChanged chan params.StateServingInfo,
) worker.Worker

NewCertificateUpdater returns a worker.Worker that watches for changes to machine addresses and then generates a new state server certificate with those addresses in the certificate's SAN value.

Types

type AddressWatcher

type AddressWatcher interface {
	WatchAddresses() state.NotifyWatcher
	Addresses() (addresses []network.Address)
}

AddressWatcher is an interface that is provided to NewCertificateUpdater which can be used to watch for machine address changes.

type CertificateUpdater

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

CertificateUpdater is responsible for generating state server certificates.

In practice, CertificateUpdater is used by a state server's machine agent to watch that server's machines addresses in state, and write a new certificate to the agent's config file.

func (*CertificateUpdater) Handle

func (c *CertificateUpdater) Handle(done <-chan struct{}) error

Handle is defined on the NotifyWatchHandler interface.

func (*CertificateUpdater) SetUp

SetUp is defined on the NotifyWatchHandler interface.

func (*CertificateUpdater) TearDown

func (c *CertificateUpdater) TearDown() error

TearDown is defined on the NotifyWatchHandler interface.

type EnvironConfigGetter

type EnvironConfigGetter interface {
	EnvironConfig() (*config.Config, error)
}

EnvironConfigGetter is an interface that is provided to NewCertificateUpdater which can be used to get environment config.

type StateServingInfoGetter

type StateServingInfoGetter interface {
	StateServingInfo() (params.StateServingInfo, bool)
}

StateServingInfoGetter is an interface that is provided to NewCertificateUpdater whose StateServingInfo method will be invoked to get state serving info.

type StateServingInfoSetter

type StateServingInfoSetter func(info params.StateServingInfo, done <-chan struct{}) error

StateServingInfoSetter defines a function that is called to set a StateServingInfo value with a newly generated certificate.

Jump to

Keyboard shortcuts

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