Help us shape the future of Go! Take the 2026 Go Developer Survey

config

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDiffFound = errors.New("DiffFound")
View Source
var ErrNoDiffCommand = errors.New("NoDiffCommand")

Functions

func HelpMarkdown added in v0.13.1

func HelpMarkdown() string

HelpMarkdown returns the markdown help string.

func Usage added in v0.13.1

func Usage() string

Usage returns the CLI usage string.

Types

type Config

type Config struct {
	Context              int       `name:"context" short:"C" default:"3" usage:"diff context"`
	Separator            string    `name:"separator" short:"d" default:">" usage:"object id separator"`
	Indent               int       `name:"indent" short:"n" default:"2" usage:"yaml indent"`
	Out                  string    `name:"out" short:"o" default:"text" usage:"output format: text,yaml,id,idlist,markdown"`
	Debug                bool      `name:"debug" usage:"enable debug log"`
	Quiet                bool      `name:"quiet" short:"q" usage:"quiet log"`
	Color                bool      `name:"color" short:"c" usage:"colored diff"`
	DiffSuccess          bool      `name:"success" usage:"exit with 0 even if inputs differ"`
	AllowDuplicateKey    bool      `name:"allow-duplicate-key" default:"true" usage:"allow the use of keys with the same name in the same map"`
	DiffCommand          string    `name:"diff-cmd" short:"x" usage:"invoke this to get diff instead of builtin differ"`
	Verbose              bool      `name:"verbose" short:"v" usage:"enable verbose output; annotate diff type and display summary"`
	Labels               []string  `` /* 136-byte string literal not displayed */
	MarkdownHeadingLevel uint      `name:"markdown-heading" default:"1" usage:"highest heading level in markdown"`
	Stdin                io.Reader `name:"-"`
	IgnoreMatchingLines  []string  `` /* 150-byte string literal not displayed */
	IgnoreFields         []string  `` /* 150-byte string literal not displayed */
	IgnoreLabels         []string  `` /* 132-byte string literal not displayed */
	IgnoreAnnotations    []string  `` /* 142-byte string literal not displayed */
	IgnoreManagedFields  bool      `name:"ignore-managed-fields" short:"m" usage:"ignore metadata.managedFields"`
	IgnoreStatus         bool      `name:"ignore-status" short:"s" usage:"ignore status field"`
	MCP                  bool      `name:"mcp" usage:"start MCP server over stdio"`
}

func (*Config) NewMCPServer added in v0.15.0

func (c *Config) NewMCPServer() *mcp.Server

NewMCPServer creates and returns a configured MCP Server for objdiff.

func (*Config) OutMode

func (c *Config) OutMode() OutMode

func (*Config) Run

func (c *Config) Run(w io.Writer, left, right string) error

func (*Config) RunMCP added in v0.15.0

func (c *Config) RunMCP(ctx context.Context) error

RunMCP starts the MCP server over stdio.

type DiffToolParams added in v0.15.0

type DiffToolParams struct {
	Left                 string   `json:"left" jsonschema:"left manifest YAML content or file path"`
	Right                string   `json:"right" jsonschema:"right manifest YAML content or file path"`
	Out                  string   `json:"out,omitempty" jsonschema:"output format: text, yaml, id, idlist, markdown (default: text)"`
	Context              *int     `json:"context,omitempty" jsonschema:"number of diff context lines (default: 3)"`
	Separator            string   `json:"separator,omitempty" jsonschema:"object id separator (default: >)"`
	Indent               *int     `json:"indent,omitempty" jsonschema:"yaml indent (default: 2)"`
	Verbose              bool     `json:"verbose,omitempty" jsonschema:"enable verbose output; annotate diff type and display summary"`
	MarkdownHeadingLevel *uint    `json:"markdownHeadingLevel,omitempty" jsonschema:"highest heading level in markdown (default: 1)"`
	IgnoreMatchingLines  []string `json:"ignoreMatchingLines,omitempty" jsonschema:"ignore lines matching regexp"`
	IgnoreFields         []string `json:"ignoreFields,omitempty" jsonschema:"ignore field by path or yq expression"`
	IgnoreLabels         []string `json:"ignoreLabels,omitempty" jsonschema:"ignore label by key"`
	IgnoreAnnotations    []string `json:"ignoreAnnotations,omitempty" jsonschema:"ignore annotation by key"`
	IgnoreManagedFields  bool     `json:"ignoreManagedFields,omitempty" jsonschema:"ignore metadata.managedFields"`
	IgnoreStatus         bool     `json:"ignoreStatus,omitempty" jsonschema:"ignore status field"`
}

DiffToolParams defines the input parameters for the diff_k8s_manifests tool.

type DiffToolResult added in v0.15.0

type DiffToolResult struct {
	Diff    string `json:"diff" jsonschema:"the formatted diff output"`
	HasDiff bool   `json:"hasDiff" jsonschema:"true if differences were found"`
}

DiffToolResult defines the output of the diff_k8s_manifests tool.

type Help added in v0.13.1

type Help struct{}

Help represents the help documentation structure for objdiff.

func NewHelp added in v0.13.1

func NewHelp() *Help

func (*Help) ConfigurationContent added in v0.13.1

func (h *Help) ConfigurationContent() string

func (*Help) ConfigurationHeading added in v0.13.1

func (h *Help) ConfigurationHeading() string

func (*Help) ConfigurationSection added in v0.13.1

func (h *Help) ConfigurationSection() string

func (*Help) ExitStatusContent added in v0.13.1

func (h *Help) ExitStatusContent() string

func (*Help) ExitStatusHeading added in v0.13.1

func (h *Help) ExitStatusHeading() string

func (*Help) ExitStatusSection added in v0.13.1

func (h *Help) ExitStatusSection() string

func (*Help) FlagsHeading added in v0.13.1

func (h *Help) FlagsHeading() string

func (*Help) HelpMarkdown added in v0.13.1

func (h *Help) HelpMarkdown() string

HelpMarkdown generates the markdown representation of help without flag contents.

func (*Help) ObjectIDContent added in v0.13.1

func (h *Help) ObjectIDContent() string

func (*Help) ObjectIDHeading added in v0.13.1

func (h *Help) ObjectIDHeading() string

func (*Help) ObjectIDSection added in v0.13.1

func (h *Help) ObjectIDSection() string

func (*Help) OutputFormatContent added in v0.13.1

func (h *Help) OutputFormatContent() string

func (*Help) OutputFormatHeading added in v0.13.1

func (h *Help) OutputFormatHeading() string

func (*Help) OutputFormatSection added in v0.13.1

func (h *Help) OutputFormatSection() string

func (*Help) OverrideDifferContent added in v0.13.1

func (h *Help) OverrideDifferContent() string

func (*Help) OverrideDifferHeading added in v0.13.1

func (h *Help) OverrideDifferHeading() string

func (*Help) OverrideDifferSection added in v0.13.1

func (h *Help) OverrideDifferSection() string

func (*Help) Title added in v0.13.1

func (h *Help) Title() string

func (*Help) Usage added in v0.13.1

func (h *Help) Usage() string

Usage generates the usage text used in CLI help (excluding dynamic flag options).

func (*Help) UsageContent added in v0.13.1

func (h *Help) UsageContent() string

func (*Help) UsageHeading added in v0.13.1

func (h *Help) UsageHeading() string

func (*Help) UsageSection added in v0.13.1

func (h *Help) UsageSection() string

type MarkdownDoc added in v0.13.1

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

MarkdownDoc represents a markdown document builder.

func NewMarkdownDoc added in v0.13.1

func NewMarkdownDoc() *MarkdownDoc

func (*MarkdownDoc) AddCodeBlock added in v0.13.1

func (d *MarkdownDoc) AddCodeBlock(lang, code string) *MarkdownDoc

func (*MarkdownDoc) AddHeading added in v0.13.1

func (d *MarkdownDoc) AddHeading(level int, title string) *MarkdownDoc

func (*MarkdownDoc) AddParagraph added in v0.13.1

func (d *MarkdownDoc) AddParagraph(text string) *MarkdownDoc

func (*MarkdownDoc) AddRaw added in v0.13.1

func (d *MarkdownDoc) AddRaw(content string) *MarkdownDoc

func (*MarkdownDoc) String added in v0.13.1

func (d *MarkdownDoc) String() string

type OutMode

type OutMode string
const (
	OutModeUnknown  OutMode = "unknown"
	OutModeText     OutMode = "text"
	OutModeYaml     OutMode = "yaml"
	OutModeID       OutMode = "id"
	OutModeIDList   OutMode = "idlist"
	OutModeMarkdown OutMode = "markdown"
)

Jump to

Keyboard shortcuts

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