common

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2022 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
	DataCh     chan<- Data
}

func NewCsvReader

func NewCsvReader(path, delimiter string, withHeader bool, dataCh chan<- Data) *CSVReader

func (*CSVReader) ReadForever

func (c *CSVReader) ReadForever() error

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 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) error
	ConfigOutput(path string) error
	// ConfigCsvStrategy, csv strategy
	// 0 means all vus have the same csv reader.
	// 1 means each vu has a separate csv reader.
	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 3 functions to user.

Jump to

Keyboard shortcuts

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