Documentation ¶
Index ¶
- func EnableLogging()
- type BucketConfigOption
- type Cluster
- type ClusterConfigOption
- type Node
- func (n *Node) Configure(t *testing.T, opts ...ClusterConfigOption)
- func (n *Node) Host() string
- func (n *Node) Password() string
- func (n *Node) Setup(t *testing.T, opts ...NodeConfigOption) *Node
- func (n *Node) Teardown(t *testing.T)
- func (n *Node) Username() string
- func (n *Node) WaitForIndexing(t *testing.T, name string, atLeast int)
- type NodeConfigOption
- func AlwaysPull(pull bool) NodeConfigOption
- func Credentials(username, password string) NodeConfigOption
- func DockerImage(image string) NodeConfigOption
- func IndexTimeout(secs int) NodeConfigOption
- func MemoryQuotas(dataMb, indexMb, searchMb uint) NodeConfigOption
- func Port(port uint) NodeConfigOption
- func Timeout(secs int) NodeConfigOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnableLogging ¶
func EnableLogging()
EnableLogging - disabled by default, but useful is something isn't working.
Types ¶
type BucketConfigOption ¶
type BucketConfigOption func(*bucketConfig)
BucketConfigOption functions can be passed to Bucket() to configure its creation.
func MemoryQuota ¶
func MemoryQuota(mb int) BucketConfigOption
MemoryQuota for a bucket in megabytes.
type Cluster ¶
type Cluster struct {
// contains filtered or unexported fields
}
Cluster provides access to cluster-level configuration and operations.
type ClusterConfigOption ¶
type ClusterConfigOption func(*clusterConfig)
ClusterConfigOption functions can be passed to Node.Configure() to configure its creation.
func Bucket ¶
func Bucket(name string, opts ...BucketConfigOption) ClusterConfigOption
Bucket configures a bucket creation with the specified name, and other optional parameters.
func BucketTimeout ¶
func BucketTimeout(secs int) ClusterConfigOption
BucketTimeout configures a time in seconds to wait for a bucket to be created.
func CreateIndexTimeout ¶
func CreateIndexTimeout(secs int) ClusterConfigOption
CreateIndexTimeout configures a time in seconds to wait for an index to be created.
func GeoSearchIndex ¶
func GeoSearchIndex(name, path, bucket string) ClusterConfigOption
GeoSearchIndex configures a geospatial index creation with the specified name for the specified bucket.
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node provides access to node-level configuration and operations.
func (*Node) Configure ¶
func (n *Node) Configure(t *testing.T, opts ...ClusterConfigOption)
Configure buckets and indexes.
func (*Node) Setup ¶
func (n *Node) Setup(t *testing.T, opts ...NodeConfigOption) *Node
Setup creates a new Couchbase node with optional specified configuration. Configuration includes the Docker image to use, node memory quotas, and node credentials.
type NodeConfigOption ¶
type NodeConfigOption func(*nodeConfig)
NodeConfigOption functions can be passed to Node.Setup() to configure its creation.
func AlwaysPull ¶
func AlwaysPull(pull bool) NodeConfigOption
AlwaysPull is set to true by default. When true, Node.Setup() will attempt to pull the latest image specified by DockerImage(). When false, Node.Setup() will use the locally available image specified by DockerImage(). Setting this to true allows the library to be used without a network connection.
func Credentials ¶
func Credentials(username, password string) NodeConfigOption
Credentials configures the username and password for the node. These can be retrieved again with Node.Username() and Node.Password().
func DockerImage ¶
func DockerImage(image string) NodeConfigOption
DockerImage configures the Couchbase image.
func IndexTimeout ¶
func IndexTimeout(secs int) NodeConfigOption
IndexTimeout configures a time in seconds to wait for indexing to complete.
func MemoryQuotas ¶
func MemoryQuotas(dataMb, indexMb, searchMb uint) NodeConfigOption
MemoryQuotas configures the data, index and search memory quotas in megabytes.
func Timeout ¶
func Timeout(secs int) NodeConfigOption
Timeout configures a time in seconds to wait for a node to be available.