horaedb

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoDatabaseSelected  = errors.New("no database selected, you can use database in client initial options or WriteRequest/SqlQueryRequest")
	ErrPointEmptyTable     = errors.New("point's table is not set")
	ErrPointEmptyTimestamp = errors.New("point's timestamp is not set")
	ErrPointEmptyTags      = errors.New("point's tags should not be empty")
	ErrPointEmptyFields    = errors.New("point's fields should not be empty")
	ErrNullRows            = errors.New("null rows")
	ErrNullRouteTables     = errors.New("null route tables")
	ErrNullRequestTables   = errors.New("null request tables")
	ErrEmptyRoute          = errors.New("empty route")
	ErrOnlyArrowSupport    = errors.New("only arrow support now")
	ErrResponseHeaderMiss  = errors.New("response header miss")
)

Functions

This section is empty.

Types

type Client

func NewClient

func NewClient(endpoint string, routeMode RouteMode, opts ...Option) (Client, error)

type Column

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

func (Column) Name

func (c Column) Name() string

func (Column) Value

func (c Column) Value() Value

type DataType

type DataType int
const (
	NULL DataType = iota
	TIMESTAMP
	STRING
	DOUBLE
	FLOAT
	INT64
	INT32
	INT16
	INT8
	UINT64
	UINT32
	UINT16
	UINT8
	BOOL
	VARBINARY
)

type Error

type Error struct {
	Code uint32
	Err  string
}

func (*Error) Error

func (e *Error) Error() string

func (*Error) ShouldClearRoute

func (e *Error) ShouldClearRoute() bool

func (*Error) ShouldRetry

func (e *Error) ShouldRetry() bool

TODO: may retry in sdk while code is 302 or 310

type Option

type Option interface {
	// contains filtered or unexported methods
}

func EnableLoggerDebug

func EnableLoggerDebug(enable bool) Option

func WithDefaultDatabase

func WithDefaultDatabase(database string) Option

func WithLoggerWriter

func WithLoggerWriter(writer io.Writer) Option

func WithRPCMaxRecvMsgSize

func WithRPCMaxRecvMsgSize(size int) Option

func WithRouteMaxCacheSize

func WithRouteMaxCacheSize(size int) Option

type Point

type Point struct {
	Table     string
	Timestamp int64
	Tags      map[string]Value
	Fields    map[string]Value
}

type PointBuilder

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

func NewPointBuilder

func NewPointBuilder(table string) *PointBuilder

func (*PointBuilder) AddField

func (b *PointBuilder) AddField(k string, v Value) *PointBuilder

func (*PointBuilder) AddTag

func (b *PointBuilder) AddTag(k string, v Value) *PointBuilder

func (*PointBuilder) Build

func (b *PointBuilder) Build() (Point, error)

func (*PointBuilder) SetTimestamp

func (b *PointBuilder) SetTimestamp(timestamp int64) *PointBuilder

type RequestContext

type RequestContext struct {
	Database string
}

type RouteMode

type RouteMode int
const (
	Direct RouteMode = iota
	Proxy
)

type Row

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

func (Row) Column

func (r Row) Column(name string) (Column, bool)

func (Row) Columns

func (r Row) Columns() []Column

func (Row) HasColumn

func (r Row) HasColumn(name string) bool

type SQLQueryRequest

type SQLQueryRequest struct {
	ReqCtx RequestContext
	Tables []string
	SQL    string
}

type SQLQueryResponse

type SQLQueryResponse struct {
	SQL          string
	AffectedRows uint32
	Rows         []Row
}

type Value

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

func NewBoolNullValue

func NewBoolNullValue() Value

func NewBoolValue

func NewBoolValue(v bool) Value

func NewDoubleNullValue

func NewDoubleNullValue() Value

func NewDoubleValue

func NewDoubleValue(v float64) Value

func NewFloatNullValue

func NewFloatNullValue() Value

func NewFloatValue

func NewFloatValue(v float32) Value

func NewInt16NullValue

func NewInt16NullValue() Value

func NewInt16Value

func NewInt16Value(v int16) Value

func NewInt32NullValue

func NewInt32NullValue() Value

func NewInt32Value

func NewInt32Value(v int32) Value

func NewInt64NullValue

func NewInt64NullValue() Value

func NewInt64Value

func NewInt64Value(v int64) Value

func NewInt8NullValue

func NewInt8NullValue() Value

func NewInt8Value

func NewInt8Value(v int8) Value

func NewStringNullValue

func NewStringNullValue() Value

func NewStringValue

func NewStringValue(v string) Value

func NewUint16NullValue

func NewUint16NullValue() Value

func NewUint16Value

func NewUint16Value(v uint16) Value

func NewUint32NullValue

func NewUint32NullValue() Value

func NewUint32Value

func NewUint32Value(v uint32) Value

func NewUint64NullValue

func NewUint64NullValue() Value

func NewUint64Value

func NewUint64Value(v uint64) Value

func NewUint8NullValue

func NewUint8NullValue() Value

func NewUint8Value

func NewUint8Value(v uint8) Value

func NewVarbinaryNullValue

func NewVarbinaryNullValue() Value

func NewVarbinaryValue

func NewVarbinaryValue(v []byte) Value

func (Value) AnyValue

func (v Value) AnyValue() interface{}

func (Value) BoolValue

func (v Value) BoolValue() bool

func (Value) DataType

func (v Value) DataType() DataType

func (Value) DoubleValue

func (v Value) DoubleValue() float64

func (Value) FloatValue

func (v Value) FloatValue() float32

func (Value) Int16Value

func (v Value) Int16Value() int16

func (Value) Int32Value

func (v Value) Int32Value() int32

func (Value) Int64Value

func (v Value) Int64Value() int64

func (Value) Int8Value

func (v Value) Int8Value() int8

func (Value) IsNull

func (v Value) IsNull() bool

func (Value) StringValue

func (v Value) StringValue() string

func (Value) TimestampValue

func (v Value) TimestampValue() int64

func (Value) Uint16Value

func (v Value) Uint16Value() uint16

func (Value) Uint32Value

func (v Value) Uint32Value() uint32

func (Value) Uint64Value

func (v Value) Uint64Value() uint64

func (Value) Uint8Value

func (v Value) Uint8Value() uint8

func (Value) VarbinaryValue

func (v Value) VarbinaryValue() []byte

type WriteRequest

type WriteRequest struct {
	ReqCtx RequestContext
	Points []Point
}

type WriteResponse

type WriteResponse struct {
	Success uint32
	Failed  uint32
	Message string
}

Jump to

Keyboard shortcuts

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