client

package
v0.0.0-...-b8a1a0e Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VALUE_TYPE_INT     = "Int"
	VALUE_TYPE_STRING  = "String"
	VALUE_TYPE_FLOAT64 = "Float64"
	VALUE_TYPE_TUPLE   = "Tuple"
	VALUE_TYPE_ARRAY   = "Array"
)

Variables

View Source
var VALUE_TYPE_MAP = map[string]int{
	VALUE_TYPE_INT:     0,
	VALUE_TYPE_STRING:  1,
	VALUE_TYPE_FLOAT64: 2,
}

Functions

func SeriesEq

func SeriesEq(i *Series, j *Series, fieldIndex int, valueType string) bool

func SeriesValueEq

func SeriesValueEq[T SeriersValueType](i T, j T) bool

func SeriesValueLess

func SeriesValueLess[T SeriersValueType](i T, j T, reverse bool) bool

func TransType

func TransType(value interface{}, columnName, columnDatabaseTypeName string) (interface{}, string, error)

Types

type Client

type Client struct {
	Host     string
	Port     int
	UserName string
	Password string

	DB      string
	Context context.Context
	Debug   *Debug
	// contains filtered or unexported fields
}

func (*Client) Close

func (c *Client) Close() error

func (*Client) DoQuery

func (c *Client) DoQuery(params *QueryParams) (result *common.Result, err error)

type Debug

type Debug struct {
	IP        string
	Sql       string
	QueryTime int64
	QueryUUID string
	Error     string
}

func (*Debug) Get

func (s *Debug) Get() map[string]interface{}

func (*Debug) String

func (s *Debug) String() string

type QueryParams

type QueryParams struct {
	Sql             string
	Callbacks       map[string]func(result *common.Result) error
	QueryUUID       string
	ColumnSchemaMap map[string]*common.ColumnSchema
}

type SeriersValueType

type SeriersValueType interface {
	int | string | float64
}

type Series

type Series struct {
	Values []interface{}
}

type SeriesArray

type SeriesArray []*Series

type SeriesGroup

type SeriesGroup struct {
	Series      SeriesArray
	GroupIndex  []int
	GroupValues []interface{}
	Schemas     common.ColumnSchemas
}

func Group

func Group(seriesArray SeriesArray, groupIndex []int, schema common.ColumnSchemas) (groups []*SeriesGroup)

type SeriesSort

type SeriesSort struct {
	Series    SeriesArray
	SortIndex []int
	Reverse   []bool
	Schemas   common.ColumnSchemas
}

func (*SeriesSort) Len

func (s *SeriesSort) Len() int

func (*SeriesSort) Less

func (s *SeriesSort) Less(i, j int) bool

func (*SeriesSort) Swap

func (s *SeriesSort) Swap(i, j int)

Jump to

Keyboard shortcuts

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