dns

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: May 11, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

* GoStack API Client * * Copyright 2020 Christopher O'Connell * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

* GoStack API Client * * Copyright 2020 Christopher O'Connell * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

* GoStack API Client * * Copyright 2020 Christopher O'Connell * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

* GoStack API Client * * Copyright 2020 Christopher O'Connell * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

* GoStack API Client * * Copyright 2020 Christopher O'Connell * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

* GoStack API Client * * Copyright 2020 Christopher O'Connell * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

* GoStack API Client * * Copyright 2020 Christopher O'Connell * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

Index

Constants

View Source
const (
	Add = iota
	Preserve
	Modify // TODO: Try and use modify when possible
	Delete
)
View Source
const (
	KeyNoteSOA         = "spdns_soa"
	KeyNoteNameservers = "spdns_nameservers"
	KeyNoteComment     = "spdns_comment"
)

Variables

This section is empty.

Functions

func AlmostEqual

func AlmostEqual(a, b ExtendedRecord) bool

func CanonicalizeName

func CanonicalizeName(name string) string

func Compare

func Compare(a, b ExtendedRecord) int

Returns -1 if a is less than b, 0 if equal and 1 if greater

func NormalizeName

func NormalizeName(name string) string

Types

type ChangeRecord

type ChangeRecord struct {
	Action ChangeType
	Item   ExtendedRecord
}

func (ChangeRecord) ColorString

func (c ChangeRecord) ColorString() string

func (ChangeRecord) String

func (c ChangeRecord) String() string

type ChangeType

type ChangeType int

func (ChangeType) ActionString

func (c ChangeType) ActionString() string

func (ChangeType) String

func (c ChangeType) String() string

type ExtendedRecord

type ExtendedRecord struct {
	DomainName string
	BaseName   string // The FQDN of the zone, copied in here for ease of use TODO: Do we need this?
	TimeToLive int64  // uint32, expanded and signed to allow for "unset" indicator
	Class      gozone.RecordClass
	Type       gozone.RecordType
	Data       []string
	Comment    string
	ZoneId     string // The ID of the zone
	RecordId   string // The ID of the individual record, for updates
}

func SortRecords

func SortRecords(records []ExtendedRecord) []ExtendedRecord

Sort records defines a total ordering over any set of DNS records, ensuring that even if zones are changed manually, or an API returns records in a different order that it is possible to ensure a complete and ordered set of records for a zone when comparing them later.

func (ExtendedRecord) String

func (r ExtendedRecord) String() string

type NoteComment

type NoteComment struct {
	Comment string `json:"comment"`
}

type NoteNS

type NoteNS struct {
	TimeToLive int64    `json:"ttl"`
	Data       []string `json:"data"`
	Comment    string   `json:"comment"`
}

type NoteNameServers

type NoteNameServers struct {
	Nameservers []NoteNS `json:"nameservers"`
}

type NoteSOA

type NoteSOA struct {
	TimeToLive int64    `json:"ttl"`
	Data       []string `json:"data"`
	Comment    string   `json:"comment"`
}

type ResourceRecord

type ResourceRecord struct {
	Id      string            `json:"id"`
	ZoneId  string            `json:"zoneId"`
	Name    string            `json:"name"`
	Type    string            `json:"type"`
	Class   string            `json:"class"`
	TTL     int               `json:"ttl"`
	Data    string            `json:"data"`
	Labels  map[string]string `json:"labels"`
	Created string            `json:"created"`
	Updated string            `json:"updated"`
}

func (ResourceRecord) ExtendedRecord

func (r ResourceRecord) ExtendedRecord(base string) ExtendedRecord

func (ResourceRecord) GRClass

func (r ResourceRecord) GRClass() gozone.RecordClass

func (ResourceRecord) GRType

func (r ResourceRecord) GRType() gozone.RecordType

type Zone

type Zone struct {
	StackID     string            `json:"stackId"`
	AccountID   string            `json:"accountId"`
	ID          string            `json:"id"`
	Domain      string            `json:"domain"`
	Version     string            `json:"version"`
	Labels      map[string]string `json:"labels"`
	Created     string            `json:"created"`
	Updated     string            `json:"updated"`
	NameServers []string          `json:"nameservers"`
	Verified    string            `json:"verified"`
	Status      string            `json:"status"`
	Disabled    bool              `json:"disabled"`
}

func (Zone) String

func (z Zone) String() string

Jump to

Keyboard shortcuts

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