pimp

package
v0.0.0-...-a83e6cb Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoIncrement

func AutoIncrement(path string) (uint64, error)

Types

type CreateTable

type CreateTable struct {
	TableName     string
	Columns       []string
	AutoIncrement uint64
}

func ExtractTableDef

func ExtractTableDef(path string) (CreateTable, error)

func (*CreateTable) Enter

func (v *CreateTable) Enter(node ast.Node) (ast.Node, bool)

func (*CreateTable) Leave

func (v *CreateTable) Leave(node ast.Node) (ast.Node, bool)

type ImportData

type ImportData struct {
	DbName    string
	TableName string
	FileNum   int
	ImportCmd string
	AlterStmt string
}

type ImportPlan

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

func (*ImportPlan) Estimate

func (plan *ImportPlan) Estimate() error

func (*ImportPlan) Execute

func (plan *ImportPlan) Execute() error

func (*ImportPlan) PrintCmd

func (plan *ImportPlan) PrintCmd()

type Job

type Job struct {
	Task       func(string, *ImportData) error
	Length     int
	ResourceId string
	Data       *ImportData
}

type Plan

type Plan interface {
	Estimate() error
	Execute() error
	PrintCmd()
}

func NewImportPlan

func NewImportPlan(ctx context.Context, path string, concurrency int, dbConfig string) Plan

type Progress

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

type WorkerPool

type WorkerPool interface {
	Run()
	AddTask(Job)
	Wait()
	Progress() (int, int)
}

func NewWorkerPool

func NewWorkerPool(maxWorker int, maxCPU int, maxThreadPerWorker int) WorkerPool

Jump to

Keyboard shortcuts

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