diff

package
v0.16.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintResult

func PrintResult(r *Result)

PrintResult writes a unified-diff style representation of r to stdout.

Types

type CmdDiffConfig

type CmdDiffConfig struct {
	InputA  string
	InputB  string
	Filters []string
}

CmdDiffConfig holds the configuration for the diff command.

type NetworkChange

type NetworkChange struct {
	Network string
	Before  any
	After   any
}

NetworkChange represents a network whose record differs between two MMDB databases.

type NetworkEntry

type NetworkEntry struct {
	Network string
	Record  any
}

NetworkEntry represents a network CIDR and its associated record.

type Result

type Result struct {
	InputA   string
	InputB   string
	Added    []NetworkEntry
	Removed  []NetworkEntry
	Modified []NetworkChange
	HasDiff  bool
}

Result contains the outcome of comparing two MMDB files.

func DiffMMDB

func DiffMMDB(cfg CmdDiffConfig) (*Result, error)

DiffMMDB compares the networks in two MMDB files and returns the differences.

Jump to

Keyboard shortcuts

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