Documentation ¶
Index ¶
- func DecodeHeader(bytes []byte, h *BytesHeader) (err error)
- func EncodeHeader(buf buffer.IoBuffer, h *BytesHeader)
- func GetHeaderEncodeLength(h *BytesHeader) (size int)
- type BytesHeader
- func (h *BytesHeader) Add(Key string, Value string)
- func (h *BytesHeader) ByteSize() (size uint64)
- func (h *BytesHeader) Clone() *BytesHeader
- func (h *BytesHeader) Del(Key string)
- func (h *BytesHeader) Get(Key string) (Value string, ok bool)
- func (h *BytesHeader) Range(f func(Key, Value string) bool)
- func (h *BytesHeader) Set(Key string, Value string)
- type BytesKV
- type CommonHeader
- func (h CommonHeader) Add(key string, value string)
- func (h CommonHeader) ByteSize() uint64
- func (h CommonHeader) Clone() api.HeaderMap
- func (h CommonHeader) Del(key string)
- func (h CommonHeader) Get(key string) (value string, ok bool)
- func (h CommonHeader) Range(f func(key, value string) bool)
- func (h CommonHeader) Set(key string, value string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeHeader ¶
func DecodeHeader(bytes []byte, h *BytesHeader) (err error)
func EncodeHeader ¶
func EncodeHeader(buf buffer.IoBuffer, h *BytesHeader)
func GetHeaderEncodeLength ¶
func GetHeaderEncodeLength(h *BytesHeader) (size int)
Types ¶
type BytesHeader ¶
BytesHeader consists of multi key-value pair in byte slice formation. This could reduce the cost of []byte to string for protocol codec.
func (*BytesHeader) Add ¶
func (h *BytesHeader) Add(Key string, Value string)
func (*BytesHeader) ByteSize ¶
func (h *BytesHeader) ByteSize() (size uint64)
func (*BytesHeader) Clone ¶
func (h *BytesHeader) Clone() *BytesHeader
func (*BytesHeader) Del ¶
func (h *BytesHeader) Del(Key string)
func (*BytesHeader) Get ¶
func (h *BytesHeader) Get(Key string) (Value string, ok bool)
~ BytesHeaderMap
func (*BytesHeader) Range ¶
func (h *BytesHeader) Range(f func(Key, Value string) bool)
func (*BytesHeader) Set ¶
func (h *BytesHeader) Set(Key string, Value string)
type CommonHeader ¶
CommonHeader wrapper for map[string]string, is an implementation of api.HeaderMap
func (CommonHeader) Add ¶
func (h CommonHeader) Add(key string, value string)
Add value for given key. Multiple headers with the same key may be added with this function. Use Set for setting a single header for the given key.
func (CommonHeader) ByteSize ¶
func (h CommonHeader) ByteSize() uint64
func (CommonHeader) Clone ¶
func (h CommonHeader) Clone() api.HeaderMap
Clone used to deep copy header's map
func (CommonHeader) Get ¶
func (h CommonHeader) Get(key string) (value string, ok bool)
Get value of key
func (CommonHeader) Range ¶
func (h CommonHeader) Range(f func(key, value string) bool)
Range calls f sequentially for each key and value present in the map. If f returns false, range stops the iteration.
func (CommonHeader) Set ¶
func (h CommonHeader) Set(key string, value string)
Set key-value pair in header map, the previous pair will be replaced if exists
Click to show internal directories.
Click to hide internal directories.