micro/api/server/acme/autocert/autocert.go
Jake Sanders 107b7419b7 Start abstracting away the ACME provider (#830)
* Start abstracting away the ACME provider

* Move ACME to interface with sub-package implementations

* Addressing comments

* Library -> Provider

* Missed a couple of Library -> Provider

* One more Library -> Provider

* remove constants
2019-10-09 16:42:05 +01:00

23 lines
584 B
Go

// Package autocert is the ACME interpreter from golang.org/x/crypto/acme/autocert
package autocert
import (
"net"
"github.com/micro/go-micro/api/server/acme"
"golang.org/x/crypto/acme/autocert"
)
// autoCertACME is the ACME provider from golang.org/x/crypto/acme/autocert
type autocertProvider struct{}
// NewListener implements acme.Provider
func (a *autocertProvider) NewListener(ACMEHosts ...string) (net.Listener, error) {
return autocert.NewListener(ACMEHosts...), nil
}
// New returns an autocert acme.Provider
func New() acme.Provider {
return &autocertProvider{}
}