๐Ÿ“ฆ hezhizhen / greptimedb-client-go

GreptimeDB Go Client

โ˜… 0 stars โ‘‚ 2 forks ๐Ÿ‘ 0 watching โš–๏ธ Apache License 2.0
๐Ÿ“ฅ Clone https://github.com/hezhizhen/greptimedb-client-go.git
HTTPS git clone https://github.com/hezhizhen/greptimedb-client-go.git
SSH git clone git@github.com:hezhizhen/greptimedb-client-go.git
CLI gh repo clone hezhizhen/greptimedb-client-go
yuanbohan yuanbohan feat: unmarshal response in Prometheus format (#75) 76c1399 2 years ago ๐Ÿ“ History
๐Ÿ“‚ main View all commits โ†’
๐Ÿ“ .github
๐Ÿ“ prom
๐Ÿ“„ .gitignore
๐Ÿ“„ .licenserc.yaml
๐Ÿ“„ client_test.go
๐Ÿ“„ client.go
๐Ÿ“„ config.go
๐Ÿ“„ doc_test.go
๐Ÿ“„ doc.go
๐Ÿ“„ errors.go
๐Ÿ“„ go.mod
๐Ÿ“„ go.sum
๐Ÿ“„ header_test.go
๐Ÿ“„ header.go
๐Ÿ“„ insert.go
๐Ÿ“„ LICENSE
๐Ÿ“„ mask_test.go
๐Ÿ“„ mask.go
๐Ÿ“„ metric_test.go
๐Ÿ“„ metric.go
๐Ÿ“„ query_promql.go
๐Ÿ“„ query_sql.go
๐Ÿ“„ query.go
๐Ÿ“„ README.md
๐Ÿ“„ request_test.go
๐Ÿ“„ series_test.go
๐Ÿ“„ series.go
๐Ÿ“„ stream_client.go
๐Ÿ“„ util_test.go
๐Ÿ“„ util.go
๐Ÿ“„ README.md

License Build Status codecov Go Reference

GreptimeDB Go Client

Provide API for using GreptimeDB client in Go.

Installation

go get github.com/GreptimeTeam/greptimedb-client-go

Example

you can visit Example for usage details.

Usage

Datatype Supported

  • int32
  • int64
  • int (as int64)
  • uint32
  • uint64
  • uint (as uint64)
  • float32
  • float64
  • bool
  • []byte
  • string
  • time.Time
  • int8, int16 (as int32) // not recommended
  • uint8, uint16 (as uint32) // not recommended

Precision for Timestamp

The default precision is Millisecond, you can set a different precision, once the precision is setted, you can not change it any more.

  • time.Second
  • time.Millisecond
  • time.Microsecond
  • time.Nanosecond
metric.SetTimePrecision(time.Microsecond)

Stream Insert

You can send several insert request by Send() and notify DB no more messages by CloseAndRecv()

you can visit streamclienttest.go for details

Prometheus

We also support querying with RangePromql and Promql(TODO).

you can visit promqltest.go for details

License

This greptimedb-client-go uses the Apache 2.0 license to strike a balance between open contributions and allowing you to use the software however you want.