mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 02:44:59 +00:00
32 lines
657 B
Go
32 lines
657 B
Go
// Copyright 2022 Molecula Corp. (DBA FeatureBase).
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
package pilosa
|
|
|
|
import (
|
|
"io"
|
|
|
|
"github.com/molecula/featurebase/v3/logger"
|
|
)
|
|
|
|
// CmdIO holds standard unix inputs and outputs.
|
|
type CmdIO struct {
|
|
Stdin io.Reader
|
|
Stdout io.Writer
|
|
Stderr io.Writer
|
|
logger logger.Logger
|
|
}
|
|
|
|
// NewCmdIO returns a new instance of CmdIO with inputs and outputs set to the
|
|
// arguments.
|
|
func NewCmdIO(stdin io.Reader, stdout, stderr io.Writer) *CmdIO {
|
|
return &CmdIO{
|
|
Stdin: stdin,
|
|
Stdout: stdout,
|
|
Stderr: stderr,
|
|
logger: logger.NewStandardLogger(stderr),
|
|
}
|
|
}
|
|
|
|
func (c *CmdIO) Logger() logger.Logger {
|
|
return c.logger
|
|
}
|