acmeproxy

package module
v0.0.0-...-d329e1a Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2024 License: MIT Imports: 7 Imported by: 2

README

ACMEProxy for libdns

Go Reference

This package implements the libdns interfaces for ACMEProxy, allowing you to manage DNS records.

Please note that ACMEProxy is more or less only used for ACME DNS and therefor only is able to create and delete TXT records

For a server to use it with see acmeproxy

Example configuration

// Without Auth
p := acmeproxy.Provider{
    Endpoint: "https://example.com:9090",
}

// With Auth
p := acmeproxy.Provider{
    Endpoint: "https://example.com:9090",
    Credentials: acmeproxy.Credentials{
        Username: "admin",
        Password: "password",
    },
}

// With Custom Client
p := acmeproxy.Provider{
	Endpoint: "https://example.com:9090",
	Credentials: acmeproxy.Credentials{
		Username: "admin",
		Password: "admin",
	},
	HTTPClient: http.Client{
		Timeout: 10 * time.Second,
	}
}

Documentation

Overview

Package libdnstemplate implements a DNS record management client compatible with the libdns interfaces for ACMEProxy.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Credentials

type Credentials struct {
	Username string `json:"username,omitempty"` // Username represents the user's name for authentication.
	Password string `json:"password,omitempty"` // Password represents the user's password for authentication.
}

Credentials represents the username and password required for authentication. The fields are optional and can be omitted.

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

type Provider

type Provider struct {
	// Credentials are the username and password required for authentication.
	// The fields are optional and can be omitted.
	Credentials
	// Endpoint is the URL of the ACMEProxy server.
	Endpoint string `json:"endpoint"`
	// HTTPClient is the client used to communicate with the ACMEProxy server.
	// If nil, a default client will be used.
	HTTPClient HTTPClient
}

Provider facilitates DNS record manipulation with ACMEProxy.

func (*Provider) AppendRecords

func (p *Provider) AppendRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)

AppendRecords adds records to the zone. It returns the records that were added. It does the same as SetRecords.

func (*Provider) DeleteRecords

func (p *Provider) DeleteRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)

DeleteRecords deletes the records from the zone. It returns the records that were deleted.

func (*Provider) GetRecords

func (p *Provider) GetRecords(ctx context.Context, zone string) ([]libdns.Record, error)

GetRecords lists all the records in the zone. This is not supported by the ACMEProxy provider.

func (*Provider) SetRecords

func (p *Provider) SetRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)

SetRecords sets the records in the zone, either by updating existing records or creating new ones. It returns the updated records.

Jump to

Keyboard shortcuts

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