struct CryBase::CouchBase::Services::KV::Request

Overview

One outbound packet for the KV service, as a pure value type. RequestBuffer.make serializes it; RequestWriter#write sends it.

req = KV::Request.new(KV::Opcode::Get, key: "hello")
req.opcode    # => KV::Opcode::Get
req.key       # => "hello"
req.opaque    # => 0_u32
req.to_buffer # => Bytes

The fields:

Defined in:

crybase/couchbase/services/kv/request.cr:23
crybase/couchbase/services/kv/request.cr:32

Constructors

Instance Method Summary

Constructor Detail

def self.new(opcode : Opcode, key : String = "", extras : Bytes = Bytes.empty, value : Bytes = Bytes.empty, cas : UInt64 = 0_u64, opaque : UInt32 = 0_u32, vbucket : UInt16 = 0_u16) #

[View source]

Instance Method Detail

def cas : UInt64 #

def clone #

[View source]
def copy_with(opcode _opcode = @opcode, key _key = @key, extras _extras = @extras, value _value = @value, cas _cas = @cas, opaque _opaque = @opaque, vbucket _vbucket = @vbucket) #

[View source]
def extras : Bytes #

def key : String #

def opaque : UInt32 #

def opcode : Opcode #

def to_buffer : Bytes #

Serializes this request into one binary KV packet.


[View source]
def value : Bytes #

def vbucket : UInt16 #