customtransport

package
v3.3.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2017 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TBufferedReadTransport

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

TBufferedReadTransport is a thrift.TTransport that reads from a buffer

func NewTBufferedReadTransport

func NewTBufferedReadTransport(readBuf *bytes.Buffer) (*TBufferedReadTransport, error)

NewTBufferedReadTransport creates a buffer backed TTransport

func (*TBufferedReadTransport) Close

func (p *TBufferedReadTransport) Close() error

Close does nothing as transport is not maintaining the connection Required to maintain thrift.TTransport interface

func (*TBufferedReadTransport) Flush

func (p *TBufferedReadTransport) Flush() error

Flush does nothing as udp server does not write responses back Required to maintain thrift.TTransport interface

func (*TBufferedReadTransport) IsOpen

func (p *TBufferedReadTransport) IsOpen() bool

IsOpen does nothing as transport is not maintaining the connection Required to maintain thrift.TTransport interface

func (*TBufferedReadTransport) Open

func (p *TBufferedReadTransport) Open() error

Open does nothing as transport is not maintaining the connection Required to maintain thrift.TTransport interface

func (*TBufferedReadTransport) Read

func (p *TBufferedReadTransport) Read(buf []byte) (int, error)

Read reads bytes from the local buffer and puts them in the specified buf

func (*TBufferedReadTransport) RemainingBytes

func (p *TBufferedReadTransport) RemainingBytes() uint64

RemainingBytes returns the number of bytes left to be read from the readBuf

func (*TBufferedReadTransport) Write

func (p *TBufferedReadTransport) Write(buf []byte) (int, error)

Write writes bytes into the read buffer Required to maintain thrift.TTransport interface

type TCalcTransport

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

TCalcTransport is a thrift TTransport that is used to calculate how many bytes are used when writing a thrift element. It is thread-safe

func (*TCalcTransport) Close

func (p *TCalcTransport) Close() error

Close does nothing as transport is not maintaining a connection Required to maintain thrift.TTransport interface

func (*TCalcTransport) Flush

func (p *TCalcTransport) Flush() error

Flush does nothing as it's not required for calculations Required to maintain thrift.TTransport interface

func (*TCalcTransport) GetCount

func (p *TCalcTransport) GetCount() int32

GetCount returns the number of bytes that would be written Required to maintain thrift.TTransport interface

func (*TCalcTransport) IsOpen

func (p *TCalcTransport) IsOpen() bool

IsOpen does nothing as transport is not maintaining a connection Required to maintain thrift.TTransport interface

func (*TCalcTransport) Open

func (p *TCalcTransport) Open() error

Open does nothing as transport is not maintaining a connection Required to maintain thrift.TTransport interface

func (*TCalcTransport) Read

func (p *TCalcTransport) Read(buf []byte) (int, error)

Read does nothing as it's not required for calculations Required to maintain thrift.TTransport interface

func (*TCalcTransport) RemainingBytes

func (p *TCalcTransport) RemainingBytes() uint64

RemainingBytes returns the max number of bytes (same as Thrift's StreamTransport) as we do not know how many bytes we have left.

func (*TCalcTransport) ResetCount

func (p *TCalcTransport) ResetCount()

ResetCount resets the number of bytes written to 0

func (*TCalcTransport) Write

func (p *TCalcTransport) Write(buf []byte) (int, error)

Write adds the number of bytes written to the count Required to maintain thrift.TTransport interface

Jump to

Keyboard shortcuts

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