Documentation ¶
Overview ¶
Package httpCertificate provides a HTTP client to an external certificate service that can respond to HTTP requests defined here.
Index ¶
- Variables
- type Client
- func (c Client) ACMEChallenge(fqdn string) (ac *certificate.ACMEChallenge, err error)
- func (c Client) ACMEChallenges(start string, limit int) (page *certificate.ACMEChallengesPage, err error)
- func (c Client) ACMEUser() (u *certificate.ACMEUser, err error)
- func (c Client) Certificate(fqdn string) (crt *certificate.Certificate, err error)
- func (c Client) Certificates(start string, limit int) (page *certificate.CertificatesPage, err error)
- func (c Client) CertificatesInfoByExpiry(since time.Time, start string, limit int) (page *certificate.InfosPage, err error)
- func (c Client) DeleteACMEChallenge(fqdn string) (ac *certificate.ACMEChallenge, err error)
- func (c Client) DeleteCertificate(fqdn string) (crt *certificate.Certificate, err error)
- func (c Client) IsCertificateBeingObtained(fqdn string) (yes bool, err error)
- func (c Client) ObtainCertificate(fqdn string) (crt *certificate.Certificate, err error)
- func (c Client) RegisterACMEUser(directoryURL, email string) (u *certificate.ACMEUser, err error)
- func (c Client) UpdateACMEChallenge(fqdn string, o *certificate.ACMEChallengeOptions) (ac *certificate.ACMEChallenge, err error)
- func (c Client) UpdateCertificate(fqdn string, o *certificate.Options) (crt *certificate.Certificate, err error)
- type IsCertificateBeingObtainedResponse
- type ObtainCertificateRequest
- type RegisterACMEUserRequest
Constants ¶
This section is empty.
Variables ¶
var ( ErrCertificateNotFound = errorRegistry.MustAddMessageError(1000, "Certificate Not Found") ErrCertificateInvalid = errorRegistry.MustAddMessageError(1001, "Certificate Invalid") ErrFQDNMissing = errorRegistry.MustAddMessageError(1100, "FQDN Missing") ErrFQDNInvalid = errorRegistry.MustAddMessageError(1101, "FQDN Invalid") ErrFQDNExists = errorRegistry.MustAddMessageError(1102, "FQDN Exists") ErrACMEUserNotFound = errorRegistry.MustAddMessageError(1200, "ACME User Not Found") ErrACMEUserEmailInvalid = errorRegistry.MustAddMessageError(1201, "ACME User Email Invalid") ErrACMEChallengeNotFound = errorRegistry.MustAddMessageError(1300, "ACME Challenge Not Found") )
Errors that are returned from the HTTP server.
Functions ¶
This section is empty.
Types ¶
type Client ¶ added in v0.5.2
type Client struct {
*apiClient.Client
}
Client implements gopherpit.com/gopherpit/services/certificates.Service interface.
func NewClient ¶ added in v0.5.2
func NewClient(c *apiClient.Client) *Client
NewClient creates a new Client.
func (Client) ACMEChallenge ¶ added in v0.5.2
func (c Client) ACMEChallenge(fqdn string) (ac *certificate.ACMEChallenge, err error)
ACMEChallenge returns an instance of ACMEChallenge for a FQDN by making a HTTP GET request to {Client.Endpoint}/acme/challenges/{fqdn}.
func (Client) ACMEChallenges ¶ added in v0.5.2
func (c Client) ACMEChallenges(start string, limit int) (page *certificate.ACMEChallengesPage, err error)
ACMEChallenges retrieves a paginated list of ACMEChallenge instances by making a HTTP GET request to {Client.Endpoint}/acme/challenges.
func (Client) ACMEUser ¶ added in v0.5.2
func (c Client) ACMEUser() (u *certificate.ACMEUser, err error)
ACMEUser returns ACME user with ACME authentication details by making a HTTP GET request to {Client.Endpoint}/acme/user.
func (Client) Certificate ¶ added in v0.5.2
func (c Client) Certificate(fqdn string) (crt *certificate.Certificate, err error)
Certificate retrieves an existing Certificate instance by making a HTTP GET request to {Client.Endpoint}/certificates/{fqdn}.
func (Client) Certificates ¶ added in v0.5.2
func (c Client) Certificates(start string, limit int) (page *certificate.CertificatesPage, err error)
Certificates retrieves a paginated list of Certificate instances ordered by FQDN, by making a HTTP GET request to {Client.Endpoint}/certificates.
func (Client) CertificatesInfoByExpiry ¶ added in v0.5.2
func (c Client) CertificatesInfoByExpiry(since time.Time, start string, limit int) (page *certificate.InfosPage, err error)
CertificatesInfoByExpiry retrieves a paginated list of Info instances ordered by expiration time by making a HTTP GET request to {Client.Endpoint}/certificates-info-by-expiry.
func (Client) DeleteACMEChallenge ¶ added in v0.5.2
func (c Client) DeleteACMEChallenge(fqdn string) (ac *certificate.ACMEChallenge, err error)
DeleteACMEChallenge deletes an existing ACMEChallenge for a provided FQDN and returns it by making a HTTP DELETE request to {Client.Endpoint}/acme/challenges/{fqdn}.
func (Client) DeleteCertificate ¶ added in v0.5.2
func (c Client) DeleteCertificate(fqdn string) (crt *certificate.Certificate, err error)
DeleteCertificate deletes an existing Certificate by making a HTTP DELETE request to {Client.Endpoint}/certificates/{fqdn}.
func (Client) IsCertificateBeingObtained ¶ added in v0.5.2
IsCertificateBeingObtained tests if certificate is being obtained currently by making a HTTP GET request to {Client.Endpoint}/certificates/{fqdn}/being-obtained. Expected response body is a JSON-encoded instance of IsCertificateBeingObtainedResponse.
func (Client) ObtainCertificate ¶ added in v0.5.2
func (c Client) ObtainCertificate(fqdn string) (crt *certificate.Certificate, err error)
ObtainCertificate obtains a new certificate from ACME provider by making a HTTP POST request to {Client.Endpoint}/certificates. Post body is a JSON-encoded ObtainCertificateRequest instance.
func (Client) RegisterACMEUser ¶ added in v0.5.2
func (c Client) RegisterACMEUser(directoryURL, email string) (u *certificate.ACMEUser, err error)
RegisterACMEUser registers and saves ACME user authentication data by making a HTTP POST request to {Client.Endpoint}/acme/user. Post body is a JSON-encoded RegisterACMEUserRequest instance.
func (Client) UpdateACMEChallenge ¶ added in v0.5.2
func (c Client) UpdateACMEChallenge(fqdn string, o *certificate.ACMEChallengeOptions) (ac *certificate.ACMEChallenge, err error)
UpdateACMEChallenge alters the fields of existing ACMEChallenge by making a HTTP POST request to {Client.Endpoint}/acme/challenges/{fqdn}. Post body is a JSON-encoded certificate.ACMEChallengeOptions instance.
func (Client) UpdateCertificate ¶ added in v0.5.2
func (c Client) UpdateCertificate(fqdn string, o *certificate.Options) (crt *certificate.Certificate, err error)
UpdateCertificate changes the data of an existing Certificate by making a HTTP POST request to {Client.Endpoint}/certificates/{fqdn}. Post body is a JSON-encoded certificate.Options instance.
type IsCertificateBeingObtainedResponse ¶
type IsCertificateBeingObtainedResponse struct {
Yes bool `json:"yes"`
}
IsCertificateBeingObtainedResponse is expected structure of JSON-encoded response body for IsCertificateBeingObtained HTTP request.
type ObtainCertificateRequest ¶
type ObtainCertificateRequest struct {
FQDN string `json:"fqdn"`
}
ObtainCertificateRequest is a structure that is passed as JSON-encoded body to ObtainCertificate HTTP request.
type RegisterACMEUserRequest ¶
type RegisterACMEUserRequest struct { DirectoryURL string `json:"directory-url"` Email string `json:"email"` }
RegisterACMEUserRequest is a structure that is passed as JSON-encoded body to RegisterACMEUser HTTP request.