ns1

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(config APIConfig) *api.Client

NewClient creates a new NS1 API client based on the provided config

func RefreshZoneData added in v0.2.0

func RefreshZoneData(logger *slog.Logger, c *api.Client, getRecords bool, zoneBlacklist, zoneWhitelist *regexp.Regexp) map[string]*Zone

Types

type APIConfig

type APIConfig struct {
	Token         string
	Concurrency   int
	Endpoint      string
	TLSSkipVerify bool
	UserAgent     string
}

type QPS

type QPS struct {
	Value      float32
	ZoneName   string
	RecordName string
	RecordType string
}

QPS holds values related to QPS info from the NS1 API

type Zone

type Zone struct {
	Zone       string
	NetworkIDs []int // not used yet
	Records    []*ZoneRecord
}

Zone is an internal struct that is essentially the same thing as `model/dns.Zone`, mostly trimmed down to drop a bunch of fields we don't care about right now

type ZoneRecord

type ZoneRecord struct {
	Domain   string
	ShortAns []string
	Type     string
}

ZoneRecord is an internal struct that is essentially the same thing as a `model/dns.ZoneRecord`, just trimmed down to removee a bunch of fields we don't care about

Jump to

Keyboard shortcuts

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