arg2

package
v1.20.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package arg2 contains tchannel thrift Arg2 interfaces for external use.

These interfaces are currently unstable, and aren't covered by the API backwards-compatibility guarantee.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyValIterator

type KeyValIterator struct {
	// contains filtered or unexported fields
}

KeyValIterator is a iterator for reading tchannel-thrift Arg2 Scheme, which has key/value pairs (k~2 v~2). NOTE: to be optimized for performance, we try to limit the allocation done in the process of iteration.

func NewKeyValIterator

func NewKeyValIterator(arg2Payload []byte) (KeyValIterator, error)

NewKeyValIterator inits a KeyValIterator with the buffer pointing at start of Arg2. Return io.EOF if no iterator is available. NOTE: tchannel-thrift Arg Scheme starts with number of key/value pair.

func (KeyValIterator) Key

func (i KeyValIterator) Key() []byte

Key Returns the key.

func (KeyValIterator) Next

func (i KeyValIterator) Next() (kv KeyValIterator, _ error)

Next returns next iterator. Return io.EOF if no more key/value pair is available.

Note: We used named returns because of an unexpected performance improvement See https://github.com/golang/go/issues/40638

func (KeyValIterator) Remaining added in v1.20.0

func (i KeyValIterator) Remaining() bool

Remaining returns whether there's any pairs left to consume.

func (KeyValIterator) Value

func (i KeyValIterator) Value() []byte

Value returns value.

Jump to

Keyboard shortcuts

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