context

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DockerParser

type DockerParser struct{}

DockerParser detects a Docker Compose file and extracts service names.

func (*DockerParser) Name

func (d *DockerParser) Name() string

func (*DockerParser) Parse

func (d *DockerParser) Parse(repoRoot, cwd string) (*Result, error)

type GitParser

type GitParser struct{}

func (*GitParser) Name

func (g *GitParser) Name() string

func (*GitParser) Parse

func (g *GitParser) Parse(repoRoot, cwd string) (*Result, error)

type GoParser

type GoParser struct{}

GoParser detects go.mod in the repo root and extracts Go project info.

func (*GoParser) Name

func (g *GoParser) Name() string

func (*GoParser) Parse

func (g *GoParser) Parse(repoRoot, cwd string) (*Result, error)

type JustParser

type JustParser struct{}

JustParser detects a Justfile in the repo root and extracts recipes.

func (*JustParser) Name

func (j *JustParser) Name() string

func (*JustParser) Parse

func (j *JustParser) Parse(repoRoot, cwd string) (*Result, error)

type MakeParser

type MakeParser struct{}

MakeParser detects a Makefile in the repo root and extracts targets.

func (*MakeParser) Name

func (m *MakeParser) Name() string

func (*MakeParser) Parse

func (m *MakeParser) Parse(repoRoot, cwd string) (*Result, error)

type NodeParser

type NodeParser struct{}

NodeParser detects package.json and extracts Node.js project info.

func (*NodeParser) Name

func (n *NodeParser) Name() string

func (*NodeParser) Parse

func (n *NodeParser) Parse(repoRoot, cwd string) (*Result, error)

type Parser

type Parser interface {
	Name() string
	Parse(repoRoot, cwd string) (*Result, error)
}

Parser detects project tooling and extracts relevant info. Returns nil result if this parser doesn't apply.

func DefaultParsers

func DefaultParsers() []Parser

DefaultParsers returns all v0 parsers.

type PythonParser

type PythonParser struct{}

PythonParser detects Python project indicators and extracts project info.

func (*PythonParser) Name

func (p *PythonParser) Name() string

func (*PythonParser) Parse

func (p *PythonParser) Parse(repoRoot, cwd string) (*Result, error)

type Result

type Result struct {
	Name string         `json:"name"`
	Data map[string]any `json:"data"`
}

Result holds the output of a single parser.

type ScriptsParser

type ScriptsParser struct{}

ScriptsParser looks for bin/ and scripts/ directories and lists script files.

func (*ScriptsParser) Name

func (s *ScriptsParser) Name() string

func (*ScriptsParser) Parse

func (s *ScriptsParser) Parse(repoRoot, cwd string) (*Result, error)

type Snapshot

type Snapshot struct {
	RepoRoot string   `json:"repo_root"`
	CwdRel   string   `json:"cwd_rel"`
	Results  []Result `json:"results"`
}

Snapshot is the full context collected from all parsers.

func Collect

func Collect(cwd string, parsers []Parser) (*Snapshot, error)

Collect runs all parsers and builds a Snapshot.

Jump to

Keyboard shortcuts

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