updatelabels

package
v0.2.36 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2026 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package updatelabels rewrites the x.labels field of intermediate schema records from an in-memory ID→ISIL mapping. It backs span-update-labels.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadLabelMap

func LoadLabelMap(r io.Reader, sep string) (map[string][]string, error)

LoadLabelMap reads lines of "id<sep>isil<sep>isil..." from r and returns a map from record id to its list of labels. The mapping is kept in memory, so there is a limit to the number of lines. As in the original, a final line without a trailing newline is not included.

func Run

func Run(cfg Config, labelMap map[string][]string, r io.Reader, w io.Writer) error

Run reads intermediate schema records (one JSON per line) from r, sets the labels of any record whose id is in labelMap, and writes the results to w.

func SplitTrim

func SplitTrim(s, sep string) (result []string)

SplitTrim splits a string s on a separator and trims whitespace off the resulting parts.

Types

type Config

type Config struct {
	BatchSize  int
	NumWorkers int
}

Config holds the tunables for a run.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns the default configuration.

Jump to

Keyboard shortcuts

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