prettyprint

package
v0.99.4 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package prettyprint holds pretty printer for internal models.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONPrinter

type JSONPrinter struct{}

JSONPrinter prints in JSON format.

func (*JSONPrinter) RecordAdd

func (pp *JSONPrinter) RecordAdd(rr models.DNSRecord)

RecordAdd displays information about a new DNS resource record.

func (*JSONPrinter) RecordDel

func (pp *JSONPrinter) RecordDel(rr models.DNSRecord)

RecordDel displays information about a deleted DNS recource record.

func (*JSONPrinter) RecordInfo

func (pp *JSONPrinter) RecordInfo(rr models.DNSRecord)

RecordInfo displays information about a specified DNS resource record.

func (*JSONPrinter) RecordUpdate

func (pp *JSONPrinter) RecordUpdate(rr models.DNSRecord)

RecordUpdate displays information about an updated DNS resource record.

func (*JSONPrinter) RecordsList

func (pp *JSONPrinter) RecordsList(rrset []models.DNSRecord)

RecordsList prints list of DNS resource records.

func (*JSONPrinter) ZonesList

func (pp *JSONPrinter) ZonesList(zones []models.Zone, providerName string)

ZonesList prints list of DNS zones.

type NonePrinter

type NonePrinter struct{}

NonePrinter don't print enythings. Use for scripts when output not needed.

func (*NonePrinter) RecordAdd

func (pp *NonePrinter) RecordAdd(rr models.DNSRecord)

RecordAdd displays information about a new DNS resource record.

func (*NonePrinter) RecordDel

func (pp *NonePrinter) RecordDel(rr models.DNSRecord)

RecordDel displays information about a deleted DNS recource record.

func (*NonePrinter) RecordInfo

func (pp *NonePrinter) RecordInfo(rr models.DNSRecord)

RecordInfo displays information about a specified DNS resource record.

func (*NonePrinter) RecordUpdate

func (pp *NonePrinter) RecordUpdate(rr models.DNSRecord)

RecordUpdate displays information about an updated DNS resource record.

func (*NonePrinter) RecordsList

func (pp *NonePrinter) RecordsList(rrset []models.DNSRecord)

RecordsList prints list of DNS resource records.

func (*NonePrinter) ZonesList

func (pp *NonePrinter) ZonesList(zones []models.Zone, providerName string)

ZonesList prints list of DNS zones.

type OutputFormat

type OutputFormat uint

OutputFormat holds supported output formats.

const (
	// FormatText format for human-readable output.
	FormatText OutputFormat = iota
	// FormatJSON format for output in JSON.
	FormatJSON
	// FormatNone format for discarding output.
	FormatNone
)

type PrettyPrinter

type PrettyPrinter interface {
	// ZonesList prints list of DNS zones.
	ZonesList(zones []models.Zone, providerName string)
	// RecordsList prints list of DNS resource records.
	RecordsList(rrset []models.DNSRecord)
	// RecordInfo displays information about a specified DNS resource record.
	RecordInfo(rr models.DNSRecord)
	// RecordAdd displays information about a new DNS resource record.
	RecordAdd(rr models.DNSRecord)
	// RecordDel displays information about a deleted DNS recource record.
	RecordDel(rr models.DNSRecord)
	// RecordUpdate displays information about an updated DNS resource record.
	RecordUpdate(rr models.DNSRecord)
}

PrettyPrinter interface for printing in various formats.

func New

func New(output OutputFormat) PrettyPrinter

New constructs a new TextPrinter

type TextPrinter

type TextPrinter struct{}

TextPrinter prints in human-readable format.

func (*TextPrinter) RecordAdd

func (pp *TextPrinter) RecordAdd(rr models.DNSRecord)

RecordAdd displays information about a new DNS resource record.

func (*TextPrinter) RecordDel

func (pp *TextPrinter) RecordDel(rr models.DNSRecord)

RecordDel displays information about a deleted DNS recource record.

func (*TextPrinter) RecordInfo

func (pp *TextPrinter) RecordInfo(rr models.DNSRecord)

RecordInfo displays information about a specified DNS resource record.

func (*TextPrinter) RecordUpdate

func (pp *TextPrinter) RecordUpdate(rr models.DNSRecord)

RecordUpdate displays information about an updated DNS resource record.

func (*TextPrinter) RecordsList

func (pp *TextPrinter) RecordsList(rrset []models.DNSRecord)

RecordsList prints list of DNS resource records.

func (*TextPrinter) ZonesList

func (pp *TextPrinter) ZonesList(zones []models.Zone, providerName string)

ZonesList prints list of DNS zones.

Jump to

Keyboard shortcuts

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