bulk

package
v1.0.40 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package bulk provides shared ID resolution and result types for bulk operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResolveIDs

func ResolveIDs(cfg Config, queryFn func(string) ([]string, error)) ([]string, error)

ResolveIDs returns IDs from exactly one input source. queryFn is called when Query is set; caller provides domain-specific search. Returns error if zero or multiple sources are provided.

Types

type Config

type Config struct {
	Args  []string // positional args
	Stdin bool     // --stdin flag
	Query string   // --query value
}

Config specifies how to resolve IDs for a bulk operation.

type Result

type Result struct {
	Action   string   `json:"action"`
	IDs      []string `json:"ids"`
	Count    int      `json:"count"`
	DryRun   bool     `json:"dryRun"`
	Details  any      `json:"details,omitempty"`
	ItemNoun string   `json:"-"` // e.g. "message", "file", "contact"; defaults to "message"
}

Result represents the outcome of a bulk operation.

func (*Result) Print

func (r *Result) Print(jsonOutput bool) error

Print outputs the result as text or JSON.

Jump to

Keyboard shortcuts

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