mgr

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2019 License: BSD-2-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultBefore = time.Hour * 72

DefaultBefore is used if no duration is provided for a Manager. This defaults to 72 hours.

View Source
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

func NewFromConfig(configPath string) (*Manager, error)

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) Load

func (m *Manager) Load() error

Load reads the certificate specs from the spec directory.

func (*Manager) Server

func (m *Manager) Server()

Server runs the Manager server.

func (*Manager) UnmarshallYAML

func (m *Manager) UnmarshallYAML(unmarshall func(interface{}) error) error

UnmarshallYAML update a Manager instance via deserializing the given yaml

Jump to

Keyboard shortcuts

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