Documentation ¶
Index ¶
Constants ¶
const DefaultBefore = time.Hour * 72
DefaultBefore is used if no duration is provided for a Manager. This defaults to 72 hours.
const DefaultInterval = time.Hour
DefaultInterval is used if no duration is provided for a Manager. This defaults to one hour.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct { // Dir is the directory containing the certificate specs. Dir string `yaml:"certspecs"` // DefaultRemote is used as the remote CA server when no // remote is specified. DefaultRemote string `yaml:"default_remote"` // ServiceManager is the service manager used to restart a // service. ServiceManager string `yaml:"service_manager"` // Before is how long before the cert expires to start // attempting to renew it. Before time.Duration `yaml:"before"` // Interval is how often to update the NextExpires metric. Interval time.Duration `yaml:"interval"` // Certs contains the list of certificates to manage. Certs []*cert.Spec `yaml:",omitempty"` // contains filtered or unexported fields }
The Manager structure contains the certificates to be managed. A manager needs to be constructed with one of the New functions, and should not be constructed by hand.
func New ¶
func New(dir string, remote string, svcmgr string, before time.Duration, interval time.Duration) (*Manager, error)
New constructs a new Manager from parameters. It is intended to be used in conjunction with command line flags.
func NewFromConfig ¶
NewFromConfig loads a new Manager from a config file. This does not load the certificate specs; to do that, see Load(). If the file looks like a JSON file, it will attempt to load it as a JSON file; otherwise, it assumes that it is a YAML file.
func (*Manager) CheckCerts ¶
func (m *Manager) CheckCerts()
CheckCerts verifies that certificates and keys are present, and refreshes anything needed, while updating the bookkeeping for when next to wake up.
func (*Manager) UnmarshallYAML ¶
UnmarshallYAML update a Manager instance via deserializing the given yaml