schema

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HdnsTime added in v0.1.1

type HdnsTime time.Time

HdnsTime defines a wrapper for time.Time, to handle the DateTime format(s) used in HCloud DNS API...

func (HdnsTime) MarshalJSON added in v0.1.1

func (ht HdnsTime) MarshalJSON() ([]byte, error)

MarshalJSON is an implementation of encoding/json.Marshaler

func (*HdnsTime) UnmarshalJSON added in v0.1.1

func (ht *HdnsTime) UnmarshalJSON(b []byte) error

UnmarshalJSON is an implementation of encoding/json.Unmarshaler

type Meta

type Meta struct {
	Pagination *MetaPagination `json:"pagination"`
}

Meta defines the schema of meta information which may be included in responses.

type MetaPagination

type MetaPagination struct {
	LastPage     int `json:"last_page"`
	Page         int `json:"page"`
	PerPage      int `json:"per_page"`
	TotalEntries int `json:"total_entries"`
}

MetaPagination defines the schema of pagination information.

type MetaResponse

type MetaResponse struct {
	Meta Meta `json:"meta"`
}

MetaResponse defines the schema of a response containing meta information.

type PrimaryServer

type PrimaryServer struct {
	ID       string   `json:"id"`
	Port     int      `json:"port"`
	Created  HdnsTime `json:"created"`
	Modified HdnsTime `json:"modified"`
	ZoneID   string   `json:"zone_id"`
	Address  string   `json:"address"`
}

PrimaryServer represents a primary server in the Hetzner DNS API.

type PrimaryServerCreateRequest

type PrimaryServerCreateRequest struct {
	Address string `json:"address"`
	Port    int    `json:"port"`
	ZoneID  string `json:"zone_id"`
}

PrimaryServerCreateRequest defines a schema for the request to create a primary server.

type PrimaryServerListResponse

type PrimaryServerListResponse struct {
	PrimaryServers []PrimaryServer `json:"primary_servers"`
}

PrimaryServerListResponse defines the schema of the response when listing primary servers.

type PrimaryServerResponse

type PrimaryServerResponse struct {
	PrimaryServer PrimaryServer `json:"primary_server"`
}

PrimaryServerResponse defines the schema of the response when listing zones.

type PrimaryServerUpdateRequest

type PrimaryServerUpdateRequest struct {
	Address string `json:"address"`
	Port    int    `json:"port"`
	ZoneID  string `json:"zone_id"`
}

PrimaryServerUpdateRequest defines a schema for the request to create a primary server.

type Record

type Record struct {
	Type     string   `json:"type"`
	ID       string   `json:"id"`
	Created  HdnsTime `json:"created"`
	Modified HdnsTime `json:"modified"`
	ZoneID   string   `json:"zone_id"`
	Name     string   `json:"name"`
	Value    string   `json:"value"`
	Ttl      int      `json:"ttl"`
}

Record represents a record in Hetzner DNS.

type RecordBulkCreateRequest

type RecordBulkCreateRequest struct {
	Records []RecordCreateRequest `json:"records"`
}

RecordBulkCreateRequest defines a schema for the request to bulk create records.

type RecordBulkCreateResponse

type RecordBulkCreateResponse struct {
	Records        []Record          `json:"record"`
	ValidRecords   []RecordBulkEntry `json:"valid_records"`
	InvalidRecords []RecordBulkEntry `json:"invalid_records"`
}

RecordResponse defines the schema of the response when listing zones.

type RecordBulkEntry

type RecordBulkEntry struct {
	Name   string `json:"name"`
	Ttl    *int   `json:"ttl"`
	Type   string `json:"type"`
	Value  string `json:"value"`
	ZoneID string `json:"zone_id"`
}

RecordBulkEntry defines a schema for an entry for the request to bulk create records and is used in responses.

type RecordBulkUpdateEntry

type RecordBulkUpdateEntry struct {
	ID     string `json:"id"`
	Name   string `json:"name"`
	Ttl    *int   `json:"ttl"`
	Type   string `json:"type"`
	Value  string `json:"value"`
	ZoneID string `json:"zone_id"`
}

RecordBulkUpdateEntry defines a schema for an entry for the request to bulk update records.

type RecordBulkUpdateRequest

type RecordBulkUpdateRequest struct {
	Records []RecordBulkUpdateEntry `json:"records"`
}

RecordBulkUpdateRequest defines a schema for the request to bulk update records.

type RecordBulkUpdateResponse

type RecordBulkUpdateResponse struct {
	Records       []Record          `json:"records"`
	FailedRecords []RecordBulkEntry `json:"failed_records"`
}

RecordBulkUpdateResponse defines a schema for the respose to bulk update records.

type RecordCreateRequest

type RecordCreateRequest struct {
	Name   string `json:"name"`
	Ttl    *int   `json:"ttl"`
	Type   string `json:"type"`
	Value  string `json:"value"`
	ZoneID string `json:"zone_id"`
}

RecordCreateRequest defines a schema for the request to create a record.

type RecordListResponse

type RecordListResponse struct {
	Records []Record `json:"records"`
}

RecordListResponse defines the schema of the response when listing zones.

type RecordResponse

type RecordResponse struct {
	Record Record `json:"record"`
}

RecordResponse defines the schema of the response when listing zones.

type RecordUpdateRequest

type RecordUpdateRequest struct {
	Name   string `json:"name"`
	Ttl    *int   `json:"ttl"`
	Type   string `json:"type"`
	Value  string `json:"value"`
	ZoneID string `json:"zone_id"`
}

RecordUpdateRequest defines a schema for the request to update a record.

type TxtVerification

type TxtVerification struct {
	Name  string `json:"name"`
	Token string `json:"token"`
}

TxtVerification represents the text verification of a zone.

type ValidateZoneFileResponse

type ValidateZoneFileResponse struct {
	PassedRecords int      `json:"passed_records"`
	ValidRecords  []Record `json:"valid_records"`
}

ValidateZoneFileResponse defines the schema of the response when validating a zone file.

type Zone

type Zone struct {
	ID              string          `json:"id"`
	Created         HdnsTime        `json:"created"`
	Modified        HdnsTime        `json:"modified"`
	LegacyDNSHost   string          `json:"legacy_dns_host"`
	LegacyNS        []string        `json:"legacy_ns"`
	Name            string          `json:"name"`
	NS              []string        `json:"ns"`
	Owner           string          `json:"owner"`
	Paused          bool            `json:"paused"`
	Permission      string          `json:"permission"`
	Project         string          `json:"project"`
	Registrar       string          `json:"registrar"`
	Status          string          `json:"status"`
	Ttl             int             `json:"ttl"`
	Verified        HdnsTime        `json:"verified"`
	RecordsCount    int             `json:"records_count"`
	IsSecondaryDNS  bool            `json:"is_secondary_dns"`
	TxtVerification TxtVerification `json:"txt_verification"`
}

Zone represents a zone in Hetzner DNS.

type ZoneCreateRequest

type ZoneCreateRequest struct {
	Name string `json:"name"`
	Ttl  *int   `json:"ttl"`
}

CreateZoneRequest defines a schema for the request to create a zone.

type ZoneListResponse

type ZoneListResponse struct {
	Zones []Zone `json:"zones"`
}

ZoneListResponse defines the schema of the response when listing zones.

type ZoneResponse

type ZoneResponse struct {
	Zone Zone `json:"zone"`
}

ZoneGetResponse defines the schema of the response when listing zones.

type ZoneUpdateRequest

type ZoneUpdateRequest struct {
	Name string `json:"name"`
	Ttl  *int   `json:"ttl"`
}

CreateZoneRequest defines a schema for the request to create a zone.

Jump to

Keyboard shortcuts

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