service

package
v0.0.0-...-71972d2 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2016 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrGeneratingCert is returned when there's a failure generating a new certificate.
	ErrGeneratingCert = errors.New("an error occurred while generating the certificate, please check the log for more information")
	// ErrTOSNotAccepted is returns if the acceptTOS was set to false and the account has never accepted the TOS.
	ErrTOSNotAccepted = errors.New("Let's encrypt terms of service was not accepted")
)
View Source
var ErrLockExists = errors.New("was unable to grab a lock, lock already exists")

ErrLockExists is returned if unable to grab a lock.

Functions

This section is empty.

Types

type Service

type Service struct {
	// CertChan is the channel where the service sends out the certificate at the
	// retrieval and at the renewal time.
	CertChan chan *legoetcd.Cert
	// StopChan if closed will stop the service.
	StopChan chan struct{}
	// KeyType is the crypto type for the key, Supported: rsa2048, rsa4096,
	// rsa8192, ec256, ec384.
	KeyType acme.KeyType
	// NoBundle disables bundling of the issuer certificate along with the
	// domain's certificate.
	NoBundle bool
	// contains filtered or unexported fields
}

Service represents a lego-etcd service that is able to manage the certificate for the given domains by generating certificates through Let's encrypt, storing them in etcd and renew them as well. The service is fully managed.

func New

func New(etcdConfig client.Config, acmeServer, email string, domains []string, csrFile string, acceptTOS, generatePEM bool, dns, webroot string) *Service

New returns a new service, the default keyType is RSA2048 but you may change by setting the KeyType on the returned service. By default, the service will generate a bundled certificate (containing the issuer certificate and your certificate). To disable bundling, set `NoBundle` to true.

func (*Service) Lock

func (s *Service) Lock(c client.Client, path string) error

Lock places a lock at the provided path in etcd.

func (*Service) Run

func (s *Service) Run() error

Run starts the certificate loop

func (*Service) Unlock

func (s *Service) Unlock(c client.Client, path string) error

Unlock removes the lock at the provided path from etcd

func (*Service) WaitForLockDeletion

func (s *Service) WaitForLockDeletion(c client.Client, path string) error

WaitForLockDeletion is a blocking call that will wait until the lock is unlocked.

Jump to

Keyboard shortcuts

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