dsql

package
v0.0.0-...-c4b4ed2 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrPinging is an error returned when health check endpoint returns a non 200.
	ErrPinging = errors.New("druid: error fetching health info from druid")

	// ErrCancelled is an error returned when we receive a cancellation event from a context object
	ErrCancelled = errors.New("druid: cancellation received")

	// ErrRequestForm is an error returned when failing to form a request
	ErrRequestForm = errors.New("druid: error forming request")

	// ErrCreatingRequest is an error when creating a new request
	ErrCreatingRequest = errors.New("druid: error creating new request")

	// ErrMakingRequest is an error whilst making a request to the druid server itself
	ErrMakingRequest = errors.New("druid: error making request to druid server")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	User          string
	Passwd        string
	BrokerAddr    string
	PingEndpoint  string
	QueryEndpoint string

	// DateFormat for the date field, i.e iso, auto etc
	DateFormat string

	// DateField field to use as the date field
	DateField string

	// UseSSL determines whether to use SSL or not
	UseSSL bool
}

Config represents a struct to a druid database

func ParseDSN

func ParseDSN(dsn string) *Config

ParseDSN returns a config struct from a dsn string

func (*Config) FormatDSN

func (c *Config) FormatDSN() (dsn string)

FormatDSN formats a data source name from a config struct

type Driver

type Driver struct{}

Driver is a struct meant to be returned and used with database/sql

func (*Driver) Open

func (d *Driver) Open(dsn string) (driver.Conn, error)

Open opens a new connection and implements driver.Driver

func (*Driver) OpenConnector

func (d *Driver) OpenConnector(dsn string) (driver.Connector, error)

OpenConnector implements driver.DriverContext

Jump to

Keyboard shortcuts

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