common

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2023 License: Apache-2.0 Imports: 3 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CSVReader

type CSVReader struct {
	Path       string
	Delimiter  string
	WithHeader bool
	// contains filtered or unexported fields
}

func NewCsvReader

func NewCsvReader(path, delimiter string, withHeader bool, limit int) *CSVReader

func (*CSVReader) ReadForever

func (c *CSVReader) ReadForever(dataCh chan<- Data) error

ReadForever read the csv in slice first, and send to the data channel forever.

type CSVWriter

type CSVWriter struct {
	Path      string
	Header    []string
	Delimiter string
	DataCh    <-chan []string
}

func NewCsvWriter

func NewCsvWriter(path, delimiter string, header []string, dataCh <-chan []string) *CSVWriter

func (*CSVWriter) WriteForever

func (c *CSVWriter) WriteForever() error

type Data

type Data []string

Data data in csv file

type IClient

type IClient interface {
	Open() error
	Close() error
}

IClient common client

type IClientPool

type IClientPool interface {
	Close() error
}

IClientPool common client pool

type ICsvReader added in v1.1.0

type ICsvReader interface {
	ReadForever(dataCh chan<- Data) error
}

type IGraphClient

type IGraphClient interface {
	IClient
	GetData() (Data, error)
	Execute(stmt string) (IGraphResponse, error)
}

IGraphClient graph client

type IGraphClientPool

type IGraphClientPool interface {
	IClientPool
	GetSession(username, password string) (IGraphClient, error)
	// Init initialize the poop with default channel bufferSize
	Init(address string, concurrent int) (IGraphClientPool, error)
	InitWithSize(address string, concurrent int, size int) (IGraphClientPool, error)
	ConfigCSV(path, delimiter string, withHeader bool, opts ...interface{}) error
	ConfigOutput(path string) error

	// Deprecated
	ConfigCsvStrategy(strategy int)
}

IGraphClientPool graph client pool.

type IGraphResponse

type IGraphResponse interface {
	IsSucceed() bool
	GetLatency() int64
	GetResponseTime() int32
	GetRowSize() int32
}

IGraphResponse graph response, just support some functions to user.

Jump to

Keyboard shortcuts

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