timeplus

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2022 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const APIVersion = "v1beta1"
View Source
const TimeFormat = "2006-01-02 15:04:05.000"

Variables

This section is empty.

Functions

This section is empty.

Types

type ColumnDef

type ColumnDef struct {
	Name    string `json:"name"`
	Type    string `json:"type"`
	Default string `json:"default"`
}

type IngestData

type IngestData struct {
	Columns []string `json:"columns"`
	Data    [][]any  `json:"data"`
}

type IngestPayload

type IngestPayload struct {
	Data   IngestData `json:"data"`
	Stream string     `json:"stream"`
}

type LatencyStat

type LatencyStat struct {
	Min    float64   `json:"min"`
	Max    float64   `json:"max"`
	Sum    float64   `json:"sum"`
	Avg    float64   `json:"avg"`
	Latest []float64 `json:"latest"`
}

type Query

type Query struct {
	SQL         string   `json:"sql"`
	Name        string   `json:"name"`
	Description string   `json:"description"`
	Tags        []string `json:"tags"`
}

type QueryInfo

type QueryInfo struct {
	ID           string      `json:"id"`
	Name         string      `json:"name"`
	SQL          string      `json:"sql"`
	Description  string      `json:"description"`
	Tags         []string    `json:"tags"`
	Stat         QueryStat   `json:"stat"`
	StartTime    int64       `json:"start_time"`
	EndTime      int64       `json:"end_time"`
	Duration     int64       `json:"duration"`
	ResponseTime int64       `json:"response_time"`
	Status       string      `json:"status"`
	Message      string      `json:"message"`
	Result       QueryResult `json:"result"`
}

type QueryResult

type QueryResult struct {
	Header []ColumnDef     `json:"header"`
	Data   [][]interface{} `json:"data"`
}

type QueryStat

type QueryStat struct {
	Count      int            `json:"count"`
	Latency    LatencyStat    `json:"latency"`
	Throughput ThroughputStat `json:"throughput"`
}

type SQLRequest

type SQLRequest struct {
	SQL     string `json:"sql"`
	Timeout int    `json:"timeout"`
}

type StreamDef

type StreamDef struct {
	Name                   string      `json:"name"`
	Columns                []ColumnDef `json:"columns"`
	EventTimeColumn        string      `json:"event_time_column,omitempty"`
	EventTimeZone          string      `json:"event_time_timezone,omitempty"`
	TTLExpression          string      `json:"ttl_expression,omitempty"`
	LogStoreRetentionBytes int         `json:"logstore_retention_bytes,omitempty"`
	LogStoreRetentionMS    int         `json:"logstore_retention_ms,omitempty"`
}

type ThroughputStat

type ThroughputStat struct {
	Value float32 `json:"value"`
}

type TimeplusClient

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

func NewCient

func NewCient(address string, tenant string, apikey string) *TimeplusClient

func NewCientWithHttpConfig

func NewCientWithHttpConfig(address string, tenant string, apikey string, config *utils.HTTPClientConfig) *TimeplusClient

func (*TimeplusClient) CreateStream

func (s *TimeplusClient) CreateStream(streamDef StreamDef) error

func (*TimeplusClient) CreateView

func (s *TimeplusClient) CreateView(view View) error

func (*TimeplusClient) DeleteStream

func (s *TimeplusClient) DeleteStream(streamName string) error

func (*TimeplusClient) ExistStream

func (s *TimeplusClient) ExistStream(name string) bool

func (*TimeplusClient) ExistView

func (s *TimeplusClient) ExistView(name string) bool

func (*TimeplusClient) GetStream

func (s *TimeplusClient) GetStream(name string) (*StreamDef, error)

func (*TimeplusClient) InsertData

func (s *TimeplusClient) InsertData(data *IngestPayload) error

func (*TimeplusClient) ListStream

func (s *TimeplusClient) ListStream() ([]StreamDef, error)

func (*TimeplusClient) ListView

func (s *TimeplusClient) ListView() ([]View, error)

func (*TimeplusClient) QueryStream

func (s *TimeplusClient) QueryStream(sql string) (rxgo.Observable, *QueryInfo, error)

type TimeplusLowLevelClient

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

func NewLowLevelCient

func NewLowLevelCient(address string) *TimeplusLowLevelClient

func (*TimeplusLowLevelClient) InsertData

func (s *TimeplusLowLevelClient) InsertData(data *IngestPayload) error

type View

type View struct {
	Name         string `json:"name"`
	Query        string `json:"query"`
	Materialized bool   `json:"materialized,omitempty"`
}

Jump to

Keyboard shortcuts

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