base

package
v2.0.1-0...-2f82913 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LABEL_LABEL   = ":LABEL"
	LABEL_VID     = ":VID"
	LABEL_SRC_VID = ":SRC_VID"
	LABEL_DST_VID = ":DST_VID"
	LABEL_RANK    = ":RANK"
	LABEL_IGNORE  = ":IGNORE"
)
View Source
const STAT_FILEDONE string = "FILEDONE"

Variables

This section is empty.

Functions

func ExtractFilename

func ExtractFilename(uri string) (local bool, filename string, err error)

func FileExists

func FileExists(filename string) bool

func FormatFilePath

func FormatFilePath(filepath string) (path string, err error)

func HasHttpPrefix

func HasHttpPrefix(path string) bool

func IsValidType

func IsValidType(t string) bool

func MustCreateFile

func MustCreateFile(filePath string) *os.File

Types

type ClientRequest

type ClientRequest struct {
	Stmt  string
	ErrCh chan<- ErrData
	Data  []Data
}

type Data

type Data struct {
	Type   OpType
	Record Record
}

func DeleteData

func DeleteData(record Record) Data

func FinishData

func FinishData() Data

func HeaderData

func HeaderData(record Record) Data

func InsertData

func InsertData(record Record) Data

type ErrData

type ErrData struct {
	Error error
	Data  []Data
}

type OpType

type OpType int
const (
	DONE   OpType = 0
	INSERT OpType = 1
	DELETE OpType = 2
	HEADER OpType = 100
)

func (OpType) String

func (op OpType) String() string

type Record

type Record []string

type ResponseData

type ResponseData struct {
	Error error
	Stats Stats
}

type StatType

type StatType int
const (
	SUCCESS  StatType = 0
	FAILURE  StatType = 1
	FILEDONE StatType = 2
)

type Stats

type Stats struct {
	Type      StatType
	Latency   int64
	ReqTime   int64
	BatchSize int
	Filename  string
}

func NewFailureStats

func NewFailureStats(batchSize int) Stats

func NewFileDoneStats

func NewFileDoneStats(filename string) Stats

func NewSuccessStats

func NewSuccessStats(latency int64, reqTime int64, batchSize int) Stats

type Stmt

type Stmt struct {
	Stmt string
	Data [][]interface{}
}

type Stoppable

type Stoppable interface {
	Stop()
}

Jump to

Keyboard shortcuts

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