Documentation ¶
Index ¶
- Constants
- func ConstructNestedError(message string, err error) error
- func ConstructUserAgentString() (ua_string string)
- func GetHostNameURL() string
- func ParseDSNString(dsn string) (*fireboltSettings, error)
- func SplitStatements(sql string) ([]string, error)
- func WithClientParams(accountID string, token string, userAgent string) driverOption
- func WithDatabaseName(databaseName string) driverOption
- func WithEngineUrl(engineUrl string) driverOption
- type AuthenticationResponse
- type BaseClient
- type Client
- type ClientImpl
- type ClientImplV0
- type Column
- type FireboltConnector
- type FireboltDriver
- type FireboltResult
- type QueryResponse
Constants ¶
const ( ContentTypeForm = "application/x-www-form-urlencoded" ContentTypeJSON = "application/json" )
const ( ServiceAccountLoginURLSuffix = "/oauth/token" EngineUrlByAccountName = "/web/v3/account/%s/engineUrl" AccountInfoByAccountName = "/web/v3/account/%s/resolve" //API v0 UsernamePasswordURLSuffix = "/auth/v1/login" DefaultAccountURL = "/iam/v2/account" AccountIdByNameURL = "/iam/v2/accounts:getIdByName" EngineIdByNameURL = "/core/v1/accounts/%s/engines:getIdByName" EngineByIdURL = "/core/v1/accounts/%s/engines/%s" EngineUrlByDatabaseNameURL = "/core/v1/accounts/%s/engines:getURLByDatabaseName" )
const AuthAudienceValue = "https://api.firebolt.io"
Variables ¶
This section is empty.
Functions ¶
func ConstructNestedError ¶
func ConstructUserAgentString ¶
func ConstructUserAgentString() (ua_string string)
ConstructUserAgentString returns a string with go, GoSDK and os type and versions additionally user can set "FIREBOLT_GO_DRIVERS" and "FIREBOLT_GO_CLIENTS" env variable, and they will be concatenated with the final user-agent string
func GetHostNameURL ¶
func GetHostNameURL() string
GetHostNameURL returns a hostname url, either default or overwritten with the environment variable
func ParseDSNString ¶
ParseDSNString parses a dsn in a format: firebolt://username:password@db_name[/engine_name][?account_name=organization] returns a settings object where all parsed values are populated returns an error if required fields couldn't be parsed or if after parsing some characters were left unparsed
func SplitStatements ¶ added in v0.0.6
SplitStatements split multiple statements into a list of statements
func WithClientParams ¶ added in v1.1.0
WithClientParams defines client parameters for the driver
func WithDatabaseName ¶ added in v1.1.0
func WithDatabaseName(databaseName string) driverOption
WithDatabaseName defines database name for the driver
func WithEngineUrl ¶ added in v1.1.0
func WithEngineUrl(engineUrl string) driverOption
WithEngineUrl defines engine url for the driver
Types ¶
type AuthenticationResponse ¶
type BaseClient ¶ added in v1.0.0
type BaseClient struct { ClientID string ClientSecret string AccountID string ApiEndpoint string UserAgent string // contains filtered or unexported fields }
func (*BaseClient) Query ¶ added in v1.0.0
func (c *BaseClient) Query(ctx context.Context, engineUrl, query string, parameters map[string]string, control connectionControl) (*QueryResponse, error)
Query sends a query to the engine URL and populates queryResponse, if query was successful
type Client ¶
type Client interface { GetConnectionParameters(ctx context.Context, engineName string, databaseName string) (string, map[string]string, error) Query(ctx context.Context, engineUrl, query string, parameters map[string]string, control connectionControl) (*QueryResponse, error) }
func Authenticate ¶
Authenticate sends an authentication request, and returns a newly constructed client object
type ClientImpl ¶ added in v1.0.0
type ClientImpl struct { ConnectedToSystemEngine bool SystemEngineURL string AccountVersion int BaseClient }
func MakeClient ¶ added in v1.0.0
func MakeClient(settings *fireboltSettings, apiEndpoint string) (*ClientImpl, error)
func (*ClientImpl) GetConnectionParameters ¶ added in v1.1.0
func (c *ClientImpl) GetConnectionParameters(ctx context.Context, engineName, databaseName string) (string, map[string]string, error)
GetConnectionParameters returns engine URL and parameters based on engineName and databaseName
type ClientImplV0 ¶ added in v1.0.0
type ClientImplV0 struct {
BaseClient
}
func MakeClientV0 ¶ added in v1.0.0
func MakeClientV0(settings *fireboltSettings, apiEndpoint string) (*ClientImplV0, error)
func (*ClientImplV0) GetConnectionParameters ¶ added in v1.1.0
func (c *ClientImplV0) GetConnectionParameters(ctx context.Context, engineName, databaseName string) (string, map[string]string, error)
GetConnectionParameters returns engine URL and engine name based on engineName and accountId
type FireboltConnector ¶ added in v1.1.0
type FireboltConnector struct {
// contains filtered or unexported fields
}
FireboltConnector is an intermediate type between a Connection and a Driver which stores session data
func FireboltConnectorWithOptions ¶ added in v1.1.0
func FireboltConnectorWithOptions(opts ...driverOption) *FireboltConnector
FireboltConnectorWithOptions builds a custom connector
func (*FireboltConnector) Driver ¶ added in v1.1.0
func (c *FireboltConnector) Driver() driver.Driver
Driver returns the underlying driver of the Connector
type FireboltDriver ¶
type FireboltDriver struct {
// contains filtered or unexported fields
}
func (*FireboltDriver) Open ¶
func (d *FireboltDriver) Open(dsn string) (driver.Conn, error)
Open parses the dsn string, and if correct tries to establish a connection
func (*FireboltDriver) OpenConnector ¶ added in v1.1.0
func (d *FireboltDriver) OpenConnector(dsn string) (driver.Connector, error)
type FireboltResult ¶
type FireboltResult struct { }
func (FireboltResult) LastInsertId ¶
func (r FireboltResult) LastInsertId() (int64, error)
LastInsertId returns last inserted ID, not supported by firebolt
func (FireboltResult) RowsAffected ¶
func (r FireboltResult) RowsAffected() (int64, error)
RowsAffected returns a number of affected rows, not supported by firebolt