apache

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2026 License: Apache-2.0 Imports: 6 Imported by: 2 modules, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package apache contains code for working with apache thrift indirectly

It acts as a bridge between generated code which relies on apache codec like:

Write(p thrift.TProtocol) error
Read(p thrift.TProtocol) error

and kitex ecosystem.

Because we're deprecating apache thrift, all kitex ecosystem code will not rely on apache thrift except one pkg: `github.com/cloudwego/kitex/pkg/protocol/bthrift`. Why is the package chosen? All legacy generated code relies on it, and we may not be able to update the code in a brief timeframe. So the package is chosen to register helper methods to this package in order to use it without importing `github.com/apache/thrift`

Users must call `RegisterCheckTStruct`, `RegisterThriftRead` and `RegisterThriftWrite` for using `CheckTStruct`, `ThriftRead`, and `ThriftWrite`

see README.md of `bthrift` above for more details

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckTStruct added in v0.1.1

func CheckTStruct(v interface{}) error

CheckTStruct ...

func RegisterCheckTStruct added in v0.1.1

func RegisterCheckTStruct(fn func(v interface{}) error)

RegisterCheckTStruct accepts `thrift.TStruct check` func and save it for later use.

func RegisterThriftRead added in v0.1.1

func RegisterThriftRead(fn func(r bufiox.Reader, v interface{}) error)

RegisterThriftRead ...

func RegisterThriftWrite added in v0.1.1

func RegisterThriftWrite(fn func(w bufiox.Writer, v interface{}) error)

RegisterThriftWrite ...

func ThriftRead

func ThriftRead(r bufiox.Reader, v interface{}) error

ThriftRead ...

func ThriftWrite

func ThriftWrite(w bufiox.Writer, v interface{}) error

ThriftWrite ...

Types

type TTransport

type TTransport interface {
	io.ReadWriteCloser
	RemainingBytes() (num_bytes uint64)
	Flush(ctx context.Context) (err error)
	Open() error
	IsOpen() bool
}

TTransport is identical with thrift.TTransport.

func NewBufferTransport added in v0.1.1

func NewBufferTransport(buf *bytes.Buffer) TTransport

NewBufferTransport extends bytes.Buffer to support TTransport

func NewDefaultTransport added in v0.1.1

func NewDefaultTransport(rw io.ReadWriter) TTransport

NewDefaultTransport converts io.ReadWriter to TTransport. Use NewBufferTransport if using *bytes.Buffer for better performance.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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