Documentation ¶
Index ¶
- Constants
- Variables
- type AddOverrideRequest
- type OperationResponse
- type Record
- type SearchHostResp
- type Unbound
- func (u Unbound) AdjustEndpoints(endpoints []*endpoint.Endpoint) ([]*endpoint.Endpoint, error)
- func (u Unbound) ApplyChanges(ctx context.Context, changes *plan.Changes) error
- func (u Unbound) GetDomainFilter() endpoint.DomainFilter
- func (u Unbound) Records(ctx context.Context) ([]*endpoint.Endpoint, error)
Constants ¶
const ( // SearchOverridesEndpoint is used to get existing DNS entries in unbound. SearchOverridesEndpoint = apiPrefix + "/settings/searchHostOverride" // AddOverrideEndpoint is the create DNS entries. AddOverrideEndpoint = apiPrefix + "/settings/addHostOverride" // DelOverrideEndpoint is the api endpoint for deleting DNS entries. DelOverrideEndpoint = apiPrefix + "/settings/delHostOverride/" ApplyChangesEndpoint = apiPrefix + "/service/reconfigure" CreateOpSuccessResponse = "saved" DeleteOpSuccessResponse = "deleted" DescriptionPrefix = "Managed by K8s external-dns" )
Variables ¶
var ( ErrRequestFailed = errors.New("request failed") ErrMarshalling = errors.New("marshal response") )
Functions ¶
This section is empty.
Types ¶
type AddOverrideRequest ¶
type AddOverrideRequest struct {
Host Record `json:"host"`
}
type OperationResponse ¶
type OperationResponse struct {
Result string `json:"result"`
}
OperationResponse is the in memory representation of success/fail response from opnsense unbound api success response is typically the opSuccessResponse value.
type Record ¶
type SearchHostResp ¶
type SearchHostResp struct {
Rows []Record `json:"rows"`
}
func (SearchHostResp) ToEndpoints ¶
func (shr SearchHostResp) ToEndpoints() []*endpoint.Endpoint
type Unbound ¶
type Unbound struct {
// contains filtered or unexported fields
}
Unbound is the opnsense unbound dns provider implementation. opnsense unbound does not support txt records. Txt records will be added to the "description" field of a record.
func New ¶
New creates an Unbound provider client - the http client to use baseUrl - location of the opnsense unbound API creds - credentials in the form of apiKey:apiSecret.
func (Unbound) AdjustEndpoints ¶
AdjustEndpoints canonicalizes a set of candidate endpoints. It is called with a set of candidate endpoints obtained from the various sources. It returns a set modified as required by the provider. The provider is responsible for adding, removing, and modifying the ProviderSpecific properties to match the endpoints that the provider returns in `Records` so that the change plan will not have unnecessary (potentially failing) changes. It may also modify other fields, add, or remove Endpoints. It is permitted to modify the supplied endpoints.
func (Unbound) ApplyChanges ¶
func (Unbound) GetDomainFilter ¶
func (u Unbound) GetDomainFilter() endpoint.DomainFilter
func (Unbound) Records ¶
Records returns all records or "overrides" in opnsense unbound. Unbound does not support txt record types. If a record is managed by external-dns, it will have the associated txt records in the description field. Records will marshall the txt fields into a separate endpoint.