subcmd

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2026 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeTimestamp = iota
	TypeField
)

Variables

View Source
var (
	MpbProgress         = mpb.New(mpb.WithWidth(100))
	ResumeJsonPath      string
	ProgressedFilesPath string
)

Global variables for progress tracking

View Source
var FSMCallEmpty = func(ctx context.Context, command *ImportCommand) error { return nil }

Functions

func CreateNewProgressFolder

func CreateNewProgressFolder() error

CreateNewProgressFolder init ResumeJsonPath and ProgressedFilesPath

func EscapeFieldKey

func EscapeFieldKey(in string) string

EscapeFieldKey returns a copy of in with any comma or equal sign or space with escaped values.

func EscapeMstName

func EscapeMstName(in string) string

EscapeMstName returns a copy of in with any "equal sign" or "space" with escaped values.

func EscapeStringFieldValue

func EscapeStringFieldValue(in string) string

EscapeStringFieldValue returns a copy of in with any double quotes or backslashes with escaped values.

func EscapeTagKey

func EscapeTagKey(in string) string

EscapeTagKey returns a copy of in with any "comma" or "equal sign" or "space" with escaped values.

func EscapeTagValue

func EscapeTagValue(in string) string

EscapeTagValue returns a copy of in with any "comma" or "equal sign" or "space" with escaped values

func NewColumnWriterClient

func NewColumnWriterClient(cfg *ImportConfig) (proto.WriteServiceClient, error)

func ReadLatestProgressFile

func ReadLatestProgressFile() error

ReadLatestProgressFile reads and processes the latest folder

Types

type DatabaseDiskInfo

type DatabaseDiskInfo struct {
	// contains filtered or unexported fields
}

type ExportCommand

type ExportCommand struct {
	// contains filtered or unexported fields
}

func (*ExportCommand) Run

func (c *ExportCommand) Run(config *ExportConfig) error

Run executes the export command (online mode only in default build)

type ExportConfig

type ExportConfig struct {
	*core.CommandLineConfig
	Export            bool
	Format            string `json:"format"`
	Out               string `json:"out"`
	DataDir           string `json:"data"`
	WalDir            string `json:"wal"`
	Remote            string `json:"remote"`
	RemoteUsername    string `json:"-"`
	RemotePassword    string `json:"-"`
	RemoteSsl         bool   `json:"remotessl"`
	DBFilter          string `json:"dbfilter"`
	RetentionFilter   string `json:"retentionfilter"`
	MeasurementFilter string `json:"mstfilter"`
	TimeFilter        string `json:"timefilter"`
	Compress          bool   `json:"compress"`
	Resume            bool
}

type Exporter

type Exporter struct {
	Stderr io.Writer
	Stdout io.Writer
	// contains filtered or unexported fields
}

func NewExporter

func NewExporter() *Exporter

type FSMCall

type FSMCall func(ctx context.Context, command *ImportCommand) error

type FieldPos

type FieldPos struct {
	Name string
	Pos  int
}

type ImportCommand

type ImportCommand struct {
	// contains filtered or unexported fields
}

func (*ImportCommand) Run

func (c *ImportCommand) Run(config *ImportConfig) error

type ImportConfig

type ImportConfig struct {
	*core.CommandLineConfig
	Path            string
	Format          string
	ColumnWrite     bool
	ColumnWritePort int
	BatchSize       int
	Tags            []string
	Fields          []string
	TimeField       string
}

type ImportFileFSM

type ImportFileFSM struct {
	// contains filtered or unexported fields
}

type ImportState

type ImportState int

type InfoType

type InfoType int
const (
	InfoTypeDatabase InfoType = 1 + iota
	InfoTypeRetentionPolicy
	InfoTypeMeasurement
)

type JsonIResult

type JsonIResult struct {
	Measurement string            `json:"name"`
	Tags        map[string]string `json:"tags,omitempty"`
	Fields      []string          `json:"columns"`
	Values      [][]any           `json:"values"`
}

JsonIResult influx json format

type JsonPResult

type JsonPResult struct {
	Metric map[string]string `json:"metric"`
	Values [][2]any          `json:"values,omitempty"`
	Value  [2]any            `json:"value,omitempty"`
}

JsonPResult prom json format

type OnlineExporter

type OnlineExporter struct {
	*Exporter
	// contains filtered or unexported fields
}

func NewOnlineExporter

func NewOnlineExporter(baseExporter *Exporter) *OnlineExporter

func (*OnlineExporter) Export

func (oe *OnlineExporter) Export(ctx context.Context, config *ExportConfig, progressedFiles map[string]struct{}) error

type TimeWindow

type TimeWindow struct {
	Start    time.Time
	End      time.Time
	FilePath string
}

Jump to

Keyboard shortcuts

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