Documentation
¶
Index ¶
- func CreatePool(conf PgConf) (*pgxpool.Pool, error)
- type Entry
- func (e *Entry) Bool(key string, value bool) *Entry
- func (e *Entry) ExportForSQL(table, tsCol string) (string, []any)
- func (e *Entry) Float(key string, value float64) *Entry
- func (e *Entry) Int(key string, value int) *Entry
- func (e *Entry) Str(key, value string) *Entry
- func (e *Entry) String() string
- type OptsFn
- type PgConf
- type TableWriter
- type WriteError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type OptsFn ¶ added in v0.1.0
type OptsFn func(*optItems)
func WithBufferSize ¶ added in v0.1.0
func WithMinTimeout ¶ added in v0.2.0
func WithTimeout ¶ added in v0.1.0
type PgConf ¶
type PgConf struct {
User string `json:"user"`
Passwd string `json:"passwd"`
Host string `json:"host"`
Port int `json:"port"`
DBName string `json:"dbName"`
}
func (PgConf) CreateConnString ¶
CreateConnString produces Postgres connection string with the form: "postgres://username:password@host:port/dbname"
type TableWriter ¶
type TableWriter struct {
// contains filtered or unexported fields
}
func NewTableWriter ¶
func (*TableWriter) Activate ¶
func (table *TableWriter) Activate(ctx context.Context, opts ...OptsFn) (chan<- Entry, <-chan WriteError)
Activate starts TimescaleDB writer and provides a writing channel to the client along with a reading channel for error reporting. Writing uses an adaptive timeout to prevent flooding of the incoming channel with requests in case the target database cannot handle queries.
defaults:
defaultTimeout = 10 * time.Second defaultMinTimeout = 1 * time.Second defaultBufferSize = 100
func (*TableWriter) CurrentQueryTimeout ¶ added in v0.2.0
func (table *TableWriter) CurrentQueryTimeout() time.Duration
type WriteError ¶
Click to show internal directories.
Click to hide internal directories.