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.
Click to show internal directories.
Click to hide internal directories.