ddns

package
v0.0.0-...-01af8cd Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2024 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// CloudEventSource is the repo where this project lives
	CloudEventSource = "https://github.com/jonpulsifer/ddnsb0t"
	// CloudEventSchema is the location of the Request and Response types
	CloudEventSchema = "https://github.com/jonpulsifer/ddnsb0t/pkg/ddns/ddns.go"
	// CloudEventRequestType is the CloudEvent Request
	CloudEventRequestType = "dev.pulsifer.ddns.request"
	// CloudEventResponseType is the CloudEvent Response
	CloudEventResponseType = "dev.pulsifer.ddns.response"
)

Variables

This section is empty.

Functions

func GenerateCloudEventRequest

func GenerateCloudEventRequest(request Request) cloudevents.Event

GenerateCloudEventRequest builds a cloudevents.Event from a ddns.Request

func GenerateCloudEventResponse

func GenerateCloudEventResponse(response Response) cloudevents.Event

GenerateCloudEventResponse builds a cloudevents.Event from a ddns.Response

Types

type Request

type Request struct {
	IP     string `json:"ip"`
	FQDN   string `json:"fqdn"`
	Domain string `json:"domain,omitempty"`
	Token  string `json:"token"`
}

Request is the expected struct we want as a request

type Response

type Response struct {
	FQDN      string `json:"fqdn"`
	Status    string `json:"status"`
	Additions int    `json:"additions"`
	Deletions int    `json:"deletions,omitempty"`
}

Response is the response we expect to return

Jump to

Keyboard shortcuts

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