cert

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithAPIEndpoint

func WithAPIEndpoint(apiEndpoint string) func(*client)

WithAPIEndpoint returns a client with the API Endpoint field populated.

func WithDownloadEndpoint

func WithDownloadEndpoint(downloadEndpoint string) func(*client)

WithDownloadEndpoint returns a client with the Download Endpoint field populated.

func WithForm

func WithForm(form string) func(*client)

WithForm returns a client with the Form field populated.

func WithHTTPClient

func WithHTTPClient(hClient http.Client) func(*client)

WithHTTPClient returns a client with the API Endpoint field populated.

func WithToken

func WithToken(token string) func(*client)

WithToken returns a client with the Token field populated.

Types

type Client

type Client interface {
	// PostCertificate sends a POST request to cert to create a new certificate and returns the GUID.
	PostCertificate(ctx context.Context, log logr.Logger, csrBytes []byte) (string, error)

	// DownloadCertificate downloads a certificate from the Cert API.
	DownloadCertificate(ctx context.Context, log logr.Logger, guid string) (DownloadCertificateResponse, error)
}

Client is the interface to interact with Cert API service.

func NewClient

func NewClient(options ...func(*client)) Client

NewClient returns a new client.

type DownloadCertificateResponse

type DownloadCertificateResponse struct {
	Data string `json:"data"`
}

DownloadCertificateResponse represents the response received when downloading a certificate.

type PostCertificateResponse

type PostCertificateResponse struct {
	Guid string `json:"taskId"`
}

PostCertificateResponse represents the structure of the JSON response body for obtaining a certificate.

Jump to

Keyboard shortcuts

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