ctl

package
v2.9.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2021 License: Apache-2.0 Imports: 31 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

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

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

func SetTLSConfig

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

SetTLSConfig creates common TLS flags

Types

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(_ context.Context) error

Run executes the check command.

type CommandWithTLSSupport

type CommandWithTLSSupport interface {
	TLSHost() string
	TLSConfiguration() server.TLSConfig
	Logger() *log.Logger
}

CommandWithTLSSupport is the interface for commands which has TLS settings

type ConfigCommand

type ConfigCommand struct {
	*pilosa.CmdIO
	Config *server.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(_ context.Context) error

Run prints out the default config.

type ExportCommand

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

	// Name of the index & field to export from.
	Index string
	Field string

	// Filename to export to.
	Path string

	// Standard input/output
	*pilosa.CmdIO

	TLS server.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

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

func (*ExportCommand) TLSHost

func (cmd *ExportCommand) TLSHost() string

type GenerateConfigCommand

type GenerateConfigCommand struct {
	*pilosa.CmdIO
}

GenerateConfigCommand represents a command for printing a default config.

func NewGenerateConfigCommand

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

NewGenerateConfigCommand returns a new instance of GenerateConfigCommand.

func (*GenerateConfigCommand) Run

Run prints out the default config.

type ImportCommand

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

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

	// Options for the index to be created if it doesn't exist
	IndexOptions pilosa.IndexOptions

	// Options for the field to be created if it doesn't exist
	FieldOptions pilosa.FieldOptions

	// CreateSchema ensures the schema exists before import
	CreateSchema bool

	// Clear clears the import data as opposed to setting it.
	Clear bool

	// 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"`

	// Standard input/output
	*pilosa.CmdIO

	TLS server.TLSConfig
	// contains filtered or unexported fields
}

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

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

func (*ImportCommand) TLSHost

func (cmd *ImportCommand) TLSHost() string

type InspectCommand

type InspectCommand struct {
	// Path to data file
	Path string
	// don't list details of objects
	Quiet bool
	// list only this many objects
	Max int
	// Filters:
	InspectOpts pilosa.InspectRequest

	// 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) DisplayInfo

func (cmd *InspectCommand) DisplayInfo(info roaring.BitmapInfo)

func (*InspectCommand) InspectFile

func (cmd *InspectCommand) InspectFile(f *os.File, fi os.FileInfo) error

func (*InspectCommand) InspectHolder

func (cmd *InspectCommand) InspectHolder(ctx context.Context, path string) error

func (*InspectCommand) PrintContainers

func (cmd *InspectCommand) PrintContainers(info roaring.BitmapInfo, pC pointerContext)

func (*InspectCommand) PrintOps

func (cmd *InspectCommand) PrintOps(info roaring.BitmapInfo)

func (*InspectCommand) Run

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

Run executes the inspect command.

type RBFCheckCommand added in v2.3.0

type RBFCheckCommand struct {
	// Filepath to the RBF database.
	Path string

	// Standard input/output
	*pilosa.CmdIO
}

RBFCheckCommand represents a command for running a consistency check on RBF.

func NewRBFCheckCommand added in v2.3.0

func NewRBFCheckCommand(stdin io.Reader, stdout, stderr io.Writer) *RBFCheckCommand

NewRBFCheckCommand returns a new instance of RBFCheckCommand.

func (*RBFCheckCommand) Run added in v2.3.0

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

Run executes the export.

type RBFDumpCommand added in v2.3.0

type RBFDumpCommand struct {
	// Filepath to the RBF database.
	Path string

	// Page numbers to print.
	Pgnos []uint32

	// Standard input/output
	*pilosa.CmdIO
}

RBFDumpCommand represents a command for dumping raw data for an RBF page.

func NewRBFDumpCommand added in v2.3.0

func NewRBFDumpCommand(stdin io.Reader, stdout, stderr io.Writer) *RBFDumpCommand

NewRBFDumpCommand returns a new instance of RBFDumpCommand.

func (*RBFDumpCommand) Run added in v2.3.0

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

Run executes the export.

type RBFPageCommand added in v2.3.0

type RBFPageCommand struct {
	// Filepath to the RBF database.
	Path string

	// Page numbers to print.
	Pgnos []uint32

	// Standard input/output
	*pilosa.CmdIO
}

RBFPageCommand represents a command for printing data for a single RBF page.

func NewRBFPageCommand added in v2.3.0

func NewRBFPageCommand(stdin io.Reader, stdout, stderr io.Writer) *RBFPageCommand

NewRBFPageCommand returns a new instance of RBFPageCommand.

func (*RBFPageCommand) Run added in v2.3.0

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

Run executes the export.

type RBFPagesCommand added in v2.3.0

type RBFPagesCommand struct {
	// Filepath to the RBF database.
	Path string

	// Print the b-tree key with each row.
	WithTree bool

	// Standard input/output
	*pilosa.CmdIO
}

RBFPagesCommand represents a command for printing a list of RBF page metadata.

func NewRBFPagesCommand added in v2.3.0

func NewRBFPagesCommand(stdin io.Reader, stdout, stderr io.Writer) *RBFPagesCommand

NewRBFPagesCommand returns a new instance of RBFPagesCommand.

func (*RBFPagesCommand) Run added in v2.3.0

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

Run executes the export.

Jump to

Keyboard shortcuts

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