dns

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package dns provides DNS diagnostic functionality

Package dns provides TUI model for DNS diagnostic tool

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatDNSResult

func FormatDNSResult(result domain.DNSResult) string

FormatDNSResult formats DNS result for display

func GetRecordTypeString

func GetRecordTypeString(recordType domain.DNSRecordType) string

GetRecordTypeString returns a human-readable string for a DNS record type

func ParseRecordTypeString

func ParseRecordTypeString(recordTypeStr string) (domain.DNSRecordType, error)

ParseRecordTypeString parses a string into a DNS record type

func ValidateDNSRecord

func ValidateDNSRecord(record domain.DNSRecord) error

ValidateDNSRecord validates a single DNS record

func ValidateDNSResult

func ValidateDNSResult(result domain.DNSResult) error

ValidateDNSResult validates that a DNS result contains expected data

Types

type Model

type Model struct {
	// contains filtered or unexported fields
}

Model represents the DNS tool TUI model

func NewModel

func NewModel(tool *Tool) *Model

NewModel creates a new DNS model

func (*Model) Blur

func (m *Model) Blur()

Blur blurs the model

func (*Model) Focus

func (m *Model) Focus()

Focus focuses the model

func (*Model) Init

func (m *Model) Init() tea.Cmd

Init initializes the model

func (*Model) SetSize

func (m *Model) SetSize(width, height int)

SetSize sets the model dimensions

func (*Model) SetTheme

func (m *Model) SetTheme(theme domain.Theme)

SetTheme sets the model theme

func (*Model) Update

func (m *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update handles messages and updates the model

func (*Model) View

func (m *Model) View() string

View renders the model

type ModelState

type ModelState int

ModelState represents the current state of the model

const (
	StateInput ModelState = iota
	StateTypeSelection
	StateLoading
	StateResult
	StateError
)

type ResultTab

type ResultTab struct {
	Name    string
	Records []domain.DNSRecord
	Active  bool
}

ResultTab represents a tab in the result view

type Tool

type Tool struct {
	// contains filtered or unexported fields
}

Tool implements the DiagnosticTool interface for DNS operations

func NewTool

func NewTool(client domain.NetworkClient, logger domain.Logger) *Tool

NewTool creates a new DNS diagnostic tool

func (*Tool) Description

func (t *Tool) Description() string

Description returns the tool description

func (*Tool) Execute

func (t *Tool) Execute(ctx context.Context, params domain.Parameters) (domain.Result, error)

Execute performs the DNS lookup operation

func (*Tool) GetModel

func (t *Tool) GetModel() tea.Model

GetModel returns the Bubble Tea model for the DNS tool

func (*Tool) Name

func (t *Tool) Name() string

Name returns the tool name

func (*Tool) Validate

func (t *Tool) Validate(params domain.Parameters) error

Validate validates the parameters for DNS operations

Jump to

Keyboard shortcuts

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