Documentation ¶
Index ¶
- Constants
- func AcquireTimer(d time.Duration) *time.Timer
- func CreateMemdPipeline(address string) *memdPipeline
- func DialMemdConn(address string, tlsConfig *tls.Config, deadline time.Time) (*memdConn, error)
- func ReleaseTimer(t *time.Timer, wasRead bool)
- func SetLogger(logger Logger)
- type Agent
- func (c *Agent) Add(key, value []byte, flags uint32, expiry uint32, cb StoreCallback) (PendingOp, error)
- func (c *Agent) Append(key, value []byte, cb StoreCallback) (PendingOp, error)
- func (agent *Agent) CapiEps() []string
- func (agent *Agent) Close()
- func (c *Agent) CloseStream(vbId uint16, cb CloseStreamCallback) (PendingOp, error)
- func (c *Agent) Decrement(key []byte, delta, initial uint64, expiry uint32, cb CounterCallback) (PendingOp, error)
- func (c *Agent) DeleteMeta(key, extra []byte, flags, expiry uint32, cas, revseqno uint64, ...) (PendingOp, error)
- func (c *Agent) Get(key []byte, cb GetCallback) (PendingOp, error)
- func (c *Agent) GetAndLock(key []byte, lockTime uint32, cb GetCallback) (PendingOp, error)
- func (c *Agent) GetAndTouch(key []byte, expiry uint32, cb GetCallback) (PendingOp, error)
- func (c *Agent) GetFailoverLog(vbId uint16, cb GetFailoverLogCallback) (PendingOp, error)
- func (c *Agent) GetLastCheckpoint(vbId uint16, cb GetLastCheckpointCallback) (PendingOp, error)
- func (c *Agent) GetRandom(cb GetRandomCallback) (PendingOp, error)
- func (c *Agent) GetReplica(key []byte, replicaIdx int, cb GetCallback) (PendingOp, error)
- func (c *Agent) HttpClient() *http.Client
- func (c *Agent) Increment(key []byte, delta, initial uint64, expiry uint32, cb CounterCallback) (PendingOp, error)
- func (c *Agent) IsSecure() bool
- func (c *Agent) KeyToVbucket(key []byte) uint16
- func (agent *Agent) MgmtEps() []string
- func (agent *Agent) N1qlEps() []string
- func (c *Agent) NumReplicas() int
- func (c *Agent) NumVbuckets() int
- func (c *Agent) Observe(key []byte, replicaIdx int, cb ObserveCallback) (PendingOp, error)
- func (c *Agent) ObserveSeqNo(key []byte, vbUuid VbUuid, replicaIdx int, cb ObserveSeqNoCallback) (PendingOp, error)
- func (c *Agent) OpenStream(vbId uint16, vbUuid VbUuid, ...) (PendingOp, error)
- func (c *Agent) Prepend(key, value []byte, cb StoreCallback) (PendingOp, error)
- func (c *Agent) Remove(key []byte, cas Cas, cb RemoveCallback) (PendingOp, error)
- func (c *Agent) Replace(key, value []byte, flags uint32, cas Cas, expiry uint32, cb StoreCallback) (PendingOp, error)
- func (c *Agent) ServerConnectTimeout() time.Duration
- func (c *Agent) Set(key, value []byte, flags uint32, expiry uint32, cb StoreCallback) (PendingOp, error)
- func (c *Agent) SetMeta(key, value, extra []byte, flags, expiry uint32, cas, revseqno uint64, ...) (PendingOp, error)
- func (c *Agent) SetServerConnectTimeout(timeout time.Duration)
- func (c *Agent) Touch(key []byte, cas Cas, expiry uint32, cb TouchCallback) (PendingOp, error)
- func (c *Agent) Unlock(key []byte, cas Cas, cb UnlockCallback) (PendingOp, error)
- type AgentConfig
- type AuthClient
- type AuthErrorType
- type AuthFunc
- type BadRouteHandler
- type Callback
- type Cas
- type CloseHandler
- type CloseStreamCallback
- type CommandCode
- type CommandMagic
- type CounterCallback
- type FailoverEntry
- type GetCallback
- type GetFailoverLogCallback
- type GetLastCheckpointCallback
- type GetRandomCallback
- type HelloFeature
- type KeyState
- type Logger
- type MutationToken
- type ObserveCallback
- type ObserveSeqNoCallback
- type OpenStreamCallback
- type PendingOp
- type RemoveCallback
- type SeqNo
- type SnapshotState
- type StatusCode
- type StoreCallback
- type StreamEndStatus
- type StreamObserver
- type TouchCallback
- type UnlockCallback
- type VbUuid
Constants ¶
View Source
const ( ReqMagic = CommandMagic(0x80) ResMagic = CommandMagic(0x81) )
View Source
const ( CmdGet = CommandCode(0x00) CmdSet = CommandCode(0x01) CmdAdd = CommandCode(0x02) CmdReplace = CommandCode(0x03) CmdDelete = CommandCode(0x04) CmdIncrement = CommandCode(0x05) CmdDecrement = CommandCode(0x06) CmdAppend = CommandCode(0x0e) CmdPrepend = CommandCode(0x0f) CmdStat = CommandCode(0x10) CmdTouch = CommandCode(0x1c) CmdGAT = CommandCode(0x1d) CmdHello = CommandCode(0x1f) CmdSASLListMechs = CommandCode(0x20) CmdSASLAuth = CommandCode(0x21) CmdSASLStep = CommandCode(0x22) CmdDcpOpenConnection = CommandCode(0x50) CmdDcpAddStream = CommandCode(0x51) CmdDcpCloseStream = CommandCode(0x52) CmdDcpStreamReq = CommandCode(0x53) CmdDcpGetFailoverLog = CommandCode(0x54) CmdDcpStreamEnd = CommandCode(0x55) CmdDcpSnapshotMarker = CommandCode(0x56) CmdDcpMutation = CommandCode(0x57) CmdDcpDeletion = CommandCode(0x58) CmdDcpExpiration = CommandCode(0x59) CmdDcpFlush = CommandCode(0x5a) CmdDcpSetVbucketState = CommandCode(0x5b) CmdDcpNoop = CommandCode(0x5c) CmdDcpBufferAck = CommandCode(0x5d) CmdDcpControl = CommandCode(0x5e) CmdGetReplica = CommandCode(0x83) CmdSelectBucket = CommandCode(0x89) CmdObserveSeqNo = CommandCode(0x91) CmdObserve = CommandCode(0x92) CmdGetLocked = CommandCode(0x94) CmdUnlockKey = CommandCode(0x95) CmdGetLastCheckpoint = CommandCode(0x97) CmdSetMeta = CommandCode(0xa2) CmdDetMeta = CommandCode(0xa8) CmdGetClusterConfig = CommandCode(0xb5) CmdGetRandom = CommandCode(0xb6) )
View Source
const ( FeatureDatatype = HelloFeature(0x01) FeatureSeqNo = HelloFeature(0x04) )
View Source
const ( StatusSuccess = StatusCode(0x00) StatusKeyNotFound = StatusCode(0x01) StatusKeyExists = StatusCode(0x02) StatusTooBig = StatusCode(0x03) StatusInvalidArgs = StatusCode(0x04) StatusNotStored = StatusCode(0x05) StatusBadDelta = StatusCode(0x06) StatusNotMyVBucket = StatusCode(0x07) StatusNoBucket = StatusCode(0x08) StatusAuthStale = StatusCode(0x1f) StatusAuthError = StatusCode(0x20) StatusAuthContinue = StatusCode(0x21) StatusRangeError = StatusCode(0x22) StatusRollback = StatusCode(0x23) StatusAccessError = StatusCode(0x24) StatusNotInitialized = StatusCode(0x25) StatusUnknownCommand = StatusCode(0x81) StatusOutOfMemory = StatusCode(0x82) StatusNotSupported = StatusCode(0x83) StatusInternalError = StatusCode(0x84) StatusBusy = StatusCode(0x85) StatusTmpFail = StatusCode(0x86) )
View Source
const ( KeyStateNotPersisted = KeyState(0x00) KeyStatePersisted = KeyState(0x01) KeyStateNotFound = KeyState(0x80) KeyStateDeleted = KeyState(0x81) )
View Source
const ( StreamEndOK = StreamEndStatus(0x00) StreamEndClosed = StreamEndStatus(0x01) StreamEndStateChanged = StreamEndStatus(0x02) StreamEndDisconnected = StreamEndStatus(0x03) StreamEndTooSlow = StreamEndStatus(0x04) )
Variables ¶
This section is empty.
Functions ¶
func CreateMemdPipeline ¶
func CreateMemdPipeline(address string) *memdPipeline
func DialMemdConn ¶
func ReleaseTimer ¶
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
This class represents the base client handling connections to a Couchbase Server. This is used internally by the higher level classes for communicating with the cluster, it can also be used to perform more advanced operations with a cluster.
func CreateAgent ¶
func CreateAgent(config *AgentConfig) (*Agent, error)
func CreateDcpAgent ¶
func CreateDcpAgent(config *AgentConfig, dcpStreamName string) (*Agent, error)
func (*Agent) Append ¶
func (c *Agent) Append(key, value []byte, cb StoreCallback) (PendingOp, error)
func (*Agent) CloseStream ¶
func (c *Agent) CloseStream(vbId uint16, cb CloseStreamCallback) (PendingOp, error)
func (*Agent) DeleteMeta ¶
func (*Agent) GetAndLock ¶
func (*Agent) GetAndTouch ¶
func (*Agent) GetFailoverLog ¶
func (c *Agent) GetFailoverLog(vbId uint16, cb GetFailoverLogCallback) (PendingOp, error)
func (*Agent) GetLastCheckpoint ¶
func (c *Agent) GetLastCheckpoint(vbId uint16, cb GetLastCheckpointCallback) (PendingOp, error)
func (*Agent) GetReplica ¶
func (*Agent) HttpClient ¶
Returns a pre-configured HTTP Client for communicating with
Couchbase Server. You must still specify authentication information for any dispatched requests.
func (*Agent) KeyToVbucket ¶
func (*Agent) NumReplicas ¶
func (*Agent) NumVbuckets ¶
func (*Agent) ObserveSeqNo ¶
func (*Agent) OpenStream ¶
func (c *Agent) OpenStream(vbId uint16, vbUuid VbUuid, startSeqNo, endSeqNo, snapStartSeqNo, snapEndSeqNo SeqNo, evtHandler StreamObserver, cb OpenStreamCallback) (PendingOp, error)
func (*Agent) Prepend ¶
func (c *Agent) Prepend(key, value []byte, cb StoreCallback) (PendingOp, error)
func (*Agent) ServerConnectTimeout ¶
The timeout for each server connection, including all authentication steps.
func (*Agent) SetServerConnectTimeout ¶
type AgentConfig ¶
type AuthClient ¶
type AuthErrorType ¶
type AuthErrorType interface {
AuthError() bool
}
type BadRouteHandler ¶
type BadRouteHandler func(*memdPipeline, *memdQRequest, *memdResponse)
type CloseHandler ¶
type CloseHandler func(*memdPipeline)
type CloseStreamCallback ¶
type CloseStreamCallback func(error)
type CommandMagic ¶
type CommandMagic uint8
type CounterCallback ¶
type CounterCallback func(uint64, Cas, MutationToken, error)
type FailoverEntry ¶
type GetFailoverLogCallback ¶
type GetFailoverLogCallback func([]FailoverEntry, error)
type HelloFeature ¶
type HelloFeature uint16
type Logger ¶
func DefaultStdOutLogger ¶
func DefaultStdOutLogger() Logger
type MutationToken ¶
type ObserveCallback ¶
type ObserveSeqNoCallback ¶
type OpenStreamCallback ¶
type OpenStreamCallback func([]FailoverEntry, error)
type RemoveCallback ¶
type RemoveCallback func(Cas, MutationToken, error)
type SnapshotState ¶
type SnapshotState uint32
func (SnapshotState) HasInMemory ¶
func (s SnapshotState) HasInMemory() bool
func (SnapshotState) HasOnDisk ¶
func (s SnapshotState) HasOnDisk() bool
type StoreCallback ¶
type StoreCallback func(Cas, MutationToken, error)
type StreamEndStatus ¶
type StreamEndStatus uint32
type StreamObserver ¶
type StreamObserver interface { SnapshotMarker(startSeqNo, endSeqNo uint64, vbId uint16, snapshotType SnapshotState) Mutation(seqNo, revNo uint64, flags, expiry, lockTime uint32, cas uint64, datatype uint8, vbId uint16, key, value []byte) Deletion(seqNo, revNo, cas uint64, vbId uint16, key []byte) Expiration(seqNo, revNo, cas uint64, vbId uint16, key []byte) End(vbId uint16, err error) }
type TouchCallback ¶
type TouchCallback func(Cas, MutationToken, error)
type UnlockCallback ¶
type UnlockCallback func(Cas, MutationToken, error)
Click to show internal directories.
Click to hide internal directories.