chunkers

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package chunkers provides chunking strategies for various git outputs.

Index

Constants

This section is empty.

Variables

View Source
var ErrEmptyLog = errors.New("log input is empty")

ErrEmptyLog is returned when the log input is empty.

Functions

This section is empty.

Types

type DiffChunker

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

DiffChunker splits unified diffs into logical chunks using token-based clustering.

func NewDiffChunker

func NewDiffChunker() *DiffChunker

NewDiffChunker creates a new DiffChunker.

func (*DiffChunker) Chunk

func (c *DiffChunker) Chunk(diff string, maxChunkSize int) ([]domain.DiffChunk, error)

Chunk splits a unified diff into logical chunks using token-based clustering.

type LogChunker

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

LogChunker splits git log output into chunks based on commit count.

func NewLogChunker

func NewLogChunker(contextWindow int) *LogChunker

NewLogChunker creates a new LogChunker with the specified context window. It calculates commitsPerChunk as approximately contextWindow/200, with a minimum of 10 and maximum of 25.

func (*LogChunker) Chunk

func (c *LogChunker) Chunk(log string, commitsPerChunk int) ([]string, error)

Chunk splits a git log string into chunks of approximately commitsPerChunk commits.

Jump to

Keyboard shortcuts

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