couchbase

package
v1.1.8 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: MIT Imports: 24 Imported by: 4

Documentation

Index

Constants

View Source
const DefaultCollectionName = "_default"

Variables

This section is empty.

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) ([]byte, 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 helpers.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,
) 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 Client

type Client interface {
	Ping() error
	GetAgent() *gocbcore.Agent
	GetMetaAgent() *gocbcore.Agent
	Connect() error
	Close()
	DcpConnect() error
	DcpClose()
	GetVBucketSeqNos() (map[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
	GetConfigSnapshot() (*gocbcore.ConfigSnapshot, error)
}

func NewClient

func NewClient(config *config.Dcp) Client

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 models.DcpCollectionCreation)
	DeleteCollection(deletion models.DcpCollectionDeletion)
	FlushCollection(flush models.DcpCollectionFlush)
	CreateScope(creation models.DcpScopeCreation)
	DeleteScope(deletion models.DcpScopeDeletion)
	ModifyCollection(modification models.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 helpers.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 RollbackMitigation

type RollbackMitigation interface {
	Start()
	Stop()
}

func NewRollbackMitigation

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

Jump to

Keyboard shortcuts

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