Versions in this module Expand all Collapse all v1 v1.0.1 Sep 12, 2023 v1.0.0 Jul 17, 2023 v0 v0.1.0 Jul 14, 2023 Changes in this version + const DefaultCCMaxAge + const DefaultClientTimeout + const DefaultDialerKeepAlive + const DefaultDialerTimeout + const DefaultPollTimeout + const DefaultRequestRetries + const DefaultRequestTimeout + const DefaultResponseHeaderTimeout + const DefaultTLSHandshakeTimeout + const DefaultTransportContinueTimeout + const DefaultTransportIdleConnTimeout + const TimeoutsEnvVar + var ErrConnectionModeRequiresNonTLS = errors.New("connection mode requires non-TLS communication") + var ErrExhaustedClusterNodes = errors.New("exhausted cluster nodes") + var ErrInvalidNetwork = errors.New("invalid use of 'network' query parameter, expected 'default' or 'external'") + var ErrNodeUninitialized = errors.New("attempted to connect to an uninitialized node") + var ErrNotBootstrapped = errors.New("auth provider not bootstrapped") + var ErrStreamWithTimeout = errors.New("using a timeout when executing a streaming request is unsupported") + var ErrThisNodeOnlyExpectsASingleAddress = errors.New(...) + var SupportedConnectionModes = []ConnectionMode + func IsEndpointNotFound(err error) bool + func IsServiceNotAvailable(err error) bool + func NewTestHandler(t *testing.T, status int, body []byte) http.HandlerFunc + func NewTestHandlerWithEOF(t *testing.T) http.HandlerFunc + func NewTestHandlerWithHijack(t *testing.T) http.HandlerFunc + func NewTestHandlerWithRetries(t *testing.T, numRetries, retryStatus, successStatus int, after string, ...) http.HandlerFunc + func NewTestHandlerWithStream(t *testing.T, responses int, body []byte) http.HandlerFunc + func NewTestHandlerWithStreamHijack(t *testing.T) http.HandlerFunc + func NewTestHandlerWithValue(t *testing.T, status int, body []byte, value any) http.HandlerFunc + type AlternateAddresses struct + External *External + type AuthProvider struct + func NewAuthProvider(options AuthProviderOptions) *AuthProvider + func (a *AuthProvider) GetAllServiceHosts(service Service) ([]string, error) + func (a *AuthProvider) GetCredentials(host string) (string, string) + func (a *AuthProvider) GetServiceHost(service Service, offset int) (string, error) + func (a *AuthProvider) GetUserAgent() string + func (a *AuthProvider) SetClusterConfig(host string, config *ClusterConfig) error + func (a *AuthProvider) UpdateResolvedAddress() + type AuthProviderOptions struct + type AuthenticationError struct + func (e *AuthenticationError) Error() string + type AuthorizationError struct + func (e *AuthorizationError) Error() string + type BootstrapFailureError struct + ErrAuthentication error + ErrAuthorization error + func (e *BootstrapFailureError) Error() string + type Client struct + func NewClient(options ClientOptions) (*Client, error) + func (c *Client) AltAddr() bool + func (c *Client) Close() + func (c *Client) ClusterUUID() string + func (c *Client) DeveloperPreview() bool + func (c *Client) Do(ctx context.Context, request *Request) (*http.Response, error) + func (c *Client) EnterpriseCluster() bool + func (c *Client) Execute(request *Request) (*Response, error) + func (c *Client) ExecuteStream(request *Request) (<-chan StreamingResponse, error) + func (c *Client) ExecuteStreamWithContext(ctx context.Context, request *Request) (<-chan StreamingResponse, error) + func (c *Client) ExecuteWithContext(ctx context.Context, request *Request) (*Response, error) + func (c *Client) GetAllServiceHosts(service Service) ([]string, error) + func (c *Client) GetServiceHost(service Service) (string, error) + func (c *Client) Nodes() Nodes + func (c *Client) Poll(poll func(attempt int) (bool, error)) (bool, error) + func (c *Client) PollTimeout() time.Duration + func (c *Client) PollWithContext(ctx context.Context, poll func(attempt int) (bool, error)) (bool, error) + func (c *Client) RequestRetries() int + func (c *Client) TLS() bool + type ClientOptions struct + ConnectionMode ConnectionMode + ConnectionString string + DisableCCP bool + Logger log.Logger + Provider aprov.Provider + ReqResLogLevel log.Level + TLSConfig *tls.Config + type ClusterConfig struct + Nodes Nodes + Revision int64 + func (c *ClusterConfig) BootstrapNode() *Node + func (c *ClusterConfig) FilterOtherNodes() + type ClusterConfigManager struct + func NewClusterConfigManager(logger log.Logger) *ClusterConfigManager + func (c *ClusterConfigManager) GetClusterConfig() *ClusterConfig + func (c *ClusterConfigManager) Update(config *ClusterConfig) error + func (c *ClusterConfigManager) WaitUntilExpired(ctx context.Context) + func (c *ClusterConfigManager) WaitUntilUpdated(ctx context.Context) + type ConnectionMode int + const ConnectionModeDefault + const ConnectionModeLoopback + const ConnectionModeThisNodeOnly + func (c ConnectionMode) AllowTLS() bool + func (c ConnectionMode) ThisNodeOnly() bool + type ContentType string + const ContentTypeJSON + const ContentTypeURLEncoded + type Endpoint string + const EndpointBucket + const EndpointBucketManifest + const EndpointBuckets + const EndpointNodesServices + const EndpointPools + const EndpointPoolsDefault + func (e Endpoint) Format(args ...string) Endpoint + type EndpointNotFoundError struct + func (e *EndpointNotFoundError) Error() string + type External struct + Hostname string + Services *Services + type Header map[string]string + type InternalServerError struct + func (e *InternalServerError) Error() string + type Method string + type Node struct + AlternateAddresses AlternateAddresses + BootstrapNode bool + Hostname string + Services *Services + func (n *Node) Copy() *Node + func (n *Node) GetHostname(useAltAddr bool) string + func (n *Node) GetPort(service Service, useSSL, useAltAddr bool) uint16 + func (n *Node) GetQualifiedHostname(service Service, useSSL, useAltAddr bool) (string, bool) + type Nodes []*Node + func (n Nodes) Copy() Nodes + type OldClusterConfigError struct + func (e *OldClusterConfigError) Error() string + type PollFunc func(attempt uint64) (bool, error) + type Request struct + Body []byte + ContentType ContentType + Endpoint Endpoint + ExpectedStatusCode int + Header Header + Host string + Idempotent bool + Method Method + NoRetryOnStatusCodes []int + QueryParameters url.Values + RetryOnStatusCodes []int + Service Service + Timeout time.Duration + func (r *Request) IsIdempotent() bool + type Response struct + Body []byte + StatusCode int + type RetriesExhaustedError struct + func (e *RetriesExhaustedError) Error() string + func (e *RetriesExhaustedError) Unwrap() error + type Service string + const ServiceAnalytics + const ServiceBackup + const ServiceData + const ServiceEventing + const ServiceGSI + const ServiceManagement + const ServiceQuery + const ServiceSearch + const ServiceViews + type ServiceNotAvailableError struct + func (e *ServiceNotAvailableError) Error() string + type Services struct + Backup uint16 + BackupSSL uint16 + CAPI uint16 + CAPISSL uint16 + CBAS uint16 + CBASSSL uint16 + Eventing uint16 + EventingSSL uint16 + FullText uint16 + FullTextSSL uint16 + KV uint16 + KVSSL uint16 + Management uint16 + ManagementSSL uint16 + N1QL uint16 + N1QLSSL uint16 + SecondaryIndex uint16 + SecondaryIndexSSL uint16 + func (s *Services) GetPort(service Service, useSSL bool) uint16 + type SocketClosedInFlightError struct + func (e *SocketClosedInFlightError) Error() string + type StreamingResponse struct + Error error + Payload []byte + type TestBucket struct + Manifest json.Marshaler + NumVBuckets uint16 + UUID string + type TestBuckets map[string]*TestBucket + type TestCluster struct + func NewTestCluster(t *testing.T, options TestClusterOptions) *TestCluster + func (t *TestCluster) Address() string + func (t *TestCluster) Bucket(name string) func(writer http.ResponseWriter, request *http.Request) + func (t *TestCluster) BucketManifest(name string) func(writer http.ResponseWriter, request *http.Request) + func (t *TestCluster) Buckets(writer http.ResponseWriter, _ *http.Request) + func (t *TestCluster) Certificate() *x509.Certificate + func (t *TestCluster) Close() + func (t *TestCluster) Handler(writer http.ResponseWriter, request *http.Request) + func (t *TestCluster) Hostname() string + func (t *TestCluster) NodeServices(writer http.ResponseWriter, _ *http.Request) + func (t *TestCluster) Nodes() Nodes + func (t *TestCluster) Pools(writer http.ResponseWriter, _ *http.Request) + func (t *TestCluster) PoolsDefault(writer http.ResponseWriter, _ *http.Request) + func (t *TestCluster) Port() uint16 + func (t *TestCluster) URL() string + type TestClusterOptions struct + Buckets TestBuckets + DeveloperPreview bool + Enterprise bool + Handlers TestHandlers + Nodes TestNodes + TLSConfig *tls.Config + UUID string + type TestHandlers map[string]http.HandlerFunc + func (e TestHandlers) Add(method, endpoint string, handler http.HandlerFunc) + func (e TestHandlers) Handle(writer http.ResponseWriter, request *http.Request) bool + type TestNode struct + AltAddress bool + SSL bool + Services []Service + Status string + Version cbvalue.Version + type TestNodes []*TestNode + type UnexpectedEndOfBodyError struct + func (e *UnexpectedEndOfBodyError) Error() string + type UnexpectedStatusCodeError struct + Status int + func (e *UnexpectedStatusCodeError) Error() string + type UnknownAuthorityError struct + func (e *UnknownAuthorityError) Error() string + type UnknownX509Error struct + func (e *UnknownX509Error) Error() string + func (e *UnknownX509Error) Unwrap() error Other modules containing this package github.com/couchbase/tools-common/couchbase/v2 github.com/couchbase/tools-common/couchbase/v3 github.com/couchbase/tools-common/couchbase/v4