couchbase

package
v1.1.41 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2024 License: MIT Imports: 28 Imported by: 1

Documentation

Index

Constants

View Source
const DefaultCollectionName = "_default"

Variables

View Source
var (
	SrvVer550 = &Version{5, 5, 0, 0}
	SrvVer650 = &Version{6, 5, 0, 0}
	SrvVer720 = &Version{7, 2, 0, 0}
)

Functions

func CreateAgent added in v0.0.64

func CreateAgent(httpAddresses []string, bucketName string,
	username string, password string, secureConnection bool, rootCAPath string,
	connectionBufferSize uint, connectionTimeout time.Duration,
) (*gocbcore.Agent, error)

func CreateDocument

func CreateDocument(ctx context.Context,
	agent *gocbcore.Agent,
	scopeName string,
	collectionName string,
	id []byte,
	value []byte,
	flags uint32,
	expiry uint32,
) error

func CreatePath

func CreatePath(ctx context.Context,
	agent *gocbcore.Agent,
	scopeName string,
	collectionName string,
	id []byte,
	path []byte,
	value []byte,
	flags memd.SubdocDocFlag,
) error

func CreateSecurityConfig added in v0.0.64

func CreateSecurityConfig(username string, password string, secureConnection bool, rootCAPath string) gocbcore.SecurityConfig

func CreateTLSRootCaProvider added in v0.0.64

func CreateTLSRootCaProvider(rootCAPath string) func() *x509.CertPool

func DeleteDocument

func DeleteDocument(ctx context.Context, agent *gocbcore.Agent, scopeName string, collectionName string, id []byte) error

func Get

func Get(ctx context.Context, agent *gocbcore.Agent, scopeName string, collectionName string, id []byte) (*gocbcore.GetResult, error)

func GetXattrs

func GetXattrs(ctx context.Context, agent *gocbcore.Agent, scopeName string, collectionName string, id []byte, path string) ([]byte, error)

func NewCBMembership

func NewCBMembership(config *config.Dcp, client Client, bus EventBus.Bus) membership.Membership

func NewCBMetadata

func NewCBMetadata(client Client, config *config.Dcp) metadata.Metadata

func UpdateDocument

func UpdateDocument(ctx context.Context,
	agent *gocbcore.Agent,
	scopeName string,
	collectionName string,
	id []byte,
	value []byte,
	expiry uint32,
	cas *gocbcore.Cas,
) error

func UpsertXattrs

func UpsertXattrs(ctx context.Context,
	agent *gocbcore.Agent,
	scopeName string,
	collectionName string,
	id []byte,
	path string,
	value []byte,
	expiry uint32,
) error

Types

type AsyncOp

type AsyncOp interface {
	Resolve()
	Wait(op gocbcore.PendingOp, err error) error
}

func NewAsyncOp

func NewAsyncOp(ctx context.Context) AsyncOp

type BucketInfo added in v1.1.19

type BucketInfo struct {
	BucketType     string `json:"bucketType"`
	StorageBackend string `json:"storageBackend"`
}

func (*BucketInfo) IsEphemeral added in v1.1.19

func (b *BucketInfo) IsEphemeral() bool

func (*BucketInfo) IsMagma added in v1.1.19

func (b *BucketInfo) IsMagma() bool

type Client

type Client interface {
	Ping() (*models.PingResult, error)
	GetAgent() *gocbcore.Agent
	GetMetaAgent() *gocbcore.Agent
	Connect() error
	Close()
	DcpConnect(useExpiryOpcode bool, useChangeStreams bool) error
	DcpClose()
	GetVBucketSeqNos() (*wrapper.ConcurrentSwissMap[uint16, uint64], error)
	GetNumVBuckets() int
	GetFailoverLogs(vbID uint16) ([]gocbcore.FailoverEntry, error)
	OpenStream(vbID uint16, collectionIDs map[uint32]string, offset *models.Offset, observer Observer) error
	CloseStream(vbID uint16) error
	GetCollectionIDs(scopeName string, collectionNames []string) map[uint32]string
	GetAgentConfigSnapshot() (*gocbcore.ConfigSnapshot, error)
	GetDcpAgentConfigSnapshot() (*gocbcore.ConfigSnapshot, error)
	GetAgentQueues() []*models.AgentQueue
}

func NewClient

func NewClient(config *config.Dcp) Client

type HTTPClient added in v1.1.19

type HTTPClient interface {
	Connect() error
	GetVersion() (*Version, error)
	GetBucketInfo() (*BucketInfo, error)
}

func NewHTTPClient added in v1.1.19

func NewHTTPClient(config *config.Dcp, client Client) HTTPClient

type HealthCheck added in v1.1.19

type HealthCheck interface {
	Start()
	Stop()
}

func NewHealthCheck added in v1.1.19

func NewHealthCheck(config *config.HealthCheck, client Client) HealthCheck

type Instance

type Instance struct {
	ID              *string `json:"id,omitempty"`
	Type            string  `json:"type"`
	HeartbeatTime   int64   `json:"heartbeatTime"`
	ClusterJoinTime int64   `json:"clusterJoinTime"`
}

type Observer

type Observer interface {
	SnapshotMarker(marker models.DcpSnapshotMarker)
	Mutation(mutation gocbcore.DcpMutation)
	Deletion(deletion gocbcore.DcpDeletion)
	Expiration(expiration gocbcore.DcpExpiration)
	End(dcpEnd models.DcpStreamEnd, err error)
	CreateCollection(creation gocbcore.DcpCollectionCreation)
	DeleteCollection(deletion gocbcore.DcpCollectionDeletion)
	FlushCollection(flush gocbcore.DcpCollectionFlush)
	CreateScope(creation gocbcore.DcpScopeCreation)
	DeleteScope(deletion gocbcore.DcpScopeDeletion)
	ModifyCollection(modification gocbcore.DcpCollectionModification)
	OSOSnapshot(snapshot models.DcpOSOSnapshot)
	SeqNoAdvanced(advanced gocbcore.DcpSeqNoAdvanced)
	GetMetrics() *wrapper.ConcurrentSwissMap[uint16, *ObserverMetric]
	GetPersistSeqNo() *wrapper.ConcurrentSwissMap[uint16, gocbcore.SeqNo]
	Listen() models.ListenerCh
	Close()
	CloseEnd()
	ListenEnd() models.ListenerEndCh
	AddCatchup(vbID uint16, seqNo gocbcore.SeqNo)
	SetVbUUID(vbID uint16, vbUUID gocbcore.VbUUID)
}

func NewObserver

func NewObserver(
	config *dcp.Dcp,
	collectionIDs map[uint32]string,
	bus EventBus.Bus,
) Observer

type ObserverMetric

type ObserverMetric struct {
	TotalMutations   float64
	TotalDeletions   float64
	TotalExpirations float64
}

func (*ObserverMetric) AddDeletion

func (om *ObserverMetric) AddDeletion()

func (*ObserverMetric) AddExpiration

func (om *ObserverMetric) AddExpiration()

func (*ObserverMetric) AddMutation

func (om *ObserverMetric) AddMutation()

type PoolsResult added in v1.1.19

type PoolsResult struct {
	ImplementationVersion string `json:"implementationVersion"`
}

type RollbackMitigation

type RollbackMitigation interface {
	Start()
	Stop()
}

func NewRollbackMitigation

func NewRollbackMitigation(client Client, config *config.Dcp, vbIds []uint16, bus EventBus.Bus) RollbackMitigation

type Version added in v1.1.19

type Version struct {
	Major int
	Minor int
	Patch int
	Build int
}

Version snippet from https://github.com/couchbase/gocbcore/blob/master/nodeversion_test.go

func (*Version) Equal added in v1.1.19

func (v *Version) Equal(ov *Version) bool

func (*Version) Higher added in v1.1.19

func (v *Version) Higher(ov *Version) bool

func (*Version) Lower added in v1.1.19

func (v *Version) Lower(ov *Version) bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL