Versions in this module Expand all Collapse all v1 v1.0.0 Jul 9, 2025 Changes in this version + const LogDebug + const LogError + const LogInfo + const LogTrace + const LogWarn + var ErrAnalytics = errors.New("analytics error") + var ErrClosed = errors.New("closed") + var ErrInvalidArgument = errors.New("invalid argument") + var ErrInvalidCredential = errors.New("invalid credential") + var ErrQuery = errors.New("query error") + var ErrServiceUnavailable = errors.New("service unavailable") + var ErrTimeout = errors.New("timeout error") + var ErrUnmarshal = errors.New("unmarshalling error") + func Identifier() string + func Version() string + type AnalyticsError struct + func (e AnalyticsError) Error() string + func (e AnalyticsError) Unwrap() error + type BasicAuthCredential struct + UserPassPair UserPassPair + func NewBasicAuthCredential(username, password string) *BasicAuthCredential + func (u *BasicAuthCredential) Credentials() UserPassPair + type Cluster struct + func NewCluster(httpEndpoint string, credential Credential, opts ...*ClusterOptions) (*Cluster, error) + func (c *Cluster) Close() error + func (c *Cluster) Database(name string) *Database + func (c *Cluster) ExecuteQuery(ctx context.Context, statement string, opts ...*QueryOptions) (*QueryResult, error) + type ClusterOptions struct + Logger Logger + MaxRetries *uint32 + SecurityOptions *SecurityOptions + TimeoutOptions *TimeoutOptions + Unmarshaler Unmarshaler + func NewClusterOptions() *ClusterOptions + func (co *ClusterOptions) SetLogger(logger Logger) *ClusterOptions + func (co *ClusterOptions) SetMaxRetries(maxRetries uint32) *ClusterOptions + func (co *ClusterOptions) SetSecurityOptions(securityOptions *SecurityOptions) *ClusterOptions + func (co *ClusterOptions) SetTimeoutOptions(timeoutOptions *TimeoutOptions) *ClusterOptions + func (co *ClusterOptions) SetUnmarshaler(unmarshaler Unmarshaler) *ClusterOptions + type Credential interface + type Database struct + func (d *Database) Name() string + func (d *Database) Scope(name string) *Scope + type DynamicBasicAuthCredential struct + Provider func() UserPassPair + func NewDynamicBasicAuthCredential(provider func() UserPassPair) *DynamicBasicAuthCredential + func (u *DynamicBasicAuthCredential) Credentials() UserPassPair + type InfoLogger struct + func NewInfoLogger() *InfoLogger + func (b InfoLogger) Debug(format string, v ...interface{}) + func (b InfoLogger) Error(format string, v ...interface{}) + func (b InfoLogger) Info(format string, v ...interface{}) + func (b InfoLogger) Trace(format string, v ...interface{}) + func (b InfoLogger) Warn(format string, v ...interface{}) + type JSONUnmarshaler struct + func NewJSONUnmarshaler() *JSONUnmarshaler + func (ju *JSONUnmarshaler) Unmarshal(data []byte, v interface{}) error + type LogLevel int + type Logger interface + Debug func(format string, v ...interface{}) + Error func(format string, v ...interface{}) + Info func(format string, v ...interface{}) + Trace func(format string, v ...interface{}) + Warn func(format string, v ...interface{}) + type NoopLogger struct + func NewNoopLogger() *NoopLogger + func (n NoopLogger) Debug(_ string, _ ...interface{}) + func (n NoopLogger) Error(_ string, _ ...interface{}) + func (n NoopLogger) Info(_ string, _ ...interface{}) + func (n NoopLogger) Trace(_ string, _ ...interface{}) + func (n NoopLogger) Warn(_ string, _ ...interface{}) + type QueryError struct + func (e QueryError) Code() int + func (e QueryError) Error() string + func (e QueryError) Message() string + func (e QueryError) Unwrap() error + type QueryMetadata struct + Metrics QueryMetrics + RequestID string + Warnings []QueryWarning + func BufferQueryResult[T any](result *QueryResult) ([]T, *QueryMetadata, error) + type QueryMetrics struct + ElapsedTime time.Duration + ExecutionTime time.Duration + ProcessedObjects uint64 + ResultCount uint64 + ResultSize uint64 + type QueryOptions struct + ClientContextID *string + MaxRetries *uint32 + NamedParameters map[string]interface{} + PositionalParameters []interface{} + Raw map[string]interface{} + ReadOnly *bool + ScanConsistency *QueryScanConsistency + Unmarshaler Unmarshaler + func NewQueryOptions() *QueryOptions + func (opts *QueryOptions) SetClientContextID(clientContextID string) *QueryOptions + func (opts *QueryOptions) SetMaxRetries(maxRetries uint32) *QueryOptions + func (opts *QueryOptions) SetNamedParameters(params map[string]interface{}) *QueryOptions + func (opts *QueryOptions) SetPositionalParameters(params []interface{}) *QueryOptions + func (opts *QueryOptions) SetRaw(raw map[string]interface{}) *QueryOptions + func (opts *QueryOptions) SetReadOnly(readOnly bool) *QueryOptions + func (opts *QueryOptions) SetScanConsistency(scanConsistency QueryScanConsistency) *QueryOptions + func (opts *QueryOptions) SetUnmarshaler(unmarshaler Unmarshaler) *QueryOptions + type QueryResult struct + func (r *QueryResult) Err() error + func (r *QueryResult) MetaData() (*QueryMetadata, error) + func (r *QueryResult) NextRow() *QueryResultRow + type QueryResultRow struct + func (qrr *QueryResultRow) ContentAs(valuePtr any) error + type QueryScanConsistency uint + const QueryScanConsistencyNotBounded + const QueryScanConsistencyRequestPlus + type QueryWarning struct + Code uint32 + Message string + type Scope struct + func (s *Scope) ExecuteQuery(ctx context.Context, statement string, opts ...*QueryOptions) (*QueryResult, error) + func (s *Scope) Name() string + type SecurityOptions struct + DisableServerCertificateVerification *bool + TrustOnly TrustOnly + func NewSecurityOptions() *SecurityOptions + func (opts *SecurityOptions) SetDisableServerCertificateVerification(disabled bool) *SecurityOptions + func (opts *SecurityOptions) SetTrustOnly(trustOnly TrustOnly) *SecurityOptions + type TimeoutOptions struct + ConnectTimeout *time.Duration + QueryTimeout *time.Duration + func NewTimeoutOptions() *TimeoutOptions + func (opts *TimeoutOptions) SetConnectTimeout(timeout time.Duration) *TimeoutOptions + func (opts *TimeoutOptions) SetQueryTimeout(timeout time.Duration) *TimeoutOptions + type TrustOnly interface + type TrustOnlyCapella struct + type TrustOnlyCertificates struct + Certificates *x509.CertPool + type TrustOnlyPemFile struct + Path string + type TrustOnlyPemString struct + Pem string + type TrustOnlySystem struct + type Unmarshaler interface + Unmarshal func([]byte, interface{}) error + type UserPassPair struct + Password string + Username string + type VerboseLogger struct + func NewVerboseLogger() *VerboseLogger + func (b VerboseLogger) Debug(format string, v ...interface{}) + func (b VerboseLogger) Error(format string, v ...interface{}) + func (b VerboseLogger) Info(format string, v ...interface{}) + func (b VerboseLogger) Trace(format string, v ...interface{}) + func (b VerboseLogger) Warn(format string, v ...interface{})