Documentation
¶
Overview ¶
Package cbinsights provides an SDK for interacting with Couchbase Operational Insights clusters. The main entry point for the SDK is the Cluster struct, which allows users to perform operations on the data against a Couchbase Operational Insights cluster. The Cluster struct is created using the NewCluster function, which takes an HTTP endpoint, a credential for authentication, and optional cluster options.
Index ¶
- Constants
- Variables
- func Identifier() string
- func Version() string
- type BasicAuthCredential
- type CertificateCredential
- type Cluster
- 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)
- func (c *Cluster) SetCredential(credential Credential) error
- func (c *Cluster) StartQuery(ctx context.Context, statement string, opts ...*StartQueryOptions) (*QueryHandle, error)
- type 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
- type Database
- type DynamicBasicAuthCredentialdeprecated
- type FetchResultsOptions
- type InfoLogger
- type InsightsError
- type JSONUnmarshaler
- type JWTCredential
- type LogLevel
- type Logger
- type NoopLogger
- type QueryError
- type QueryHandle
- type QueryMetadata
- type QueryMetrics
- type 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
- type QueryResultHandle
- type QueryResultRow
- type QueryScanConsistency
- type QueryStatus
- type QueryWarning
- type Scope
- type SecurityOptions
- type StartQueryOptions
- func (opts *StartQueryOptions) SetClientContextID(clientContextID string) *StartQueryOptions
- func (opts *StartQueryOptions) SetMaxRetries(maxRetries uint32) *StartQueryOptions
- func (opts *StartQueryOptions) SetNamedParameters(params map[string]interface{}) *StartQueryOptions
- func (opts *StartQueryOptions) SetPositionalParameters(params []interface{}) *StartQueryOptions
- func (opts *StartQueryOptions) SetRaw(raw map[string]interface{}) *StartQueryOptions
- func (opts *StartQueryOptions) SetReadOnly(readOnly bool) *StartQueryOptions
- func (opts *StartQueryOptions) SetScanConsistency(scanConsistency QueryScanConsistency) *StartQueryOptions
- type TimeoutOptions
- type TrustOnly
- type TrustOnlyCapella
- type TrustOnlyCertificates
- type TrustOnlyPemFile
- type TrustOnlyPemString
- type TrustOnlySystem
- type Unmarshaler
- type UserPassPair
- type 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{})
Constants ¶
const ( LogError = LogLevel(logging.LogError) LogWarn = LogLevel(logging.LogWarn) LogInfo = LogLevel(logging.LogInfo) LogDebug = LogLevel(logging.LogDebug) LogTrace = LogLevel(logging.LogTrace) )
Various logging levels (or subsystems) which can categorize the message. Currently these are ordered in decreasing severity.
Variables ¶
var ErrClosed = errors.New("closed")
ErrClosed occurs when an entity was used after it was closed.
var ErrInsights = errors.New("operational insights error")
ErrInsights is the base error for any Operational Insights error that is not captured by a more specific error.
var ErrInvalidArgument = errors.New("invalid argument")
ErrInvalidArgument occurs when an invalid argument is provided to a function.
var ErrInvalidCredential = errors.New("invalid credential")
ErrInvalidCredential occurs when invalid credentials are provided leading to errors in things like authentication.
var ErrQuery = errors.New("query error")
ErrQuery occurs when a server error is encountered while executing a query, excluding errors that caught by ErrInvalidCredential or ErrTimeout.
var ErrQueryNotFound = errors.New("query not found")
ErrQueryNotFound occurs when a query handle or its results are not found, typically because they have been discarded or canceled.
ErrServiceUnavailable occurs when the Operational Insights service, or a part of the system in the path to it, is unavailable.
var ErrTimeout = errors.New("timeout error")
ErrTimeout occurs when a timeout is reached while waiting for a response. This is returned when a server timeout occurs, or an operation fails to be sent within the dispatch timeout.
var ErrUnmarshal = errors.New("unmarshalling error")
ErrUnmarshal occurs when an entity could not be unmarshalled.
Functions ¶
func Identifier ¶
func Identifier() string
Identifier returns a string representation of the current SDK identifier.
Types ¶
type BasicAuthCredential ¶
type BasicAuthCredential struct {
UserPassPair UserPassPair
}
BasicAuthCredential provides a way to authenticate using username and password.
func NewBasicAuthCredential ¶
func NewBasicAuthCredential(username, password string) *BasicAuthCredential
NewBasicAuthCredential creates a new BasicAuthCredential with the specified username and password.
func (*BasicAuthCredential) Credentials ¶
func (u *BasicAuthCredential) Credentials() UserPassPair
Credentials returns the UserPassPair for BasicAuthCredential.
type CertificateCredential ¶
type CertificateCredential struct {
ClientCertificate *tls.Certificate
}
CertificateCredential provides a way to authenticate using a client TLS certificate.
func NewCertificateCredential ¶
func NewCertificateCredential(clientCertificate *tls.Certificate) *CertificateCredential
NewCertificateCredential creates a new CertificateCredential with the specified client certificate.
type Cluster ¶
type Cluster struct {
// contains filtered or unexported fields
}
Cluster is the main entry point for the SDK. It is used to perform operations on the data against a Couchbase Operational Insights cluster.
func NewCluster ¶
func NewCluster(httpEndpoint string, credential Credential, opts ...*ClusterOptions) (*Cluster, error)
NewCluster creates a new Cluster instance.
func (*Cluster) ExecuteQuery ¶
func (c *Cluster) ExecuteQuery(ctx context.Context, statement string, opts ...*QueryOptions) (*QueryResult, error)
ExecuteQuery executes the query statement on the server. When ExecuteQuery is called with no context.Context, or a context.Context with no Deadline, then the Cluster level QueryTimeout will be applied.
func (*Cluster) SetCredential ¶
func (c *Cluster) SetCredential(credential Credential) error
SetCredential replaces the credential used for authenticating requests. This can be used for credential rotation without recreating the cluster instance.
The new credential must be the same type as the credential originally provided to NewCluster. For example, if NewCluster was called with a BasicAuthCredential, only another BasicAuthCredential can be set. Attempting to change the credential type returns ErrInvalidArgument.
For BasicAuthCredential and JWTCredential, the new credential is used immediately for all subsequent requests.
For CertificateCredential, the new certificate is presented during TLS handshakes on new connections. Existing connections (particularly HTTP/2 connections, which multiplex requests over a single connection) will continue to use the previous certificate until they are closed and re-established. In practice, idle connections are recycled quickly so the new certificate will typically take effect shortly after being set, provided no requests are actively in-flight.
func (*Cluster) StartQuery ¶
func (c *Cluster) StartQuery(ctx context.Context, statement string, opts ...*StartQueryOptions) (*QueryHandle, error)
StartQuery starts execution of a deferred query statement on the server and returns a QueryHandle that can be used to check status, retrieve results, cancel, or discard the query. When StartQuery is called with no context.Context, or a context.Context with no Deadline, then the Cluster level QueryTimeout will be applied.
type ClusterOptions ¶
type ClusterOptions struct {
// TimeoutOptions specifies various operation timeouts.
TimeoutOptions *TimeoutOptions
// SecurityOptions specifies security related configuration options.
SecurityOptions *SecurityOptions
// Unmarshaler specifies the default unmarshaler to use for decoding query response rows.
Unmarshaler Unmarshaler
// Logger specifies the logger to use for logging.
Logger Logger
// MaxRetries specifies the maximum number of retries that a query will be attempted.
// This includes connection attempts.
// VOLATILE: This API is subject to change at any time.
MaxRetries *uint32
}
ClusterOptions specifies options for configuring the cluster.
func NewClusterOptions ¶
func NewClusterOptions() *ClusterOptions
NewClusterOptions creates a new instance of ClusterOptions.
func (*ClusterOptions) SetLogger ¶
func (co *ClusterOptions) SetLogger(logger Logger) *ClusterOptions
SetLogger sets the Logger field in ClusterOptions.
func (*ClusterOptions) SetMaxRetries ¶
func (co *ClusterOptions) SetMaxRetries(maxRetries uint32) *ClusterOptions
SetMaxRetries sets the MaxRetries field in ClusterOptions. VOLATILE: This API is subject to change at any time.
func (*ClusterOptions) SetSecurityOptions ¶
func (co *ClusterOptions) SetSecurityOptions(securityOptions *SecurityOptions) *ClusterOptions
SetSecurityOptions sets the SecurityOptions field in ClusterOptions.
func (*ClusterOptions) SetTimeoutOptions ¶
func (co *ClusterOptions) SetTimeoutOptions(timeoutOptions *TimeoutOptions) *ClusterOptions
SetTimeoutOptions sets the TimeoutOptions field in ClusterOptions.
func (*ClusterOptions) SetUnmarshaler ¶
func (co *ClusterOptions) SetUnmarshaler(unmarshaler Unmarshaler) *ClusterOptions
SetUnmarshaler sets the Unmarshaler field in ClusterOptions.
type Credential ¶
type Credential interface {
// contains filtered or unexported methods
}
Credential provides a way to authenticate with the server.
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database represents an Operational Insights database and provides access to Scope.
type DynamicBasicAuthCredential
deprecated
type DynamicBasicAuthCredential struct {
Provider func() UserPassPair
}
DynamicBasicAuthCredential provides a way to authenticate using a dynamic username and password.
Deprecated: This function is deprecated and will be removed in a future release. Use Cluster.SetCredential and BasicAuthCredential instead.
func NewDynamicBasicAuthCredential
deprecated
func NewDynamicBasicAuthCredential(provider func() UserPassPair) *DynamicBasicAuthCredential
NewDynamicBasicAuthCredential creates a new DynamicBasicAuthCredential with the specified provider function.
Deprecated: This function is deprecated and will be removed in a future release. Use Cluster.SetCredential and BasicAuthCredential instead.
func (*DynamicBasicAuthCredential) Credentials ¶
func (u *DynamicBasicAuthCredential) Credentials() UserPassPair
Credentials returns the UserPassPair provided by the Provider function for DynamicBasicAuthCredential.
type FetchResultsOptions ¶
type FetchResultsOptions struct {
// Unmarshaler specifies the unmarshaler to use for decoding rows from this result.
Unmarshaler Unmarshaler
}
FetchResultsOptions is the set of options available to a FetchResults operation on a QueryResultHandle.
func NewFetchResultOptions ¶
func NewFetchResultOptions() *FetchResultsOptions
NewFetchResultOptions creates a new instance of FetchResultsOptions.
func (*FetchResultsOptions) SetUnmarshaler ¶
func (opts *FetchResultsOptions) SetUnmarshaler(unmarshaler Unmarshaler) *FetchResultsOptions
SetUnmarshaler sets the Unmarshaler field in FetchResultsOptions.
type InfoLogger ¶
type InfoLogger struct {
// contains filtered or unexported fields
}
InfoLogger logs to stderr with a level of LogInfo.
func NewInfoLogger ¶
func NewInfoLogger() *InfoLogger
NewInfoLogger creates a new InfoLogger instance.
type InsightsError ¶
type InsightsError struct {
// contains filtered or unexported fields
}
InsightsError occurs when an error is encountered while interacting with the Operational Insights service.
func (InsightsError) Error ¶
func (e InsightsError) Error() string
Error returns the string representation of an Operational Insights error.
func (InsightsError) Unwrap ¶
func (e InsightsError) Unwrap() error
Unwrap returns the underlying reason for the error.
type JSONUnmarshaler ¶
type JSONUnmarshaler struct{}
JSONUnmarshaler is an Unmarshaler that performs JSON unmarshalling.
func NewJSONUnmarshaler ¶
func NewJSONUnmarshaler() *JSONUnmarshaler
NewJSONUnmarshaler creates a new JSONUnmarshaler.
func (*JSONUnmarshaler) Unmarshal ¶
func (ju *JSONUnmarshaler) Unmarshal(data []byte, v interface{}) error
Unmarshal unmarshals the data into the provided value.
type JWTCredential ¶
type JWTCredential struct {
Token string
}
JWTCredential provides a way to authenticate using a JWT token.
func NewJWTCredential ¶
func NewJWTCredential(token string) *JWTCredential
NewJWTCredential creates a new JWTCredential with the specified token.
type Logger ¶
type Logger interface {
// Error outputs an error level log message.
Error(format string, v ...interface{})
// Warn outputs an warn level log message.
Warn(format string, v ...interface{})
// Info outputs an info level log message.
Info(format string, v ...interface{})
// Debug outputs a debug level error log message.
Debug(format string, v ...interface{})
// Trace outputs a trace level error log message.
Trace(format string, v ...interface{})
}
Logger defines a logging interface.
type NoopLogger ¶
type NoopLogger struct {
}
NoopLogger is a no-operation logger that ignores all log messages. This is equivalent to specifying Logger on ClusterOptions as nil.
func NewNoopLogger ¶
func NewNoopLogger() *NoopLogger
NewNoopLogger creates a new NoopLogger instance.
func (NoopLogger) Debug ¶
func (n NoopLogger) Debug(_ string, _ ...interface{})
Debug ignores the debug level log message.
func (NoopLogger) Error ¶
func (n NoopLogger) Error(_ string, _ ...interface{})
Error ignores the error level log message.
func (NoopLogger) Info ¶
func (n NoopLogger) Info(_ string, _ ...interface{})
Info ignores the info level log message.
func (NoopLogger) Trace ¶
func (n NoopLogger) Trace(_ string, _ ...interface{})
Trace ignores the trace level log message.
func (NoopLogger) Warn ¶
func (n NoopLogger) Warn(_ string, _ ...interface{})
Warn ignores the warn level log message.
type QueryError ¶
type QueryError struct {
// contains filtered or unexported fields
}
QueryError occurs when an error is returned in the errors field of the response body of a response from the query server.
func (QueryError) Code ¶
func (e QueryError) Code() int
Code returns the error code from the server for this error.
func (QueryError) Error ¶
func (e QueryError) Error() string
Error returns the string representation of a query error.
func (QueryError) Message ¶
func (e QueryError) Message() string
Message returns the error message from the server for this error.
func (QueryError) Unwrap ¶
func (e QueryError) Unwrap() error
Unwrap returns the underlying reason for the error.
type QueryHandle ¶
type QueryHandle struct {
// contains filtered or unexported fields
}
QueryHandle represents an asynchronous query handle that can be used to check status, retrieve results, cancel, or discard a deferred query.
func (*QueryHandle) Cancel ¶
func (qh *QueryHandle) Cancel(ctx context.Context) error
Cancel cancels the deferred query on the server.
func (*QueryHandle) FetchStatus ¶
func (qh *QueryHandle) FetchStatus(ctx context.Context) (*QueryStatus, error)
FetchStatus fetches the current status of the deferred query from the server.
type QueryMetadata ¶
type QueryMetadata struct {
RequestID string
Metrics QueryMetrics
Warnings []QueryWarning
}
QueryMetadata provides access to the meta-data properties of a query result.
func BufferQueryResult ¶
func BufferQueryResult[T any](result *QueryResult) ([]T, *QueryMetadata, error)
BufferQueryResult will buffer all rows in the result set into memory and return them as a slice, with any metadata.
type QueryMetrics ¶
type QueryMetrics struct {
ElapsedTime time.Duration
ExecutionTime time.Duration
ResultCount uint64
ResultSize uint64
ProcessedObjects uint64
}
QueryMetrics encapsulates various metrics gathered during a queries execution.
type QueryOptions ¶
type QueryOptions struct {
// ClientContextID is an optional identifier for the query.
ClientContextID *string
// PositionalParameters sets any positional placeholder parameters for the query.
PositionalParameters []interface{}
// NamedParameters sets any positional placeholder parameters for the query.
NamedParameters map[string]interface{}
// ReadOnly sets whether this query should be read-only.
ReadOnly *bool
// ScanConsistency specifies the level of data consistency required for this query.
ScanConsistency *QueryScanConsistency
// Raw provides a way to provide extra parameters in the request body for the query.
Raw map[string]interface{}
// Unmarshaler specifies the default unmarshaler to use for decoding rows from this query.
Unmarshaler Unmarshaler
// MaxRetries specifies the maximum number of retries that a query will be attempted.
// This includes connection attempts.
// VOLATILE: This API is subject to change at any time.
MaxRetries *uint32
}
QueryOptions is the set of options available to an Operational Insights query.
func NewQueryOptions ¶
func NewQueryOptions() *QueryOptions
NewQueryOptions creates a new instance of QueryOptions.
func (*QueryOptions) SetClientContextID ¶
func (opts *QueryOptions) SetClientContextID(clientContextID string) *QueryOptions
SetClientContextID sets the ClientContextID field in QueryOptions.
func (*QueryOptions) SetMaxRetries ¶
func (opts *QueryOptions) SetMaxRetries(maxRetries uint32) *QueryOptions
SetMaxRetries sets the MaxRetries field in QueryOptions. VOLATILE: This API is subject to change at any time.
func (*QueryOptions) SetNamedParameters ¶
func (opts *QueryOptions) SetNamedParameters(params map[string]interface{}) *QueryOptions
SetNamedParameters sets the NamedParameters field in QueryOptions.
func (*QueryOptions) SetPositionalParameters ¶
func (opts *QueryOptions) SetPositionalParameters(params []interface{}) *QueryOptions
SetPositionalParameters sets the PositionalParameters field in QueryOptions.
func (*QueryOptions) SetRaw ¶
func (opts *QueryOptions) SetRaw(raw map[string]interface{}) *QueryOptions
SetRaw sets the Raw field in QueryOptions.
func (*QueryOptions) SetReadOnly ¶
func (opts *QueryOptions) SetReadOnly(readOnly bool) *QueryOptions
SetReadOnly sets the ReadOnly field in QueryOptions.
func (*QueryOptions) SetScanConsistency ¶
func (opts *QueryOptions) SetScanConsistency(scanConsistency QueryScanConsistency) *QueryOptions
SetScanConsistency sets the ScanConsistency field in QueryOptions.
func (*QueryOptions) SetUnmarshaler ¶
func (opts *QueryOptions) SetUnmarshaler(unmarshaler Unmarshaler) *QueryOptions
SetUnmarshaler sets the Unmarshaler field in QueryOptions.
type QueryResult ¶
type QueryResult struct {
// contains filtered or unexported fields
}
QueryResult allows access to the results of a query.
func (*QueryResult) Err ¶
func (r *QueryResult) Err() error
Err returns any errors that have occurred on the stream.
func (*QueryResult) MetaData ¶
func (r *QueryResult) MetaData() (*QueryMetadata, error)
MetaData returns any meta-data that was available from this query. Note that the meta-data will only be available once the object has been closed (either implicitly or explicitly).
func (*QueryResult) NextRow ¶
func (r *QueryResult) NextRow() *QueryResultRow
NextRow returns the next row in the result set, or nil if there are no more rows.
type QueryResultHandle ¶
type QueryResultHandle struct {
// contains filtered or unexported fields
}
QueryResultHandle provides access to the results of a completed deferred query.
func (*QueryResultHandle) DiscardResults ¶
func (qhr *QueryResultHandle) DiscardResults(ctx context.Context) error
DiscardResults discards the results of the deferred query on the server.
func (*QueryResultHandle) FetchResults ¶
func (qhr *QueryResultHandle) FetchResults(ctx context.Context, opts ...*FetchResultsOptions) (*QueryResult, error)
FetchResults streams all results from the completed deferred query.
type QueryResultRow ¶
type QueryResultRow struct {
// contains filtered or unexported fields
}
QueryResultRow encapsulates a single row of a query result.
func (*QueryResultRow) ContentAs ¶
func (qrr *QueryResultRow) ContentAs(valuePtr any) error
ContentAs will attempt to unmarshal the content of the row into the provided value pointer.
type QueryScanConsistency ¶
type QueryScanConsistency uint
QueryScanConsistency indicates the level of data consistency desired for an Operational Insights query.
const ( // QueryScanConsistencyNotBounded indicates no data consistency is required. QueryScanConsistencyNotBounded QueryScanConsistency = iota + 1 // QueryScanConsistencyRequestPlus indicates that request-level data consistency is required. QueryScanConsistencyRequestPlus )
type QueryStatus ¶
type QueryStatus struct {
// contains filtered or unexported fields
}
QueryStatus represents the status of a deferred query.
func (*QueryStatus) ResultHandle ¶
func (qs *QueryStatus) ResultHandle() (*QueryResultHandle, error)
ResultHandle returns the QueryResultHandle for accessing results. ResultHandle should only be called when ResultsReady returns true.
func (*QueryStatus) ResultsReady ¶
func (qs *QueryStatus) ResultsReady() bool
ResultsReady returns true if the query results are ready to be fetched.
func (*QueryStatus) String ¶
func (qs *QueryStatus) String() string
type QueryWarning ¶
QueryWarning encapsulates any warnings returned by a query.
type Scope ¶
type Scope struct {
// contains filtered or unexported fields
}
Scope represents an Operational Insights scope.
func (*Scope) ExecuteQuery ¶
func (s *Scope) ExecuteQuery(ctx context.Context, statement string, opts ...*QueryOptions) (*QueryResult, error)
ExecuteQuery executes the query statement on the server, tying the query context to this Scope. When ExecuteQuery is called with no context.Context, or a context.Context with no Deadline, then the Cluster level QueryTimeout will be applied.
func (*Scope) StartQuery ¶
func (s *Scope) StartQuery(ctx context.Context, statement string, opts ...*StartQueryOptions) (*QueryHandle, error)
StartQuery starts execution of a deferred query statement on the server and returns a QueryHandle that can be used to check status, retrieve results, cancel, or discard the query. When StartQuery is called with no context.Context, or a context.Context with no Deadline, then the Cluster level QueryTimeout will be applied.
type SecurityOptions ¶
type SecurityOptions struct {
// TrustOnly specifies the trust mode to use within the SDK.
TrustOnly TrustOnly
// DisableServerCertificateVerification when specified causes the SDK to trust ANY certificate
// regardless of validity.
DisableServerCertificateVerification *bool
}
SecurityOptions specifies options for controlling security related items such as TLS root certificates and verification skipping.
func NewSecurityOptions ¶
func NewSecurityOptions() *SecurityOptions
NewSecurityOptions creates a new instance of SecurityOptions.
func (*SecurityOptions) SetDisableServerCertificateVerification ¶
func (opts *SecurityOptions) SetDisableServerCertificateVerification(disabled bool) *SecurityOptions
SetDisableServerCertificateVerification sets the DisableServerCertificateVerification field in SecurityOptions.
func (*SecurityOptions) SetTrustOnly ¶
func (opts *SecurityOptions) SetTrustOnly(trustOnly TrustOnly) *SecurityOptions
SetTrustOnly sets the TrustOnly field in SecurityOptions.
type StartQueryOptions ¶
type StartQueryOptions struct {
// ClientContextID is an optional identifier for the query.
ClientContextID *string
// PositionalParameters sets any positional placeholder parameters for the query.
PositionalParameters []interface{}
// NamedParameters sets any named parameters for the query.
NamedParameters map[string]interface{}
// ReadOnly sets whether this query should be read-only.
ReadOnly *bool
// ScanConsistency specifies the level of data consistency required for this query.
ScanConsistency *QueryScanConsistency
// Raw provides a way to provide extra parameters in the request body for the query.
Raw map[string]interface{}
// MaxRetries specifies the maximum number of retries that a query will be attempted.
// This includes connection attempts.
// VOLATILE: This API is subject to change at any time.
MaxRetries *uint32
}
StartQueryOptions is the set of options available to an Operational Insights query.
func NewStartQueryOptions ¶
func NewStartQueryOptions() *StartQueryOptions
NewStartQueryOptions creates a new instance of StartQueryOptions.
func (*StartQueryOptions) SetClientContextID ¶
func (opts *StartQueryOptions) SetClientContextID(clientContextID string) *StartQueryOptions
SetClientContextID sets the ClientContextID field in StartQueryOptions.
func (*StartQueryOptions) SetMaxRetries ¶
func (opts *StartQueryOptions) SetMaxRetries(maxRetries uint32) *StartQueryOptions
SetMaxRetries sets the MaxRetries field in StartQueryOptions. VOLATILE: This API is subject to change at any time.
func (*StartQueryOptions) SetNamedParameters ¶
func (opts *StartQueryOptions) SetNamedParameters(params map[string]interface{}) *StartQueryOptions
SetNamedParameters sets the NamedParameters field in StartQueryOptions.
func (*StartQueryOptions) SetPositionalParameters ¶
func (opts *StartQueryOptions) SetPositionalParameters(params []interface{}) *StartQueryOptions
SetPositionalParameters sets the PositionalParameters field in StartQueryOptions.
func (*StartQueryOptions) SetRaw ¶
func (opts *StartQueryOptions) SetRaw(raw map[string]interface{}) *StartQueryOptions
SetRaw sets the Raw field in StartQueryOptions.
func (*StartQueryOptions) SetReadOnly ¶
func (opts *StartQueryOptions) SetReadOnly(readOnly bool) *StartQueryOptions
SetReadOnly sets the ReadOnly field in StartQueryOptions.
func (*StartQueryOptions) SetScanConsistency ¶
func (opts *StartQueryOptions) SetScanConsistency(scanConsistency QueryScanConsistency) *StartQueryOptions
SetScanConsistency sets the ScanConsistency field in StartQueryOptions.
type TimeoutOptions ¶
type TimeoutOptions struct {
// ConnectTimeout specifies the socket connection timeout, or more broadly the timeout
// for establishing an individual authenticated connection.
// Default = 10 seconds
ConnectTimeout *time.Duration
// QueryTimeout specifies the default amount of time to spend executing a query before timing it out.
// This value is only used if the context.Context at the operation level does not specify a deadline.
// Default = 10 minutes
QueryTimeout *time.Duration
}
TimeoutOptions specifies options for various operation timeouts.
func NewTimeoutOptions ¶
func NewTimeoutOptions() *TimeoutOptions
NewTimeoutOptions creates a new instance of TimeoutOptions.
func (*TimeoutOptions) SetConnectTimeout ¶
func (opts *TimeoutOptions) SetConnectTimeout(timeout time.Duration) *TimeoutOptions
SetConnectTimeout sets the ConnectTimeout field in TimeoutOptions.
func (*TimeoutOptions) SetQueryTimeout ¶
func (opts *TimeoutOptions) SetQueryTimeout(timeout time.Duration) *TimeoutOptions
SetQueryTimeout sets the QueryTimeout field in TimeoutOptions.
type TrustOnly ¶
type TrustOnly interface {
// contains filtered or unexported methods
}
TrustOnly specifies the trust mode to use within the SDK.
type TrustOnlyCapella ¶
type TrustOnlyCapella struct{}
TrustOnlyCapella tells the SDK to trust only the Capella CA certificate(s) bundled with the SDK. This is the default behavior.
type TrustOnlyCertificates ¶
TrustOnlyCertificates tells the SDK to trust only the specified certificates.
type TrustOnlyPemFile ¶
type TrustOnlyPemFile struct {
Path string
}
TrustOnlyPemFile tells the SDK to trust only the PEM-encoded certificate(s) in the file at the given FS path.
type TrustOnlyPemString ¶
type TrustOnlyPemString struct {
Pem string
}
TrustOnlyPemString tells the SDK to trust only the PEM-encoded certificate(s) in the given string.
type TrustOnlySystem ¶
type TrustOnlySystem struct{}
TrustOnlySystem tells the SDK to trust only the certificates trusted by the system cert pool.
type Unmarshaler ¶
type Unmarshaler interface {
// Unmarshal unmarshals the data into the provided value.
Unmarshal([]byte, interface{}) error
}
Unmarshaler provides a way to unmarshal data into a Go value.
type UserPassPair ¶
UserPassPair represents a username and password pair.
type VerboseLogger ¶
type VerboseLogger struct {
// contains filtered or unexported fields
}
VerboseLogger logs to stderr with a level of LogTrace.
func NewVerboseLogger ¶
func NewVerboseLogger() *VerboseLogger
NewVerboseLogger creates a new VerboseLogger instance.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
internal
|
|
|
httpqueryclient
Package httpqueryclient implements an HTTP client for making requests against a server.
|
Package httpqueryclient implements an HTTP client for making requests against a server. |
|
leakcheck
Package leakcheck provides utilities for detecting and reporting goroutine leaks in Go applications.
|
Package leakcheck provides utilities for detecting and reporting goroutine leaks in Go applications. |
|
logging
Package logging provides a simple logging interface and a default implementation using the standard log package.
|
Package logging provides a simple logging interface and a default implementation using the standard log package. |