httpCertificate

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2017 License: BSD-3-Clause Imports: 7 Imported by: 1

Documentation

Overview

Package httpCertificate provides a Service that is a HTTP client to an external certificate service that can respond to HTTP requests defined here.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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.

type Service

type Service struct {
	Client *apiClient.Client
}

Service implements gopherpit.com/gopherpit/services/certificates.Service interface.

func NewService added in v0.3.1

func NewService(c *apiClient.Client) *Service

NewService creates a new Service and injects certificate.ErrorRegistry in the API Client.

func (Service) ACMEChallenge

func (s Service) ACMEChallenge(fqdn string) (c *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 (Service) ACMEChallenges

func (s Service) 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 (Service) ACMEUser

func (s Service) 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 (Service) Certificate

func (s Service) Certificate(fqdn string) (c *certificate.Certificate, err error)

Certificate retrieves an existing Certificate instance by making a HTTP GET request to {Client.Endpoint}/certificates/{fqdn}.

func (Service) Certificates

func (s Service) 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 (Service) CertificatesInfoByExpiry

func (s Service) 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 (Service) DeleteACMEChallenge

func (s Service) DeleteACMEChallenge(fqdn string) (c *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 (Service) DeleteCertificate

func (s Service) DeleteCertificate(fqdn string) (c *certificate.Certificate, err error)

DeleteCertificate deletes an existing Certificate by making a HTTP DELETE request to {Client.Endpoint}/certificates/{fqdn}.

func (Service) IsCertificateBeingObtained

func (s Service) IsCertificateBeingObtained(fqdn string) (yes bool, err error)

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 (Service) ObtainCertificate

func (s Service) ObtainCertificate(fqdn string) (c *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 (Service) RegisterACMEUser

func (s Service) 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 (Service) UpdateACMEChallenge

func (s Service) UpdateACMEChallenge(fqdn string, o *certificate.ACMEChallengeOptions) (c *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 (Service) UpdateCertificate

func (s Service) UpdateCertificate(fqdn string, o *certificate.Options) (c *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.

Jump to

Keyboard shortcuts

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