mx

package
v0.63.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package mx provides a DNS MX record type for use with connect tunnels.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Record

type Record struct {
	// Priority is the MX preference value.
	Priority uint16 `mapstructure:"priority" json:"priority"`
	// Host is a Go template string for the mail exchange FQDN (must end in ".").
	// Empty defaults to "{{.Domain}}." at render time — the tunnel's own FQDN.
	Host string `mapstructure:"host" json:"host,omitempty"`
	// Prefix is the DNS owner label relative to the base domain. "" = apex.
	Prefix string `mapstructure:"prefix" json:"prefix,omitempty"`
	// TTL is the DNS TTL in seconds advertised to resolvers. Zero uses dns.DefaultTTL.
	TTL uint32 `mapstructure:"ttl" json:"ttl,omitempty"`
}

Record is a DNS MX record following the same Render pattern as dmarc.Record and spf.Record: fields may contain Go template strings expanded at render time.

func (*Record) Empty

func (r *Record) Empty() bool

func (*Record) RecordPrefix

func (r *Record) RecordPrefix() string

func (*Record) RecordTTL

func (r *Record) RecordTTL() uint32

RecordTTL returns the TTL to use for this record, falling back to dns.DefaultTTL.

func (*Record) RecordType

func (r *Record) RecordType() string

func (*Record) RecordValue

func (r *Record) RecordValue() string

func (*Record) Render

func (r *Record) Render(data any) error

Render expands the Host template. An empty Host defaults to "{{.Domain}}." before expansion so the MX target resolves to the tunnel's own FQDN.

Jump to

Keyboard shortcuts

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