Documentation
¶
Index ¶
- func StartHTTPApi(provider provider.Provider, startedChan chan struct{}, ...)
- type WebhookProvider
- func (p WebhookProvider) AdjustEndpoints(e []*endpoint.Endpoint) ([]*endpoint.Endpoint, error)
- func (p WebhookProvider) ApplyChanges(ctx context.Context, changes *plan.Changes) error
- func (p WebhookProvider) GetDomainFilter() endpoint.DomainFilter
- func (p WebhookProvider) Records(ctx context.Context) ([]*endpoint.Endpoint, error)
- type WebhookServer
Constants ¶
This section is empty.
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 WebhookProvider ¶
type WebhookProvider struct { DomainFilter endpoint.DomainFilter // contains filtered or unexported fields }
func NewWebhookProvider ¶
func NewWebhookProvider(u string) (*WebhookProvider, error)
func (WebhookProvider) AdjustEndpoints ¶
AdjustEndpoints will call the provider doing a POST on `/adjustendpoints` which will return a list of modified endpoints based on a provider specific requirement. This method returns an empty slice in case there is a technical error on the provider's side so that no endpoints will be considered.
func (WebhookProvider) ApplyChanges ¶
ApplyChanges will make a POST to remoteServerURL/records with the changes
func (WebhookProvider) GetDomainFilter ¶
func (p WebhookProvider) GetDomainFilter() endpoint.DomainFilter
GetDomainFilter make calls to get the serialized version of the domain filter
type WebhookServer ¶
type WebhookServer struct {
// contains filtered or unexported fields
}