From a4d8c0e6b97d31c67f99b8dc55f7e70596ed5fee Mon Sep 17 00:00:00 2001 From: xenolf Date: Mon, 15 Feb 2016 03:59:43 +0100 Subject: [PATCH] Fix a couple of misspelled words and lint errors. --- acme/client.go | 4 ++-- acme/dns_challenge_cloudflare.go | 18 ++++++++++-------- acme/dns_challenge_route53.go | 2 +- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/acme/client.go b/acme/client.go index 35dbcd64..be9843e2 100644 --- a/acme/client.go +++ b/acme/client.go @@ -316,7 +316,7 @@ func (c *Client) RenewCertificate(cert CertificateResource, bundle bool) (Certif links := parseLinks(resp.Header["Link"]) issuerCert, err := c.getIssuerCertificate(links["up"]) if err != nil { - // If we fail to aquire the issuer cert, return the issued certificate - do not fail. + // If we fail to acquire the issuer cert, return the issued certificate - do not fail. logf("[ERROR][%s] acme: Could not bundle issuer certificate: %v", cert.Domain, err) } else { // Success - append the issuer cert to the issued cert. @@ -518,7 +518,7 @@ func (c *Client) requestCertificate(authz []authorizationResource, bundle bool, links := parseLinks(resp.Header["Link"]) issuerCert, err := c.getIssuerCertificate(links["up"]) if err != nil { - // If we fail to aquire the issuer cert, return the issued certificate - do not fail. + // If we fail to acquire the issuer cert, return the issued certificate - do not fail. logf("[WARNING][%s] acme: Could not bundle issuer certificate: %v", commonName.Domain, err) } else { // Success - append the issuer cert to the issued cert. diff --git a/acme/dns_challenge_cloudflare.go b/acme/dns_challenge_cloudflare.go index f55c28bd..b5bf6d1f 100644 --- a/acme/dns_challenge_cloudflare.go +++ b/acme/dns_challenge_cloudflare.go @@ -11,7 +11,9 @@ import ( "time" ) -const CloudFlareApiURL = "https://api.cloudflare.com/client/v4" +// CloudFlareAPIURL represents the API endpoint to call. +// TODO: Unexport? +const CloudFlareAPIURL = "https://api.cloudflare.com/client/v4" // DNSProviderCloudFlare is an implementation of the DNSProvider interface type DNSProviderCloudFlare struct { @@ -141,20 +143,20 @@ func (c *DNSProviderCloudFlare) findTxtRecord(fqdn string) (*cloudFlareRecord, e } func (c *DNSProviderCloudFlare) makeRequest(method, uri string, body io.Reader) (json.RawMessage, error) { - // ApiError contains error details for failed requests - type ApiError struct { + // APIError contains error details for failed requests + type APIError struct { Code int `json:"code,omitempty"` Message string `json:"message,omitempty"` } - // ApiResponse represents a response from CloudFlare API - type ApiResponse struct { + // APIResponse represents a response from CloudFlare API + type APIResponse struct { Success bool `json:"success"` - Errors []*ApiError `json:"errors"` + Errors []*APIError `json:"errors"` Result json.RawMessage `json:"result"` } - req, err := http.NewRequest(method, fmt.Sprintf("%s%s", CloudFlareApiURL, uri), body) + req, err := http.NewRequest(method, fmt.Sprintf("%s%s", CloudFlareAPIURL, uri), body) if err != nil { return nil, err } @@ -171,7 +173,7 @@ func (c *DNSProviderCloudFlare) makeRequest(method, uri string, body io.Reader) defer resp.Body.Close() - var r ApiResponse + var r APIResponse err = json.NewDecoder(resp.Body).Decode(&r) if err != nil { return nil, err diff --git a/acme/dns_challenge_route53.go b/acme/dns_challenge_route53.go index 68a05b0c..43e42dab 100644 --- a/acme/dns_challenge_route53.go +++ b/acme/dns_challenge_route53.go @@ -16,7 +16,7 @@ type DNSProviderRoute53 struct { // NewDNSProviderRoute53 returns a DNSProviderRoute53 instance with a configured route53 client. // Authentication is either done using the passed credentials or - when empty - falling back to -// the customary AWS credential mechanisms, including the file refernced by $AWS_CREDENTIAL_FILE +// the customary AWS credential mechanisms, including the file referenced by $AWS_CREDENTIAL_FILE // (defaulting to $HOME/.aws/credentials) optionally scoped to $AWS_PROFILE, credentials // supplied by the environment variables AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY [ + AWS_SECURITY_TOKEN ], // and finally credentials available via the EC2 instance metadata service.