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
- Variables
- type APIError
- type Attachment
- type AttachmentFilter
- type AttachmentWire
- type ChangeCompartmentIn
- type ConfigProvider
- type CreateAttachmentIn
- type CreateEndpointIn
- type CreatePolicyIn
- type CreateTsigKeyIn
- type CreateViewIn
- type CreateZoneIn
- type Endpoint
- type EndpointWire
- type ExtServer
- type Handler
- func (h *Handler) DataPlanePort() int
- func (h *Handler) ExtractOperation(c *echo.Context) string
- func (h *Handler) ExtractResource(c *echo.Context) string
- func (h *Handler) GetSupportedOperations() []string
- func (h *Handler) Handler() echo.HandlerFunc
- func (h *Handler) MatchPriority() int
- func (h *Handler) Name() string
- func (h *Handler) Reset()
- func (h *Handler) Restore(ctx context.Context, data []byte) error
- func (h *Handler) RouteMatcher() service.Matcher
- func (h *Handler) Shutdown(ctx context.Context)
- func (h *Handler) Snapshot(ctx context.Context) []byte
- func (h *Handler) StartWorker(ctx context.Context) error
- func (h *Handler) Trusted() echo.HandlerFunc
- type InMemoryBackend
- func (b *InMemoryBackend) Answer(req *dns.Msg, network string) *dns.Msg
- func (b *InMemoryBackend) ChangeResolverCompartment(id string, c cond, in ChangeCompartmentIn) error
- func (b *InMemoryBackend) ChangeSteeringPolicyCompartment(id string, c cond, in ChangeCompartmentIn) error
- func (b *InMemoryBackend) ChangeTsigKeyCompartment(id string, c cond, in ChangeCompartmentIn) error
- func (b *InMemoryBackend) ChangeViewCompartment(id string, c cond, in ChangeCompartmentIn) error
- func (b *InMemoryBackend) ChangeZoneCompartment(r ZoneRef, c cond, in ChangeCompartmentIn) error
- func (b *InMemoryBackend) Compartments() []string
- func (b *InMemoryBackend) CreateAttachment(in CreateAttachmentIn) (AttachmentWire, Tag, error)
- func (b *InMemoryBackend) CreateEndpoint(resolverID string, in CreateEndpointIn) (EndpointWire, Tag, error)
- func (b *InMemoryBackend) CreateSteeringPolicy(in CreatePolicyIn) (SteeringPolicyWire, Tag, error)
- func (b *InMemoryBackend) CreateTsigKey(in CreateTsigKeyIn) (TsigKeyWire, Tag, error)
- func (b *InMemoryBackend) CreateView(in CreateViewIn) (ViewWire, Tag, error)
- func (b *InMemoryBackend) CreateZone(in CreateZoneIn) (ZoneWire, Tag, error)
- func (b *InMemoryBackend) CreateZoneFromFile(compartment, scope, viewID, text, token string) (ZoneWire, Tag, error)
- func (b *InMemoryBackend) DeleteAttachment(id string, c cond) error
- func (b *InMemoryBackend) DeleteEndpoint(resolverID, name string, c cond) error
- func (b *InMemoryBackend) DeleteRecords(r ZoneRef, c cond, s RecordScope) error
- func (b *InMemoryBackend) DeleteSteeringPolicy(id string, c cond) error
- func (b *InMemoryBackend) DeleteTsigKey(id string, c cond) error
- func (b *InMemoryBackend) DeleteView(id string, c cond) error
- func (b *InMemoryBackend) DeleteZone(r ZoneRef, c cond) error
- func (b *InMemoryBackend) GetAttachment(id string) (AttachmentWire, Tag, error)
- func (b *InMemoryBackend) GetEndpoint(resolverID, name string) (EndpointWire, Tag, error)
- func (b *InMemoryBackend) GetRecords(r ZoneRef, f RecordFilter, o ListOpts, mustExist bool) (RecordList, Tag, error)
- func (b *InMemoryBackend) GetResolver(id string) (ResolverWire, Tag, error)
- func (b *InMemoryBackend) GetSteeringPolicy(id string) (SteeringPolicyWire, Tag, error)
- func (b *InMemoryBackend) GetTsigKey(id string) (TsigKeyWire, Tag, error)
- func (b *InMemoryBackend) GetView(id string) (ViewWire, Tag, error)
- func (b *InMemoryBackend) GetZone(r ZoneRef) (ZoneWire, Tag, error)
- func (b *InMemoryBackend) HoldsInCompartment(compartmentID string) string
- func (b *InMemoryBackend) ListAttachments(f AttachmentFilter, o ListOpts) (ListResult[AttachmentWire], error)
- func (b *InMemoryBackend) ListEndpoints(resolverID, name, state string, o ListOpts) (ListResult[EndpointWire], error)
- func (b *InMemoryBackend) ListResolvers(f ResolverFilter, o ListOpts) (ListResult[ResolverSummaryWire], error)
- func (b *InMemoryBackend) ListSteeringPolicies(f PolicyFilter, o ListOpts) (ListResult[SteeringPolicySummaryWire], error)
- func (b *InMemoryBackend) ListTsigKeys(f TsigFilter, o ListOpts) (ListResult[TsigKeySummaryWire], error)
- func (b *InMemoryBackend) ListViews(f ViewFilter, o ListOpts) (ListResult[ViewWire], error)
- func (b *InMemoryBackend) ListZoneTransferServers(compartment string, o ListOpts) (ListResult[TransferWire], error)
- func (b *InMemoryBackend) ListZones(f ZoneFilter, o ListOpts) (ListResult[ZoneSummaryWire], error)
- func (b *InMemoryBackend) PatchRecords(r ZoneRef, c cond, s RecordScope, in ItemsIn) (RecordCollectionWire, Tag, error)
- func (b *InMemoryBackend) Pull(ctx context.Context, zoneID string) error
- func (b *InMemoryBackend) Reset()
- func (b *InMemoryBackend) ResolverIDForVcn(vcnID string) (string, bool)
- func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
- func (b *InMemoryBackend) RunTransfers(ctx context.Context)
- func (b *InMemoryBackend) SetClock(now func() time.Time)
- func (b *InMemoryBackend) SetCompartmentChecker(fn func(string) bool)
- func (b *InMemoryBackend) SetSelfBase(base string)
- func (b *InMemoryBackend) SetSubnetResolver(fn func(string) (SubnetInfo, bool))
- func (b *InMemoryBackend) SetTagLookup(fn ocitags.Lookup)
- func (b *InMemoryBackend) SetVcnSource(fn func() []VcnInfo)
- func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
- func (b *InMemoryBackend) SyncVcns()
- func (b *InMemoryBackend) UpdateAttachment(id string, c cond, in UpdateAttachmentIn) (AttachmentWire, Tag, error)
- func (b *InMemoryBackend) UpdateEndpoint(resolverID, name string, c cond, in UpdateEndpointIn) (EndpointWire, Tag, error)
- func (b *InMemoryBackend) UpdateRecords(r ZoneRef, c cond, s RecordScope, in ItemsIn) (RecordCollectionWire, Tag, error)
- func (b *InMemoryBackend) UpdateResolver(id string, c cond, in UpdateResolverIn) (ResolverWire, Tag, error)
- func (b *InMemoryBackend) UpdateSteeringPolicy(id string, c cond, in UpdatePolicyIn) (SteeringPolicyWire, Tag, error)
- func (b *InMemoryBackend) UpdateTsigKey(id string, c cond, in UpdateTsigKeyIn) (TsigKeyWire, Tag, error)
- func (b *InMemoryBackend) UpdateView(id string, c cond, in UpdateViewIn) (ViewWire, Tag, error)
- func (b *InMemoryBackend) UpdateZone(r ZoneRef, c cond, in UpdateZoneIn) (ZoneWire, Tag, error)
- func (b *InMemoryBackend) ZoneContent(r ZoneRef) (string, Tag, error)
- type ItemsIn
- type ListOpts
- type ListResult
- type PolicyFilter
- type Provider
- type RRSet
- type RecordCollectionWire
- type RecordFilter
- type RecordIn
- type RecordList
- type RecordScope
- type Resolver
- type ResolverFilter
- type ResolverRule
- type ResolverSummaryWire
- type ResolverWire
- type RuleIn
- type Settings
- type SteeringPolicy
- type SteeringPolicySummaryWire
- type SteeringPolicyWire
- type SubnetInfo
- type Tag
- type Tags
- type TransferWire
- type TsigFilter
- type TsigKey
- type TsigKeySummaryWire
- type TsigKeyWire
- type UpdateAttachmentIn
- type UpdateEndpointIn
- type UpdatePolicyIn
- type UpdateResolverIn
- type UpdateTsigKeyIn
- type UpdateViewIn
- type UpdateZoneIn
- type VcnInfo
- type View
- type ViewFilter
- type ViewWire
- type Zone
- type ZoneFilter
- type ZoneRef
- type ZoneRevision
- type ZoneSummaryWire
- type ZoneWire
Constants ¶
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 )
const (
// Version is the OCI DNS API version served.
Version = "20180115"
)
Variables ¶
var ErrNilAppContext = errors.New("ocidns: nil app context")
ErrNilAppContext is returned when Init is called with a nil AppContext.
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 ¶
APIError is an OCI error response: HTTP status plus the `code` and `message` body fields.
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 ¶
DataPlanePort is the bound port of the authoritative DNS server, 0 while it is not running.
func (*Handler) ExtractOperation ¶
ExtractOperation returns the operation name for metrics.
func (*Handler) ExtractResource ¶
ExtractResource returns the addressed resource id for metrics.
func (*Handler) GetSupportedOperations ¶
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 ¶
MatchPriority is irrelevant because RouteMatcher never matches.
func (*Handler) RouteMatcher ¶
RouteMatcher never matches: OCIDNS runs on its own listener.
func (*Handler) Snapshot ¶
Snapshot implements persistence.Persistable by delegating to the backend.
func (*Handler) StartWorker ¶
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 ¶
InMemoryBackend holds every resource under one lock.
func NewInMemoryBackend ¶
func NewInMemoryBackend() *InMemoryBackend
NewInMemoryBackend creates an empty backend.
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 ¶
func (b *InMemoryBackend) ListAttachments(f AttachmentFilter, o ListOpts) (ListResult[AttachmentWire], error)
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 ¶
func (b *InMemoryBackend) ListResolvers(f ResolverFilter, o ListOpts) (ListResult[ResolverSummaryWire], error)
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 ¶
func (b *InMemoryBackend) ListTsigKeys(f TsigFilter, o ListOpts) (ListResult[TsigKeySummaryWire], error)
ListTsigKeys lists the TSIG keys of a compartment; secrets are never included.
func (*InMemoryBackend) ListViews ¶
func (b *InMemoryBackend) ListViews(f ViewFilter, o ListOpts) (ListResult[ViewWire], error)
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 ¶
func (b *InMemoryBackend) ListZones(f ZoneFilter, o ListOpts) (ListResult[ZoneSummaryWire], error)
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) 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 ListResult ¶
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 ¶
func (p *Provider) Init(ctx *service.AppContext) (service.Registerable, error)
Init creates the backend and handler; the ports are bound in StartWorker.
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 ¶
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 ¶
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 ¶
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 ¶
SubnetInfo is the part of a subnet endpoints are validated against.
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 ¶
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 ¶
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 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 ¶
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 ¶
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.