rtypecontrol

package
v4.28.1 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Func map[string]RType = map[string]RType{}

Map of registered rtypes.

Functions

func ImportRawRecords added in v4.28.0

func ImportRawRecords(domains []*models.DomainConfig) error

ImportRawRecords imports the RawRecordConfigs into RecordConfigs.

func IsModernType added in v4.28.0

func IsModernType(name string) bool

func NewRecordConfigFromRaw added in v4.28.0

func NewRecordConfigFromRaw(t string, ttl uint32, args []any, dcn *domaintags.DomainNameVarieties) (*models.RecordConfig, error)

func NewRecordConfigFromString added in v4.28.0

func NewRecordConfigFromString(name string, ttl uint32, t string, s string, dcn *domaintags.DomainNameVarieties) (*models.RecordConfig, error)

func NewRecordConfigFromStruct added in v4.28.0

func NewRecordConfigFromStruct(name string, ttl uint32, t string, fields any, dcn *domaintags.DomainNameVarieties) (*models.RecordConfig, error)

func PaveArgs added in v4.12.5

func PaveArgs(args []any, argTypes string) error

PaveArgs converts each arg to its desired type, or returns an error if conversion fails or if the number of arguments is wrong. argTypes is a string where each rune specifies the desired type of the arg in the same position: 'i': uinet16 (will convert strings, truncate floats, etc) 's': Valid only if string.

func Register

func Register(t RType)

Types

type RType added in v4.28.0

type RType interface {
	// Returns the name of the rtype ("A", "MX", etc.)
	Name() string

	// RecordConfig factory. Updates a RecordConfig's fields based on args.
	FromArgs(*domaintags.DomainNameVarieties, *models.RecordConfig, []any) error
	FromStruct(*domaintags.DomainNameVarieties, *models.RecordConfig, string, any) error

	CopyToLegacyFields(*models.RecordConfig)
}

Jump to

Keyboard shortcuts

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