Help us shape the future of Go! Take the 2026 Go Developer Survey

cli

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package cli provides a JSON executor for CLI commands.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONExecutor

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

JSONExecutor is a struct that sends JSON-encoded data to a writer and decodes JSON-encoded data from a reader.

func NewJSONExecutor

func NewJSONExecutor(in io.Writer, out io.Reader) *JSONExecutor

NewJSONExecutor creates a new JSONExecutor with the given writer and reader.

func (*JSONExecutor) Execute

func (e *JSONExecutor) Execute(data, result any) error

Execute sends the given data as a JSON-encoded message to the writer and decodes the JSON-encoded response from the reader into the given result.

Jump to

Keyboard shortcuts

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