mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-10-14 23:08:02 +00:00
40 lines
728 B
Go
40 lines
728 B
Go
package ctl
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
"io"
|
|
"strings"
|
|
|
|
"github.com/pilosa/pilosa"
|
|
)
|
|
|
|
// ConfigCommand represents a command for printing a default config.
|
|
type ConfigCommand struct {
|
|
*pilosa.CmdIO
|
|
}
|
|
|
|
// NewConfigCommand returns a new instance of ConfigCommand.
|
|
func NewConfigCommand(stdin io.Reader, stdout, stderr io.Writer) *ConfigCommand {
|
|
return &ConfigCommand{
|
|
CmdIO: pilosa.NewCmdIO(stdin, stdout, stderr),
|
|
}
|
|
}
|
|
|
|
// Run prints out the default config.
|
|
func (cmd *ConfigCommand) Run(ctx context.Context) error {
|
|
fmt.Fprintln(cmd.Stdout, strings.TrimSpace(`
|
|
data-dir = "~/.pilosa"
|
|
host = "localhost:10101"
|
|
|
|
[cluster]
|
|
replicas = 1
|
|
|
|
[[cluster.node]]
|
|
host = "localhost:10101"
|
|
|
|
[plugins]
|
|
path = ""
|
|
`)+"\n")
|
|
return nil
|
|
}
|