sync

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 2, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CaddySyncOptions

type CaddySyncOptions struct {
	DryRun             bool
	CaddyServerIP      string
	CaddyServerPort    int
	EntryDescription   string
	LegacyDescriptions []string
	Verbose            bool
}

CaddySyncOptions contains options for the Caddy sync operation

type SyncResult

type SyncResult struct {
	HostnameMap    map[string]string
	ToAdd          []string
	ToUpdate       []string
	ToUpdateDesc   []string
	ToRemove       []string
	ChangesApplied bool
	SyncOverrides  map[string]api.DNSOverride
	OtherOverrides map[string]api.DNSOverride
	ExistingCount  int
}

SyncResult contains the results of the sync operation

func SyncCaddyWithUnbound

func SyncCaddyWithUnbound(
	unboundClient *api.Client,
	options CaddySyncOptions,
) (*SyncResult, error)

SyncCaddyWithUnbound synchronizes DNS entries between Caddy and Unbound

type SyncUI

type SyncUI struct {
	Styles tui.StyleConfig
}

SyncUI handles the UI rendering for the sync operation

func NewSyncUI

func NewSyncUI() *SyncUI

NewSyncUI creates a new SyncUI with default styles

func (*SyncUI) RenderAddEntries

func (ui *SyncUI) RenderAddEntries(result *SyncResult) string

RenderAddEntries renders the entries to be added

func (*SyncUI) RenderChanges

func (ui *SyncUI) RenderChanges(result *SyncResult, entryDescription string) string

RenderChanges renders the changes as they are applied

func (*SyncUI) RenderDryRun

func (ui *SyncUI) RenderDryRun() string

RenderDryRun renders the dry run banner

func (*SyncUI) RenderDryRunOutput

func (ui *SyncUI) RenderDryRunOutput(result *SyncResult, entryDescription string) string

RenderDryRunOutput renders the complete dry run output

func (*SyncUI) RenderError

func (ui *SyncUI) RenderError(err error) string

RenderError renders an error message

func (*SyncUI) RenderFetchingMessage

func (ui *SyncUI) RenderFetchingMessage(ip string, port int) string

RenderFetchingMessage renders a message indicating that Caddy config is being fetched

func (*SyncUI) RenderHeader

func (ui *SyncUI) RenderHeader() string

RenderHeader renders the header for the sync operation

func (*SyncUI) RenderHostnameCount

func (ui *SyncUI) RenderHostnameCount(count int) string

RenderHostnameCount renders the hostname count

func (*SyncUI) RenderHostnameList

func (ui *SyncUI) RenderHostnameList(hostnames []string) string

RenderHostnameList renders a list of hostnames

func (*SyncUI) RenderRemoveEntries

func (ui *SyncUI) RenderRemoveEntries(result *SyncResult) string

RenderRemoveEntries renders the entries to be removed

func (*SyncUI) RenderSummary

func (ui *SyncUI) RenderSummary(result *SyncResult) string

RenderSummary renders a summary of the sync operation

func (*SyncUI) RenderUpdateDescEntries

func (ui *SyncUI) RenderUpdateDescEntries(result *SyncResult, entryDescription string) string

RenderUpdateDescEntries renders the entries to have their descriptions updated

func (*SyncUI) RenderUpdateEntries

func (ui *SyncUI) RenderUpdateEntries(result *SyncResult) string

RenderUpdateEntries renders the entries to be updated

func (*SyncUI) RenderWarning

func (ui *SyncUI) RenderWarning(message string) string

RenderWarning renders a warning message

Jump to

Keyboard shortcuts

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