Documentation
¶
Index ¶
- type Provider
- func (p *Provider) AppendRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)
- func (Provider) CaddyModule() caddy.ModuleInfo
- func (p *Provider) DeleteRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)
- func (p *Provider) GetRecords(ctx context.Context, zone string) ([]libdns.Record, error)
- func (p *Provider) Provision(ctx caddy.Context) error
- func (p *Provider) SetRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)
- func (p *Provider) UnmarshalCaddyfile(d *caddyfile.Dispenser) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider struct {
// Host is the OPNsense hostname or IP address (e.g., "opnsense.example.com" or "192.168.1.1")
Host string `json:"host,omitempty"`
// APIKey is the OPNsense API key
APIKey string `json:"api_key,omitempty"`
// APISecretKey is the OPNsense API secret key
APISecretKey string `json:"api_secret_key,omitempty"`
// DNSService specifies which DNS service to use: "dnsmasq" or "unbound"
DNSService string `json:"dns_service,omitempty"`
// Insecure skips TLS certificate verification (for self-signed certificates)
Insecure bool `json:"insecure,omitempty"`
// EntryDescription is set on created host entries (defaults to "Managed by Caddy")
EntryDescription string `json:"entry_description,omitempty"`
// contains filtered or unexported fields
}
Provider lets Caddy read and manipulate DNS records hosted by OPNsense.
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.
func (Provider) CaddyModule ¶
func (Provider) CaddyModule() caddy.ModuleInfo
CaddyModule returns the Caddy module information.
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.
func (*Provider) GetRecords ¶
GetRecords lists all the records in the zone.
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.
func (*Provider) UnmarshalCaddyfile ¶
UnmarshalCaddyfile sets up the DNS provider from Caddyfile tokens. Syntax:
opnsense {
host <host>
api_key <api_key>
api_secret_key <api_secret_key>
dns_service <dnsmasq|unbound>
insecure <true|false>
entry_description <description>
}
Directories
¶
| Path | Synopsis |
|---|---|
|
test_assets
|
|
|
mock_server
command
Mock OPNsense API server for integration testing
|
Mock OPNsense API server for integration testing |
|
validator
command
Validates that the mock server received expected API requests
|
Validates that the mock server received expected API requests |
Click to show internal directories.
Click to hide internal directories.