mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
still need to update readme to include info about environment variables, but at least it isn't wrong anymore.
48 lines
831 B
Go
48 lines
831 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"
|
|
bind = "localhost:10101"
|
|
|
|
[cluster]
|
|
poll-interval = "2m0s"
|
|
replicas = 1
|
|
hosts = [
|
|
"localhost:10101",
|
|
]
|
|
|
|
[anti-entropy]
|
|
interval = "10m0s"
|
|
|
|
[profile]
|
|
cpu = ""
|
|
cpu-time = "30s"
|
|
|
|
[plugins]
|
|
path = ""
|
|
`)+"\n")
|
|
return nil
|
|
}
|