Documentation
¶
Index ¶
- Constants
- Variables
- func CreateNewProgressFolder() error
- func EscapeFieldKey(in string) string
- func EscapeMstName(in string) string
- func EscapeStringFieldValue(in string) string
- func EscapeTagKey(in string) string
- func EscapeTagValue(in string) string
- func NewColumnWriterClient(cfg *ImportConfig) (proto.WriteServiceClient, error)
- func ReadLatestProgressFile() error
- type DatabaseDiskInfo
- type ExportCommand
- type ExportConfig
- type Exporter
- type FSMCall
- type FieldPos
- type ImportCommand
- type ImportConfig
- type ImportFileFSM
- type ImportState
- type InfoType
- type JsonIResult
- type JsonPResult
- type OnlineExporter
- type TimeWindow
Constants ¶
const ( TypeTimestamp = iota TypeField )
Variables ¶
var ( MpbProgress = mpb.New(mpb.WithWidth(100)) ResumeJsonPath string ProgressedFilesPath string )
Global variables for progress tracking
var FSMCallEmpty = func(ctx context.Context, command *ImportCommand) error { return nil }
Functions ¶
func CreateNewProgressFolder ¶
func CreateNewProgressFolder() error
CreateNewProgressFolder init ResumeJsonPath and ProgressedFilesPath
func EscapeFieldKey ¶
EscapeFieldKey returns a copy of in with any comma or equal sign or space with escaped values.
func EscapeMstName ¶
EscapeMstName returns a copy of in with any "equal sign" or "space" with escaped values.
func EscapeStringFieldValue ¶
EscapeStringFieldValue returns a copy of in with any double quotes or backslashes with escaped values.
func EscapeTagKey ¶
EscapeTagKey returns a copy of in with any "comma" or "equal sign" or "space" with escaped values.
func EscapeTagValue ¶
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 ImportCommand ¶
type ImportCommand struct {
// contains filtered or unexported fields
}
func (*ImportCommand) Run ¶
func (c *ImportCommand) Run(config *ImportConfig) error
type ImportConfig ¶
type ImportFileFSM ¶
type ImportFileFSM struct {
// contains filtered or unexported fields
}
type ImportState ¶
type ImportState int
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