cryptokeys

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2024 License: Apache-2.0 Imports: 5 Imported by: 2

Documentation

Overview

Package cryptokeys contains a specialized client for interacting with PowerDNS' "Cryptokeys" API.

More information

Official API documentation: https://doc.powerdns.com/authoritative/http-api/cryptokey.html

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {

	// ListCryptokeys lists all CryptoKeys, except its privatekey
	ListCryptokeys(ctx context.Context, serverID, zoneID string) ([]Cryptokey, error)

	// GetCryptokey returns all data about the CryptoKey, including the privatekey.
	// If the server with the given "serverID" does not exist,
	// the error return value will contain a pdnshttp.ErrNotFound error (see example)
	GetCryptokey(ctx context.Context, serverID, zoneID string, cryptokeyID int) (*Cryptokey, error)

	// CreateCryptokey creates a new CryptoKey
	CreateCryptokey(ctx context.Context, serverID, zoneID string, opts Cryptokey) (*Cryptokey, error)

	// ToggleCryptokey (de)activates a CryptoKey for the given zone
	ToggleCryptokey(ctx context.Context, serverID, zoneID string, cryptokeyID int) error

	// DeleteCryptokey deletes a CryptoKey from the given zone
	DeleteCryptokey(ctx context.Context, serverID, zoneID string, cryptokeyID int) error
}

Client defines method for interacting with the PowerDNS "Cryptokeys" endpoints

func New

func New(hc *pdnshttp.Client) Client

New returns a new HTTP API Client

type Cryptokey

type Cryptokey struct {
	ID         int      `json:"id,omitempty"`
	Type       string   `json:"type,omitempty"`
	KeyType    string   `json:"keytype,omitempty"`
	Active     bool     `json:"active,omitempty"`
	Published  bool     `json:"published,omitempty"`
	DNSKey     string   `json:"dnskey,omitempty"`
	DS         []string `json:"ds,omitempty"`
	PrivateKey string   `json:"privatekey,omitempty"`
	Algorithm  string   `json:"algorithm,omitempty"`
	Bits       int      `json:"bits,omitempty"`
}

Cryptokey represents a Cryptokey model of the API More information: https://doc.powerdns.com/authoritative/http-api/cryptokey.html#cryptokey

Jump to

Keyboard shortcuts

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