api

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: Apache-2.0 Imports: 9 Imported by: 7

Documentation

Index

Constants

View Source
const (
	MediaTypeFormatAndVersion = "application/external.dns.webhook+json;version=1"
	ContentTypeHeader         = "Content-Type"
)

Variables

This section is empty.

Functions

func StartHTTPApi

func StartHTTPApi(provider provider.Provider, startedChan chan struct{}, readTimeout, writeTimeout time.Duration, providerPort string)

StartHTTPApi starts a HTTP server given any provider. the function takes an optional channel as input which is used to signal that the server has started. The server will listen on port `providerPort`. The server will respond to the following endpoints: - / (GET): initialization, negotiates headers and returns the domain filter - /records (GET): returns the current records - /records (POST): applies the changes - /adjustendpoints (POST): executes the AdjustEndpoints method

Types

type WebhookServer

type WebhookServer struct {
	Provider provider.Provider
}

func (*WebhookServer) AdjustEndpointsHandler

func (p *WebhookServer) AdjustEndpointsHandler(w http.ResponseWriter, req *http.Request)

func (*WebhookServer) NegotiateHandler

func (p *WebhookServer) NegotiateHandler(w http.ResponseWriter, req *http.Request)

func (*WebhookServer) RecordsHandler

func (p *WebhookServer) RecordsHandler(w http.ResponseWriter, req *http.Request)

Jump to

Keyboard shortcuts

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