ctl

package
v0.8.4 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2018 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

package ctl contains all pilosa subcommands other than 'server'. These are generally administration, testing, and debugging tools.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildServerFlags added in v0.4.0

func BuildServerFlags(cmd *cobra.Command, srv *server.Command)

BuildServerFlags attaches a set of flags to the command for a server instance.

func CommandClient added in v0.8.0

CommandClient returns a pilosa.InternalHTTPClient for the command

func SetTLSConfig added in v0.8.0

func SetTLSConfig(flags *pflag.FlagSet, certificatePath *string, certificateKeyPath *string, skipVerify *bool)

SetTLSConfig creates common TLS flags

Types

type BackupCommand

type BackupCommand struct {
	// Destination host and port.
	Host string

	// Name of the index, frame, view to backup.
	Index string
	Frame string
	View  string

	// Output file to write to.
	Path string

	// Standard input/output
	*pilosa.CmdIO

	TLS pilosa.TLSConfig
}

BackupCommand represents a command for backing up a view.

func NewBackupCommand

func NewBackupCommand(stdin io.Reader, stdout, stderr io.Writer) *BackupCommand

NewBackupCommand returns a new instance of BackupCommand.

func (*BackupCommand) Run

func (cmd *BackupCommand) Run(ctx context.Context) error

Run executes the backup.

func (*BackupCommand) TLSConfiguration added in v0.8.0

func (cmd *BackupCommand) TLSConfiguration() pilosa.TLSConfig

func (*BackupCommand) TLSHost added in v0.8.0

func (cmd *BackupCommand) TLSHost() string

type BenchCommand

type BenchCommand struct {
	// Destination host and port.
	Host string

	// Name of the index & frame to execute against.
	Index string
	Frame string

	// Type of operation and number to execute.
	Op string
	N  int

	// Standard input/output
	*pilosa.CmdIO

	TLS pilosa.TLSConfig
}

BenchCommand represents a command for benchmarking index operations.

func NewBenchCommand

func NewBenchCommand(stdin io.Reader, stdout, stderr io.Writer) *BenchCommand

NewBenchCommand returns a new instance of BenchCommand.

func (*BenchCommand) Run

func (cmd *BenchCommand) Run(ctx context.Context) error

Run executes the bench command.

func (*BenchCommand) TLSConfiguration added in v0.8.0

func (cmd *BenchCommand) TLSConfiguration() pilosa.TLSConfig

func (*BenchCommand) TLSHost added in v0.8.0

func (cmd *BenchCommand) TLSHost() string

type CheckCommand

type CheckCommand struct {
	// Data file paths.
	Paths []string

	// Standard input/output
	*pilosa.CmdIO
}

CheckCommand represents a command for performing consistency checks on data files.

func NewCheckCommand

func NewCheckCommand(stdin io.Reader, stdout, stderr io.Writer) *CheckCommand

NewCheckCommand returns a new instance of CheckCommand.

func (*CheckCommand) Run

func (cmd *CheckCommand) Run(ctx context.Context) error

Run executes the check command.

type CommandWithTLSSupport added in v0.8.0

type CommandWithTLSSupport interface {
	TLSHost() string
	TLSConfiguration() pilosa.TLSConfig
}

CommandWithTLSSupport is the interface for commands which has TLS settings

type ConfigCommand

type ConfigCommand struct {
	*pilosa.CmdIO
	Config *pilosa.Config
}

ConfigCommand represents a command for printing a default config.

func NewConfigCommand

func NewConfigCommand(stdin io.Reader, stdout, stderr io.Writer) *ConfigCommand

NewConfigCommand returns a new instance of ConfigCommand.

func (*ConfigCommand) Run

func (cmd *ConfigCommand) Run(ctx context.Context) error

Run prints out the default config.

type ExportCommand

type ExportCommand struct {
	// Remote host and port.
	Host string

	// Name of the index & frame to export from.
	Index string
	Frame string
	View  string
	// Filename to export to.
	Path string

	// Standard input/output
	*pilosa.CmdIO

	TLS pilosa.TLSConfig
}

ExportCommand represents a command for bulk exporting data from a server.

func NewExportCommand

func NewExportCommand(stdin io.Reader, stdout, stderr io.Writer) *ExportCommand

NewExportCommand returns a new instance of ExportCommand.

func (*ExportCommand) Run

func (cmd *ExportCommand) Run(ctx context.Context) error

Run executes the export.

func (*ExportCommand) TLSConfiguration added in v0.8.0

func (cmd *ExportCommand) TLSConfiguration() pilosa.TLSConfig

func (*ExportCommand) TLSHost added in v0.8.0

func (cmd *ExportCommand) TLSHost() string

type GenerateConfigCommand added in v0.4.0

type GenerateConfigCommand struct {
	*pilosa.CmdIO
}

GenerateConfigCommand represents a command for printing a default config.

func NewGenerateConfigCommand added in v0.4.0

func NewGenerateConfigCommand(stdin io.Reader, stdout, stderr io.Writer) *GenerateConfigCommand

NewGenerateConfigCommand returns a new instance of GenerateConfigCommand.

func (*GenerateConfigCommand) Run added in v0.4.0

Run prints out the default config.

type ImportCommand

type ImportCommand struct {
	// Destination host and port.
	Host string `json:"host"`

	// Name of the index & frame to import into.
	Index string `json:"index"`
	Frame string `json:"frame"`

	// Options for index & frame to be created if they don't exist
	IndexOptions pilosa.IndexOptions
	FrameOptions pilosa.FrameOptions

	// CreateSchema ensures the schema exists before import
	CreateSchema bool

	// For Range-Encoded fields, name of the Field to import into.
	Field string `json:"field"`

	// Filenames to import from.
	Paths []string `json:"paths"`

	// Size of buffer used to chunk import.
	BufferSize int `json:"bufferSize"`

	// Enables sorting of data file before import.
	Sort bool `json:"sort"`

	// Reusable client.
	Client pilosa.InternalClient `json:"-"`

	// Standard input/output
	*pilosa.CmdIO

	TLS pilosa.TLSConfig
}

ImportCommand represents a command for bulk importing data.

func NewImportCommand

func NewImportCommand(stdin io.Reader, stdout, stderr io.Writer) *ImportCommand

NewImportCommand returns a new instance of ImportCommand.

func (*ImportCommand) Run

func (cmd *ImportCommand) Run(ctx context.Context) error

Run executes the main program execution.

func (*ImportCommand) TLSConfiguration added in v0.8.0

func (cmd *ImportCommand) TLSConfiguration() pilosa.TLSConfig

func (*ImportCommand) TLSHost added in v0.8.0

func (cmd *ImportCommand) TLSHost() string

type InspectCommand

type InspectCommand struct {
	// Path to data file
	Path string

	// Standard input/output
	*pilosa.CmdIO
}

InspectCommand represents a command for inspecting fragment data files.

func NewInspectCommand

func NewInspectCommand(stdin io.Reader, stdout, stderr io.Writer) *InspectCommand

NewInspectCommand returns a new instance of InspectCommand.

func (*InspectCommand) Run

func (cmd *InspectCommand) Run(ctx context.Context) error

Run executes the inspect command.

type RestoreCommand

type RestoreCommand struct {
	// Destination host and port.
	Host string

	// Name of the index & frame to backup.
	Index string
	Frame string
	View  string

	// Import file to read from.
	Path string

	// Standard input/output
	*pilosa.CmdIO

	TLS pilosa.TLSConfig
}

RestoreCommand represents a command for restoring a frame from a backup.

func NewRestoreCommand

func NewRestoreCommand(stdin io.Reader, stdout, stderr io.Writer) *RestoreCommand

NewRestoreCommand returns a new instance of RestoreCommand.

func (*RestoreCommand) Run

func (cmd *RestoreCommand) Run(ctx context.Context) error

Run executes the restore command.

func (*RestoreCommand) TLSConfiguration added in v0.8.0

func (cmd *RestoreCommand) TLSConfiguration() pilosa.TLSConfig

func (*RestoreCommand) TLSHost added in v0.8.0

func (cmd *RestoreCommand) TLSHost() string

Jump to

Keyboard shortcuts

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