ocidns

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 45 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

OCI DNS

Parity grade: B · SDK github.com/oracle/oci-go-sdk/v65@v65.126.2 · last audited 2026-11-01 (15447c03a)

Coverage

Metric Value
PARITY entries audited 52 (41 ok, 11 partial)
Feature families 11 (4 ok, 7 partial)
Known gaps 2
Deferred items 0
Resource leaks unknown
Known gaps
  • DNSSEC is state only: dnssecState is stored, but no keys are generated, dnssecConfig is never returned, answers are unsigned, and StageZoneDnssecKeyVersion and PromoteZoneDnssecKeyVersion are not routed (needs key generation, RRSIG/NSEC signing in authority.go:answerQuestion and the dnssecConfig wire in zones.go zoneWire).
  • Private DNS is not served: resolver endpoint addresses, forwarding rules, views attached to resolvers and PRIVATE zones affect no query, because a data-plane query carries no VCN identity (authority.go:answerQuestion sees only the UDP source address and globalZoneFor skips non-GLOBAL zones). resolutionMode TRANSPARENT and RTYPE_TRANSPARENT are stored only.

More

Documentation

Overview

Package ocidns emulates OCI DNS (API 20180115): zones, records, views, resolvers and endpoints, TSIG keys and steering policies on a dedicated control-plane listener, plus an authoritative DNS server for GLOBAL zones. See PARITY.md.

Index

Constants

View Source
const (
	// DefaultPort is the dedicated control-plane listener's default TCP port.
	DefaultPort = 8168
	// DefaultDNSPort is the default UDP and TCP port of the authoritative DNS server.
	DefaultDNSPort = 8169
)
View Source
const (

	// Version is the OCI DNS API version served.
	Version = "20180115"
)

Variables

View Source
var ErrNilAppContext = errors.New("ocidns: nil app context")

ErrNilAppContext is returned when Init is called with a nil AppContext.

View Source
var ErrSnapshotNull = errors.New("ocidns: null entry in snapshot")

ErrSnapshotNull is returned when a snapshot contains a null entry.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	Code    string
	Message string
	Status  int
}

APIError is an OCI error response: HTTP status plus the `code` and `message` body fields.

func (*APIError) Error

func (e *APIError) Error() string

type Attachment

type Attachment struct {
	Created time.Time `json:"created"`

	ID               string   `json:"id"`
	CompartmentID    string   `json:"compartmentId"`
	DisplayName      string   `json:"displayName"`
	SteeringPolicyID string   `json:"steeringPolicyId"`
	ZoneID           string   `json:"zoneId"`
	Domain           string   `json:"domain"`
	Rtypes           []string `json:"rtypes"`
	Seq              int64    `json:"seq"`
	// contains filtered or unexported fields
}

Attachment binds a steering policy to a domain of a GLOBAL zone.

type AttachmentFilter

type AttachmentFilter struct {
	Created  func(time.Time) bool
	Compart  string
	ID       string
	Name     string
	PolicyID string
	ZoneID   string
	Domain   string
	Contains string
	State    string
}

AttachmentFilter selects steering policy attachments in a list.

type AttachmentWire

type AttachmentWire struct {
	TimeCreated      time.Time `json:"timeCreated"`
	SteeringPolicyID string    `json:"steeringPolicyId"`
	ZoneID           string    `json:"zoneId"`
	DomainName       string    `json:"domainName"`
	DisplayName      string    `json:"displayName"`
	CompartmentID    string    `json:"compartmentId"`
	Self             string    `json:"self"`
	ID               string    `json:"id"`
	LifecycleState   string    `json:"lifecycleState"`
	Rtypes           []string  `json:"rtypes"`
}

AttachmentWire is the wire form of a steering policy attachment.

type ChangeCompartmentIn

type ChangeCompartmentIn struct {
	CompartmentID string `json:"compartmentId"`
}

ChangeCompartmentIn is the body of the change-compartment operations.

type ConfigProvider

type ConfigProvider interface {
	GetOCIDNSSettings() Settings
}

ConfigProvider extracts OCI DNS configuration from the AppContext Config.

type CreateAttachmentIn

type CreateAttachmentIn struct {
	RetryToken       string `json:"-"`
	SteeringPolicyID string `json:"steeringPolicyId"`
	ZoneID           string `json:"zoneId"`
	DomainName       string `json:"domainName"`
	DisplayName      string `json:"displayName"`
}

CreateAttachmentIn is the body of CreateSteeringPolicyAttachment.

type CreateEndpointIn

type CreateEndpointIn struct {
	Tags
	RetryToken        string   `json:"-"`
	IsForwarding      *bool    `json:"isForwarding"`
	IsListening       *bool    `json:"isListening"`
	Name              string   `json:"name"`
	EndpointType      string   `json:"endpointType"`
	SubnetID          string   `json:"subnetId"`
	ForwardingAddress string   `json:"forwardingAddress"`
	ListeningAddress  string   `json:"listeningAddress"`
	NsgIDs            []string `json:"nsgIds"`
}

CreateEndpointIn is the body of CreateResolverEndpoint.

type CreatePolicyIn

type CreatePolicyIn struct {
	Tags
	RetryToken           string           `json:"-"`
	TTL                  *int             `json:"ttl"`
	CompartmentID        string           `json:"compartmentId"`
	DisplayName          string           `json:"displayName"`
	Template             string           `json:"template"`
	HealthCheckMonitorID string           `json:"healthCheckMonitorId"`
	Answers              []map[string]any `json:"answers"`
	Rules                []map[string]any `json:"rules"`
}

CreatePolicyIn is the body of CreateSteeringPolicy.

type CreateTsigKeyIn

type CreateTsigKeyIn struct {
	Tags
	Algorithm     string `json:"algorithm"`
	Name          string `json:"name"`
	CompartmentID string `json:"compartmentId"`
	Secret        string `json:"secret"`
}

CreateTsigKeyIn is the body of CreateTsigKey.

type CreateViewIn

type CreateViewIn struct {
	Tags
	RetryToken    string `json:"-"`
	CompartmentID string `json:"compartmentId"`
	DisplayName   string `json:"displayName"`
}

CreateViewIn is the body of CreateView.

type CreateZoneIn

type CreateZoneIn struct {
	Tags
	RetryToken          string      `json:"-"`
	Name                string      `json:"name"`
	CompartmentID       string      `json:"compartmentId"`
	ViewID              string      `json:"viewId"`
	ZoneType            string      `json:"zoneType"`
	Scope               string      `json:"scope"`
	ResolutionMode      string      `json:"resolutionMode"`
	DnssecState         string      `json:"dnssecState"`
	MigrationSource     string      `json:"migrationSource"`
	ExternalMasters     []ExtServer `json:"externalMasters"`
	ExternalDownstreams []ExtServer `json:"externalDownstreams"`
}

CreateZoneIn is the body of CreateZone.

type Endpoint

type Endpoint struct {
	Created time.Time `json:"created"`
	Updated time.Time `json:"updated"`

	Tags
	ID                string   `json:"id"`
	ResolverID        string   `json:"resolverId"`
	CompartmentID     string   `json:"compartmentId"`
	Name              string   `json:"name"`
	SubnetID          string   `json:"subnetId"`
	ForwardingAddress string   `json:"forwardingAddress,omitempty"`
	ListeningAddress  string   `json:"listeningAddress,omitempty"`
	NsgIDs            []string `json:"nsgIds"`
	Seq               int64    `json:"seq"`
	IsForwarding      bool     `json:"isForwarding"`
	IsListening       bool     `json:"isListening"`
	// contains filtered or unexported fields
}

Endpoint is a VNIC resolver endpoint.

type EndpointWire

type EndpointWire struct {
	TimeCreated        time.Time                 `json:"timeCreated"`
	TimeUpdated        time.Time                 `json:"timeUpdated"`
	FreeformTags       map[string]string         `json:"freeformTags"`
	DefinedTags        map[string]map[string]any `json:"definedTags"`
	SecurityAttributes map[string]map[string]any `json:"securityAttributes"`
	ForwardingAddress  *string                   `json:"forwardingAddress"`
	ListeningAddress   *string                   `json:"listeningAddress"`
	ResolverID         string                    `json:"resolverId"`
	ID                 string                    `json:"id"`
	CompartmentID      string                    `json:"compartmentId"`
	LifecycleState     string                    `json:"lifecycleState"`
	Self               string                    `json:"self"`
	EndpointType       string                    `json:"endpointType"`
	SubnetID           string                    `json:"subnetId"`
	Name               string                    `json:"name"`
	NsgIDs             []string                  `json:"nsgIds"`
	IsForwarding       bool                      `json:"isForwarding"`
	IsListening        bool                      `json:"isListening"`
}

EndpointWire is the wire form of a VNIC resolver endpoint.

type ExtServer

type ExtServer struct {
	Port      *int   `json:"port,omitempty"`
	Address   string `json:"address"`
	TsigKeyID string `json:"tsigKeyId,omitempty"`
}

ExtServer is an external master or downstream nameserver of a zone.

type Handler

type Handler struct {
	Backend *InMemoryBackend

	Port         int
	DNSPort      int
	EnforceAuth  bool
	DNSEphemeral bool
	// contains filtered or unexported fields
}

Handler serves OCI DNS.

func NewHandler

func NewHandler(backend *InMemoryBackend) *Handler

NewHandler creates a Handler; callers override the ports and EnforceAuth from Settings.

func (*Handler) DataPlanePort

func (h *Handler) DataPlanePort() int

DataPlanePort is the bound port of the authoritative DNS server, 0 while it is not running.

func (*Handler) ExtractOperation

func (h *Handler) ExtractOperation(c *echo.Context) string

ExtractOperation returns the operation name for metrics.

func (*Handler) ExtractResource

func (h *Handler) ExtractResource(c *echo.Context) string

ExtractResource returns the addressed resource id for metrics.

func (*Handler) GetSupportedOperations

func (h *Handler) GetSupportedOperations() []string

GetSupportedOperations lists the supported operations.

func (*Handler) Handler

func (h *Handler) Handler() echo.HandlerFunc

Handler returns the Echo handler for all OCIDNS requests.

func (*Handler) MatchPriority

func (h *Handler) MatchPriority() int

MatchPriority is irrelevant because RouteMatcher never matches.

func (*Handler) Name

func (h *Handler) Name() string

Name returns the service name.

func (*Handler) Reset

func (h *Handler) Reset()

Reset clears all in-memory state.

func (*Handler) Restore

func (h *Handler) Restore(ctx context.Context, data []byte) error

Restore implements persistence.Persistable by delegating to the backend.

func (*Handler) RouteMatcher

func (h *Handler) RouteMatcher() service.Matcher

RouteMatcher never matches: OCIDNS runs on its own listener.

func (*Handler) Shutdown

func (h *Handler) Shutdown(ctx context.Context)

Shutdown stops both listeners.

func (*Handler) Snapshot

func (h *Handler) Snapshot(ctx context.Context) []byte

Snapshot implements persistence.Persistable by delegating to the backend.

func (*Handler) StartWorker

func (h *Handler) StartWorker(ctx context.Context) error

StartWorker binds the DNS server and the control-plane listener synchronously so a conflict is returned.

func (*Handler) Trusted

func (h *Handler) Trusted() echo.HandlerFunc

Trusted returns a handler that skips request-signature verification.

type InMemoryBackend

type InMemoryBackend struct {
	Auth *ociauth.Registry
	// contains filtered or unexported fields
}

InMemoryBackend holds every resource under one lock.

func NewInMemoryBackend

func NewInMemoryBackend() *InMemoryBackend

NewInMemoryBackend creates an empty backend.

func (*InMemoryBackend) Answer

func (b *InMemoryBackend) Answer(req *dns.Msg, network string) *dns.Msg

Answer builds the authoritative response to req.

func (*InMemoryBackend) ChangeResolverCompartment

func (b *InMemoryBackend) ChangeResolverCompartment(id string, c cond, in ChangeCompartmentIn) error

ChangeResolverCompartment moves a resolver.

func (*InMemoryBackend) ChangeSteeringPolicyCompartment

func (b *InMemoryBackend) ChangeSteeringPolicyCompartment(id string, c cond, in ChangeCompartmentIn) error

ChangeSteeringPolicyCompartment moves a steering policy.

func (*InMemoryBackend) ChangeTsigKeyCompartment

func (b *InMemoryBackend) ChangeTsigKeyCompartment(id string, c cond, in ChangeCompartmentIn) error

ChangeTsigKeyCompartment moves a TSIG key.

func (*InMemoryBackend) ChangeViewCompartment

func (b *InMemoryBackend) ChangeViewCompartment(id string, c cond, in ChangeCompartmentIn) error

ChangeViewCompartment moves a view.

func (*InMemoryBackend) ChangeZoneCompartment

func (b *InMemoryBackend) ChangeZoneCompartment(r ZoneRef, c cond, in ChangeCompartmentIn) error

ChangeZoneCompartment moves a zone and its steering policy attachments.

func (*InMemoryBackend) Compartments

func (b *InMemoryBackend) Compartments() []string

Compartments lists the distinct compartments that hold DNS resources.

func (*InMemoryBackend) CreateAttachment

func (b *InMemoryBackend) CreateAttachment(in CreateAttachmentIn) (AttachmentWire, Tag, error)

CreateAttachment attaches a steering policy to a domain of a GLOBAL zone.

func (*InMemoryBackend) CreateEndpoint

func (b *InMemoryBackend) CreateEndpoint(resolverID string, in CreateEndpointIn) (EndpointWire, Tag, error)

CreateEndpoint creates a VNIC endpoint on a resolver.

func (*InMemoryBackend) CreateSteeringPolicy

func (b *InMemoryBackend) CreateSteeringPolicy(in CreatePolicyIn) (SteeringPolicyWire, Tag, error)

CreateSteeringPolicy creates a steering policy.

func (*InMemoryBackend) CreateTsigKey

func (b *InMemoryBackend) CreateTsigKey(in CreateTsigKeyIn) (TsigKeyWire, Tag, error)

CreateTsigKey creates a TSIG key.

func (*InMemoryBackend) CreateView

func (b *InMemoryBackend) CreateView(in CreateViewIn) (ViewWire, Tag, error)

CreateView creates a private view.

func (*InMemoryBackend) CreateZone

func (b *InMemoryBackend) CreateZone(in CreateZoneIn) (ZoneWire, Tag, error)

CreateZone creates a zone with its managed SOA and NS records.

func (*InMemoryBackend) CreateZoneFromFile

func (b *InMemoryBackend) CreateZoneFromFile(compartment, scope, viewID, text, token string) (ZoneWire, Tag, error)

CreateZoneFromFile creates a PRIMARY zone from an RFC 1035 master file.

func (*InMemoryBackend) DeleteAttachment

func (b *InMemoryBackend) DeleteAttachment(id string, c cond) error

DeleteAttachment deletes a steering policy attachment.

func (*InMemoryBackend) DeleteEndpoint

func (b *InMemoryBackend) DeleteEndpoint(resolverID, name string, c cond) error

DeleteEndpoint deletes an endpoint that no resolver rule uses.

func (*InMemoryBackend) DeleteRecords

func (b *InMemoryBackend) DeleteRecords(r ZoneRef, c cond, s RecordScope) error

DeleteRecords removes the user records of a domain or of one of its record sets.

func (*InMemoryBackend) DeleteSteeringPolicy

func (b *InMemoryBackend) DeleteSteeringPolicy(id string, c cond) error

DeleteSteeringPolicy deletes a policy that no zone attaches.

func (*InMemoryBackend) DeleteTsigKey

func (b *InMemoryBackend) DeleteTsigKey(id string, c cond) error

DeleteTsigKey deletes a TSIG key that no zone references.

func (*InMemoryBackend) DeleteView

func (b *InMemoryBackend) DeleteView(id string, c cond) error

DeleteView deletes a view that no zone or resolver references.

func (*InMemoryBackend) DeleteZone

func (b *InMemoryBackend) DeleteZone(r ZoneRef, c cond) error

DeleteZone deletes a zone and its steering policy attachments.

func (*InMemoryBackend) GetAttachment

func (b *InMemoryBackend) GetAttachment(id string) (AttachmentWire, Tag, error)

GetAttachment returns a steering policy attachment.

func (*InMemoryBackend) GetEndpoint

func (b *InMemoryBackend) GetEndpoint(resolverID, name string) (EndpointWire, Tag, error)

GetEndpoint returns a resolver endpoint.

func (*InMemoryBackend) GetRecords

func (b *InMemoryBackend) GetRecords(r ZoneRef, f RecordFilter, o ListOpts, mustExist bool) (RecordList, Tag, error)

GetRecords lists records of a zone, optionally restricted to a domain or a record set.

func (*InMemoryBackend) GetResolver

func (b *InMemoryBackend) GetResolver(id string) (ResolverWire, Tag, error)

GetResolver returns a resolver.

func (*InMemoryBackend) GetSteeringPolicy

func (b *InMemoryBackend) GetSteeringPolicy(id string) (SteeringPolicyWire, Tag, error)

GetSteeringPolicy returns a steering policy.

func (*InMemoryBackend) GetTsigKey

func (b *InMemoryBackend) GetTsigKey(id string) (TsigKeyWire, Tag, error)

GetTsigKey returns a TSIG key.

func (*InMemoryBackend) GetView

func (b *InMemoryBackend) GetView(id string) (ViewWire, Tag, error)

GetView returns a view.

func (*InMemoryBackend) GetZone

func (b *InMemoryBackend) GetZone(r ZoneRef) (ZoneWire, Tag, error)

GetZone returns a zone.

func (*InMemoryBackend) HoldsInCompartment

func (b *InMemoryBackend) HoldsInCompartment(compartmentID string) string

HoldsInCompartment names a zone, view, TSIG key or steering policy held in the compartment, or returns "".

func (*InMemoryBackend) ListAttachments

ListAttachments lists the steering policy attachments of a compartment.

func (*InMemoryBackend) ListEndpoints

func (b *InMemoryBackend) ListEndpoints(resolverID, name, state string, o ListOpts) (ListResult[EndpointWire], error)

ListEndpoints lists the endpoints of a resolver.

func (*InMemoryBackend) ListResolvers

ListResolvers lists the resolvers of a compartment.

func (*InMemoryBackend) ListSteeringPolicies

func (b *InMemoryBackend) ListSteeringPolicies(
	f PolicyFilter,
	o ListOpts,
) (ListResult[SteeringPolicySummaryWire], error)

ListSteeringPolicies lists the steering policies of a compartment.

func (*InMemoryBackend) ListTsigKeys

ListTsigKeys lists the TSIG keys of a compartment; secrets are never included.

func (*InMemoryBackend) ListViews

ListViews lists the views of a compartment.

func (*InMemoryBackend) ListZoneTransferServers

func (b *InMemoryBackend) ListZoneTransferServers(compartment string, o ListOpts) (ListResult[TransferWire], error)

ListZoneTransferServers lists the OCI nameservers that transfer zones with external servers.

func (*InMemoryBackend) ListZones

ListZones lists the zones of a compartment.

func (*InMemoryBackend) PatchRecords

func (b *InMemoryBackend) PatchRecords(
	r ZoneRef,
	c cond,
	s RecordScope,
	in ItemsIn,
) (RecordCollectionWire, Tag, error)

PatchRecords applies PATCH operations within the scope.

func (*InMemoryBackend) Pull

func (b *InMemoryBackend) Pull(ctx context.Context, zoneID string) error

Pull transfers a SECONDARY zone from its external masters now, trying them in order, and returns the joined errors when none of them delivered the zone.

func (*InMemoryBackend) Reset

func (b *InMemoryBackend) Reset()

Reset clears all state.

func (*InMemoryBackend) ResolverIDForVcn

func (b *InMemoryBackend) ResolverIDForVcn(vcnID string) (string, bool)

ResolverIDForVcn returns the private resolver id of a VCN.

func (*InMemoryBackend) Restore

func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error

Restore loads backend state from a snapshot.

func (*InMemoryBackend) RunTransfers

func (b *InMemoryBackend) RunTransfers(ctx context.Context)

RunTransfers performs zone transfers and NOTIFYs until ctx ends: it pulls SECONDARY zones from their external masters when they are created, changed, notified or due by their SOA timers, and notifies external downstreams of changes to PRIMARY zones.

func (*InMemoryBackend) SetClock

func (b *InMemoryBackend) SetClock(now func() time.Time)

SetClock injects the time source for timestamps.

func (*InMemoryBackend) SetCompartmentChecker

func (b *InMemoryBackend) SetCompartmentChecker(fn func(string) bool)

SetCompartmentChecker validates compartmentId arguments against another service (OCI Identity).

func (*InMemoryBackend) SetSelfBase

func (b *InMemoryBackend) SetSelfBase(base string)

SetSelfBase sets the base URL rendered in the `self` field of resources.

func (*InMemoryBackend) SetSubnetResolver

func (b *InMemoryBackend) SetSubnetResolver(fn func(string) (SubnetInfo, bool))

SetSubnetResolver looks up subnets for resolver endpoints (OCI Core).

func (*InMemoryBackend) SetTagLookup

func (b *InMemoryBackend) SetTagLookup(fn ocitags.Lookup)

SetTagLookup wires defined-tag validation against a tag namespace source (OCI Identity); nil accepts any namespace.

func (*InMemoryBackend) SetVcnSource

func (b *InMemoryBackend) SetVcnSource(fn func() []VcnInfo)

SetVcnSource lists the VCNs that own a private resolver (OCI Core).

func (*InMemoryBackend) Snapshot

func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte

Snapshot serialises every resource and the registered API keys.

func (*InMemoryBackend) SyncVcns

func (b *InMemoryBackend) SyncVcns()

SyncVcns creates a resolver and a protected default view for every VCN and drops those of deleted VCNs.

func (*InMemoryBackend) UpdateAttachment

func (b *InMemoryBackend) UpdateAttachment(id string, c cond, in UpdateAttachmentIn) (AttachmentWire, Tag, error)

UpdateAttachment changes the display name of an attachment.

func (*InMemoryBackend) UpdateEndpoint

func (b *InMemoryBackend) UpdateEndpoint(
	resolverID, name string,
	c cond,
	in UpdateEndpointIn,
) (EndpointWire, Tag, error)

UpdateEndpoint changes the tags and network security groups of an endpoint.

func (*InMemoryBackend) UpdateRecords

func (b *InMemoryBackend) UpdateRecords(
	r ZoneRef,
	c cond,
	s RecordScope,
	in ItemsIn,
) (RecordCollectionWire, Tag, error)

UpdateRecords replaces the records within the scope.

func (*InMemoryBackend) UpdateResolver

func (b *InMemoryBackend) UpdateResolver(id string, c cond, in UpdateResolverIn) (ResolverWire, Tag, error)

UpdateResolver changes the name, tags, attached views and rules of a resolver.

func (*InMemoryBackend) UpdateSteeringPolicy

func (b *InMemoryBackend) UpdateSteeringPolicy(id string, c cond, in UpdatePolicyIn) (SteeringPolicyWire, Tag, error)

UpdateSteeringPolicy changes a steering policy; attachments pick up the new answers' record types.

func (*InMemoryBackend) UpdateTsigKey

func (b *InMemoryBackend) UpdateTsigKey(id string, c cond, in UpdateTsigKeyIn) (TsigKeyWire, Tag, error)

UpdateTsigKey changes the tags of a TSIG key.

func (*InMemoryBackend) UpdateView

func (b *InMemoryBackend) UpdateView(id string, c cond, in UpdateViewIn) (ViewWire, Tag, error)

UpdateView changes the mutable attributes of a view.

func (*InMemoryBackend) UpdateZone

func (b *InMemoryBackend) UpdateZone(r ZoneRef, c cond, in UpdateZoneIn) (ZoneWire, Tag, error)

UpdateZone changes the mutable attributes of a zone.

func (*InMemoryBackend) ZoneContent

func (b *InMemoryBackend) ZoneContent(r ZoneRef) (string, Tag, error)

ZoneContent renders a zone in RFC 1035 master file format.

type ItemsIn

type ItemsIn struct {
	Items []RecordIn `json:"items"`
}

ItemsIn is the body of the record PATCH and PUT operations.

type ListOpts

type ListOpts struct {
	SortBy string
	Order  string
	Page   string
	Limit  int
}

ListOpts carries the shared list query parameters.

type ListResult

type ListResult[T any] struct {
	Next  string
	Items []T
	Total int
}

ListResult is a page of items and the number of items that matched before paging.

type PolicyFilter

type PolicyFilter struct {
	Created  func(time.Time) bool
	Compart  string
	ID       string
	Name     string
	Contains string
	Monitor  string
	Template string
	State    string
}

PolicyFilter selects steering policies in a list.

type Provider

type Provider struct{}

Provider implements service.Provider for OCI DNS. It runs on its own listeners (see Handler.StartWorker) and never matches on the shared AWS router.

func (*Provider) Init

Init creates the backend and handler; the ports are bound in StartWorker.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the service provider name.

type RRSet

type RRSet struct {
	Domain  string   `json:"domain"`
	Rtype   string   `json:"rtype"`
	Rdata   []string `json:"rdata"`
	TTL     int      `json:"ttl"`
	Version int64    `json:"version"`
}

RRSet is the records of one domain and type; they share one TTL.

type RecordCollectionWire

type RecordCollectionWire struct {
	Items []recordWire `json:"items"`
}

RecordCollectionWire is the RecordCollection and RrSet body.

type RecordFilter

type RecordFilter struct {
	Domain         string
	DomainContains string
	Rtype          string
	ZoneVersion    string
}

RecordFilter selects records of a zone.

type RecordIn

type RecordIn struct {
	Domain       *string `json:"domain"`
	Rdata        *string `json:"rdata"`
	Rtype        *string `json:"rtype"`
	TTL          *int    `json:"ttl"`
	RecordHash   *string `json:"recordHash"`
	RrsetVersion *string `json:"rrsetVersion"`
	IsProtected  *bool   `json:"isProtected"`
	Operation    string  `json:"operation"`
}

RecordIn is a record or a PATCH operation in a request body.

type RecordList

type RecordList = ListResult[recordWire]

RecordList is a page of records with the matching total.

type RecordScope

type RecordScope struct {
	Domain string
	Rtype  string
}

RecordScope restricts a record operation to a domain and record type.

type Resolver

type Resolver struct {
	Created time.Time `json:"created"`
	Updated time.Time `json:"updated"`

	Tags
	ID            string         `json:"id"`
	CompartmentID string         `json:"compartmentId"`
	DisplayName   string         `json:"displayName"`
	VcnID         string         `json:"vcnId"`
	DefaultViewID string         `json:"defaultViewId"`
	AttachedViews []string       `json:"attachedViews"`
	Rules         []ResolverRule `json:"rules"`
	Seq           int64          `json:"seq"`
	// contains filtered or unexported fields
}

Resolver is the private resolver of a VCN.

type ResolverFilter

type ResolverFilter struct {
	Compart string
	Name    string
	ID      string
	State   string
}

ResolverFilter selects resolvers in a list.

type ResolverRule

type ResolverRule struct {
	SourceEndpointName      string   `json:"sourceEndpointName"`
	ClientAddressConditions []string `json:"clientAddressConditions"`
	QnameCoverConditions    []string `json:"qnameCoverConditions"`
	DestinationAddresses    []string `json:"destinationAddresses"`
}

ResolverRule is a resolver forwarding rule.

type ResolverSummaryWire

type ResolverSummaryWire struct {
	TimeCreated    time.Time                 `json:"timeCreated"`
	TimeUpdated    time.Time                 `json:"timeUpdated"`
	FreeformTags   map[string]string         `json:"freeformTags"`
	DefinedTags    map[string]map[string]any `json:"definedTags"`
	CompartmentID  string                    `json:"compartmentId"`
	DisplayName    string                    `json:"displayName"`
	ID             string                    `json:"id"`
	LifecycleState string                    `json:"lifecycleState"`
	Self           string                    `json:"self"`
	AttachedVcnID  string                    `json:"attachedVcnId"`
	DefaultViewID  string                    `json:"defaultViewId"`
	IsProtected    bool                      `json:"isProtected"`
}

ResolverSummaryWire is the list form of a resolver.

type ResolverWire

type ResolverWire struct {
	TimeCreated    time.Time                 `json:"timeCreated"`
	TimeUpdated    time.Time                 `json:"timeUpdated"`
	FreeformTags   map[string]string         `json:"freeformTags"`
	DefinedTags    map[string]map[string]any `json:"definedTags"`
	CompartmentID  string                    `json:"compartmentId"`
	DisplayName    string                    `json:"displayName"`
	ID             string                    `json:"id"`
	LifecycleState string                    `json:"lifecycleState"`
	Self           string                    `json:"self"`
	AttachedVcnID  string                    `json:"attachedVcnId"`
	DefaultViewID  string                    `json:"defaultViewId"`
	Endpoints      []EndpointWire            `json:"endpoints"`
	AttachedViews  []attachedViewWire        `json:"attachedViews"`
	Rules          []ruleWire                `json:"rules"`
	IsProtected    bool                      `json:"isProtected"`
}

ResolverWire is the wire form of a resolver.

type RuleIn

type RuleIn struct {
	SourceEndpointName      string   `json:"sourceEndpointName"`
	Action                  string   `json:"action"`
	ClientAddressConditions []string `json:"clientAddressConditions"`
	QnameCoverConditions    []string `json:"qnameCoverConditions"`
	DestinationAddresses    []string `json:"destinationAddresses"`
}

RuleIn is a resolver rule in an UpdateResolver body.

type Settings

type Settings struct {
	Port int `` //nolint:lll // config struct tags are intentionally verbose
	/* 188-byte string literal not displayed */
	DNSPort int `` //nolint:lll // config struct tags are intentionally verbose
	/* 242-byte string literal not displayed */
	EnforceAuth bool `` //nolint:lll // config struct tags are intentionally verbose
	/* 233-byte string literal not displayed */
}

Settings holds service-level configuration, embedded in the root CLI as CLI.OCIDNS.

func DefaultSettings

func DefaultSettings() Settings

DefaultSettings returns the settings used when no ConfigProvider is available.

type SteeringPolicy

type SteeringPolicy struct {
	Created time.Time `json:"created"`

	Tags
	ID                   string           `json:"id"`
	CompartmentID        string           `json:"compartmentId"`
	DisplayName          string           `json:"displayName"`
	Template             string           `json:"template"`
	HealthCheckMonitorID string           `json:"healthCheckMonitorId,omitempty"`
	Answers              []map[string]any `json:"answers"`
	Rules                []map[string]any `json:"rules"`
	TTL                  int              `json:"ttl"`
	Seq                  int64            `json:"seq"`
	// contains filtered or unexported fields
}

SteeringPolicy is a stored traffic steering policy; it is not evaluated.

type SteeringPolicySummaryWire

type SteeringPolicySummaryWire struct {
	TimeCreated          time.Time                 `json:"timeCreated"`
	FreeformTags         map[string]string         `json:"freeformTags"`
	DefinedTags          map[string]map[string]any `json:"definedTags"`
	HealthCheckMonitorID *string                   `json:"healthCheckMonitorId"`
	CompartmentID        string                    `json:"compartmentId"`
	DisplayName          string                    `json:"displayName"`
	Template             string                    `json:"template"`
	Self                 string                    `json:"self"`
	ID                   string                    `json:"id"`
	LifecycleState       string                    `json:"lifecycleState"`
	TTL                  int                       `json:"ttl"`
}

SteeringPolicySummaryWire is the list form of a steering policy.

type SteeringPolicyWire

type SteeringPolicyWire struct {
	TimeCreated          time.Time                 `json:"timeCreated"`
	FreeformTags         map[string]string         `json:"freeformTags"`
	DefinedTags          map[string]map[string]any `json:"definedTags"`
	HealthCheckMonitorID *string                   `json:"healthCheckMonitorId"`
	CompartmentID        string                    `json:"compartmentId"`
	DisplayName          string                    `json:"displayName"`
	Template             string                    `json:"template"`
	Self                 string                    `json:"self"`
	ID                   string                    `json:"id"`
	LifecycleState       string                    `json:"lifecycleState"`
	Answers              []map[string]any          `json:"answers"`
	Rules                []map[string]any          `json:"rules"`
	TTL                  int                       `json:"ttl"`
}

SteeringPolicyWire is the wire form of a steering policy.

type SubnetInfo

type SubnetInfo struct {
	VcnID string
	Cidr  string
}

SubnetInfo is the part of a subnet endpoints are validated against.

type Tag

type Tag struct {
	Modified time.Time
	ETag     string
}

Tag is the etag and modification time returned with a resource.

type Tags

type Tags struct {
	FreeformTags map[string]string         `json:"freeformTags,omitempty"`
	DefinedTags  map[string]map[string]any `json:"definedTags,omitempty"`
}

Tags are the shared freeform and defined tag sets of a resource.

type TransferWire

type TransferWire struct {
	Address               string `json:"address"`
	Port                  int    `json:"port"`
	IsTransferSource      bool   `json:"isTransferSource"`
	IsTransferDestination bool   `json:"isTransferDestination"`
}

TransferWire is the zone transfer server wire shape.

type TsigFilter

type TsigFilter struct {
	Compart string
	ID      string
	Name    string
	State   string
}

TsigFilter selects TSIG keys in a list.

type TsigKey

type TsigKey struct {
	Created time.Time `json:"created"`
	Updated time.Time `json:"updated"`

	Tags
	ID            string `json:"id"`
	CompartmentID string `json:"compartmentId"`
	Name          string `json:"name"`
	Algorithm     string `json:"algorithm"`
	Secret        string `json:"secret"`
	Seq           int64  `json:"seq"`
	// contains filtered or unexported fields
}

TsigKey is a TSIG key.

type TsigKeySummaryWire

type TsigKeySummaryWire struct {
	TimeCreated    time.Time                 `json:"timeCreated"`
	FreeformTags   map[string]string         `json:"freeformTags"`
	DefinedTags    map[string]map[string]any `json:"definedTags"`
	Algorithm      string                    `json:"algorithm"`
	Name           string                    `json:"name"`
	CompartmentID  string                    `json:"compartmentId"`
	ID             string                    `json:"id"`
	Self           string                    `json:"self"`
	LifecycleState string                    `json:"lifecycleState"`
}

TsigKeySummaryWire is the list form of a TSIG key: it omits the secret.

type TsigKeyWire

type TsigKeyWire struct {
	TimeCreated    time.Time                 `json:"timeCreated"`
	TimeUpdated    time.Time                 `json:"timeUpdated"`
	FreeformTags   map[string]string         `json:"freeformTags"`
	DefinedTags    map[string]map[string]any `json:"definedTags"`
	Algorithm      string                    `json:"algorithm"`
	Name           string                    `json:"name"`
	CompartmentID  string                    `json:"compartmentId"`
	Secret         string                    `json:"secret"`
	ID             string                    `json:"id"`
	Self           string                    `json:"self"`
	LifecycleState string                    `json:"lifecycleState"`
}

TsigKeyWire is the wire form of a TSIG key, secret included.

type UpdateAttachmentIn

type UpdateAttachmentIn struct {
	DisplayName *string `json:"displayName"`
}

UpdateAttachmentIn is the body of UpdateSteeringPolicyAttachment.

type UpdateEndpointIn

type UpdateEndpointIn struct {
	Tags
	NsgIDs       *[]string `json:"nsgIds"`
	EndpointType string    `json:"endpointType"`
}

UpdateEndpointIn is the body of UpdateResolverEndpoint.

type UpdatePolicyIn

type UpdatePolicyIn struct {
	Tags
	DisplayName          *string          `json:"displayName"`
	TTL                  *int             `json:"ttl"`
	HealthCheckMonitorID *string          `json:"healthCheckMonitorId"`
	Template             string           `json:"template"`
	Answers              []map[string]any `json:"answers"`
	Rules                []map[string]any `json:"rules"`
}

UpdatePolicyIn is the body of UpdateSteeringPolicy.

type UpdateResolverIn

type UpdateResolverIn struct {
	Tags
	DisplayName   *string            `json:"displayName"`
	Rules         *[]RuleIn          `json:"rules"`
	AttachedViews []attachedViewWire `json:"attachedViews"`
}

UpdateResolverIn is the body of UpdateResolver.

type UpdateTsigKeyIn

type UpdateTsigKeyIn struct {
	Tags
}

UpdateTsigKeyIn is the body of UpdateTsigKey.

type UpdateViewIn

type UpdateViewIn struct {
	Tags
	DisplayName *string `json:"displayName"`
}

UpdateViewIn is the body of UpdateView.

type UpdateZoneIn

type UpdateZoneIn struct {
	Tags
	ResolutionMode      string      `json:"resolutionMode"`
	DnssecState         string      `json:"dnssecState"`
	ExternalMasters     []ExtServer `json:"externalMasters"`
	ExternalDownstreams []ExtServer `json:"externalDownstreams"`
}

UpdateZoneIn is the body of UpdateZone.

type VcnInfo

type VcnInfo struct {
	Created       time.Time
	ID            string
	CompartmentID string
	DisplayName   string
}

VcnInfo is a VCN a private resolver is attached to.

type View

type View struct {
	Created time.Time `json:"created"`
	Updated time.Time `json:"updated"`

	Tags
	ID            string `json:"id"`
	CompartmentID string `json:"compartmentId"`
	DisplayName   string `json:"displayName"`
	Seq           int64  `json:"seq"`
	Protected     bool   `json:"protected"`
	// contains filtered or unexported fields
}

View is a private DNS view.

type ViewFilter

type ViewFilter struct {
	Compart string
	Name    string
	ID      string
	State   string
	Scope   string
}

ViewFilter selects views in a list.

type ViewWire

type ViewWire struct {
	TimeCreated    time.Time                 `json:"timeCreated"`
	TimeUpdated    time.Time                 `json:"timeUpdated"`
	FreeformTags   map[string]string         `json:"freeformTags"`
	DefinedTags    map[string]map[string]any `json:"definedTags"`
	CompartmentID  string                    `json:"compartmentId"`
	DisplayName    string                    `json:"displayName"`
	ID             string                    `json:"id"`
	Self           string                    `json:"self"`
	LifecycleState string                    `json:"lifecycleState"`
	IsProtected    bool                      `json:"isProtected"`
}

ViewWire is the wire form of a view.

type Zone

type Zone struct {
	Created      time.Time         `json:"created"`
	LastTransfer time.Time         `json:"lastTransfer,omitzero"`
	Records      map[string]*RRSet `json:"records"`
	ApexSOA      *RRSet            `json:"apexSoa,omitempty"`
	ApexNS       *RRSet            `json:"apexNs,omitempty"`
	History      []ZoneRevision    `json:"history,omitempty"`

	Tags
	ID                  string      `json:"id"`
	Name                string      `json:"name"`
	ZoneType            string      `json:"zoneType"`
	CompartmentID       string      `json:"compartmentId"`
	Scope               string      `json:"scope"`
	ViewID              string      `json:"viewId,omitempty"`
	ResolutionMode      string      `json:"resolutionMode"`
	DnssecState         string      `json:"dnssecState"`
	ExternalMasters     []ExtServer `json:"externalMasters"`
	ExternalDownstreams []ExtServer `json:"externalDownstreams"`
	Version             int64       `json:"version"`
	Seq                 int64       `json:"seq"`
	// contains filtered or unexported fields
}

Zone is a DNS zone with its records.

type ZoneFilter

type ZoneFilter struct {
	Created   func(time.Time) bool
	Compart   string
	Name      string
	Contains  string
	ZoneType  string
	State     string
	Scope     string
	ViewID    string
	TsigKeyID string
	Dnssec    string
}

ZoneFilter selects zones in a list.

type ZoneRef

type ZoneRef struct {
	Ref    string
	Scope  string
	ViewID string
}

ZoneRef addresses a zone by name or OCID, with the scope and view that disambiguate a name.

type ZoneRevision

type ZoneRevision struct {
	Records map[string]*RRSet `json:"records"`
	Version int64             `json:"version"`
}

ZoneRevision is the user records of an earlier zone version.

type ZoneSummaryWire

type ZoneSummaryWire struct {
	TimeCreated    time.Time                 `json:"timeCreated"`
	FreeformTags   map[string]string         `json:"freeformTags"`
	DefinedTags    map[string]map[string]any `json:"definedTags"`
	ViewID         *string                   `json:"viewId,omitempty"`
	Name           string                    `json:"name"`
	ZoneType       string                    `json:"zoneType"`
	CompartmentID  string                    `json:"compartmentId"`
	Scope          string                    `json:"scope"`
	ResolutionMode string                    `json:"resolutionMode"`
	DnssecState    string                    `json:"dnssecState"`
	Self           string                    `json:"self"`
	ID             string                    `json:"id"`
	Version        string                    `json:"version"`
	LifecycleState string                    `json:"lifecycleState"`
	Serial         int64                     `json:"serial"`
	IsProtected    bool                      `json:"isProtected"`
}

ZoneSummaryWire is the wire form of a zone in a list.

type ZoneWire

type ZoneWire struct {
	TimeCreated         time.Time                 `json:"timeCreated"`
	FreeformTags        map[string]string         `json:"freeformTags"`
	DefinedTags         map[string]map[string]any `json:"definedTags"`
	ViewID              *string                   `json:"viewId,omitempty"`
	Name                string                    `json:"name"`
	ZoneType            string                    `json:"zoneType"`
	CompartmentID       string                    `json:"compartmentId"`
	Scope               string                    `json:"scope"`
	ResolutionMode      string                    `json:"resolutionMode"`
	DnssecState         string                    `json:"dnssecState"`
	Self                string                    `json:"self"`
	ID                  string                    `json:"id"`
	Version             string                    `json:"version"`
	LifecycleState      string                    `json:"lifecycleState"`
	ExternalMasters     []extWire                 `json:"externalMasters"`
	ExternalDownstreams []extWire                 `json:"externalDownstreams"`
	Nameservers         []nameserverWire          `json:"nameservers"`
	ZoneTransferServers []TransferWire            `json:"zoneTransferServers,omitempty"`
	Serial              int64                     `json:"serial"`
	IsProtected         bool                      `json:"isProtected"`
}

ZoneWire is the wire form of a zone.

Jump to

Keyboard shortcuts

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