input

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StdInSentinel = "-"
)

Variables

This section is empty.

Functions

func ReadLinesFromFile

func ReadLinesFromFile(filePath string, opts ...ReaderOption) ([]string, cenclierrors.CencliError)

ReadLinesFromFile reads lines from a file using the command's input reader.

func ReadLinesFromStdin

func ReadLinesFromStdin(r io.Reader, opts ...ReaderOption) ([]string, cenclierrors.CencliError)

ReadLinesFromStdin reads lines from stdin using the command's input reader.

func SplitString

func SplitString(line string, opts ...SplitStringOption) []string

SplitString splits a string into a list of strings using the given delimiter. If the delimiter is not provided, it defaults to ",". Will always trim whitespace from the parts.

Types

type InvalidInputFileError

type InvalidInputFileError interface {
	cenclierrors.CencliError
}

type ReaderOption

type ReaderOption func(*inputReader)

func WithDontTrimSpace

func WithDontTrimSpace() ReaderOption

WithDontTrimSpace sets the input reader to not trim whitespace.

func WithLeaveBlanks

func WithLeaveBlanks() ReaderOption

WithLeaveBlanks sets the input reader to leave blanks.

type SplitStringOption

type SplitStringOption func(*splitStringOptions)

func WithDelimiter

func WithDelimiter(delimiter string) SplitStringOption

WithDelimiter sets the split string option to use the given delimiter.

Jump to

Keyboard shortcuts

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