Documentation ¶
Index ¶
- type CBuffer
- type GoFFI
- type GoFFIClient
- type GoFFIEchoGoArgs
- func (p *GoFFIEchoGoArgs) GetReq() (v *Ping)
- func (p *GoFFIEchoGoArgs) IsSetReq() bool
- func (p *GoFFIEchoGoArgs) Read(iprot thrift.TProtocol) (err error)
- func (p *GoFFIEchoGoArgs) ReadField1(iprot thrift.TProtocol) error
- func (p *GoFFIEchoGoArgs) String() string
- func (p *GoFFIEchoGoArgs) Write(oprot thrift.TProtocol) (err error)
- type GoFFIEchoGoResult
- func (p *GoFFIEchoGoResult) GetSuccess() (v *Pong)
- func (p *GoFFIEchoGoResult) IsSetSuccess() bool
- func (p *GoFFIEchoGoResult) Read(iprot thrift.TProtocol) (err error)
- func (p *GoFFIEchoGoResult) ReadField0(iprot thrift.TProtocol) error
- func (p *GoFFIEchoGoResult) String() string
- func (p *GoFFIEchoGoResult) Write(oprot thrift.TProtocol) (err error)
- type GoFFIProcessor
- func (p *GoFFIProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction)
- func (p *GoFFIProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool)
- func (p *GoFFIProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException)
- func (p *GoFFIProcessor) ProcessorMap() map[string]thrift.TProcessorFunction
- type Ping
- type Pong
- type ResultCode
- type RustFFI
- type RustFFIClient
- type RustFFIEchoRsArgs
- func (p *RustFFIEchoRsArgs) GetReq() (v *Ping)
- func (p *RustFFIEchoRsArgs) IsSetReq() bool
- func (p *RustFFIEchoRsArgs) Read(iprot thrift.TProtocol) (err error)
- func (p *RustFFIEchoRsArgs) ReadField1(iprot thrift.TProtocol) error
- func (p *RustFFIEchoRsArgs) String() string
- func (p *RustFFIEchoRsArgs) Write(oprot thrift.TProtocol) (err error)
- type RustFFIEchoRsResult
- func (p *RustFFIEchoRsResult) GetSuccess() (v *Pong)
- func (p *RustFFIEchoRsResult) IsSetSuccess() bool
- func (p *RustFFIEchoRsResult) Read(iprot thrift.TProtocol) (err error)
- func (p *RustFFIEchoRsResult) ReadField0(iprot thrift.TProtocol) error
- func (p *RustFFIEchoRsResult) String() string
- func (p *RustFFIEchoRsResult) Write(oprot thrift.TProtocol) (err error)
- type RustFFIProcessor
- func (p *RustFFIProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction)
- func (p *RustFFIProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool)
- func (p *RustFFIProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException)
- func (p *RustFFIProcessor) ProcessorMap() map[string]thrift.TProcessorFunction
- type RustFfi
- type RustFfiImpl
- type RustFfiResult
- func (r RustFfiResult[T]) AsError() error
- func (r RustFfiResult[T]) IsOk() bool
- func (r RustFfiResult[T]) JsonUnmarshal() (*T, error)
- func (r RustFfiResult[T]) JsonUnmarshalUnchecked() *T
- func (r RustFfiResult[T]) PbUnmarshal() (*T, error)
- func (r RustFfiResult[T]) PbUnmarshalUnchecked() *T
- func (r RustFfiResult[T]) String() string
- func (r RustFfiResult[T]) Unmarshal(unmarshal func([]byte, any) error) (*T, error)
- func (r RustFfiResult[T]) UnmarshalUnchecked(unmarshal func([]byte, any) error) *T
- type TBytes
- func TBytesFromBytes[T any](bytes []byte) TBytes[T]
- func TBytesFromJson[T any](obj T) (TBytes[T], error)
- func TBytesFromJsonUnchecked[T proto.Message](obj T) TBytes[T]
- func TBytesFromPb[T proto.Message](obj T) (TBytes[T], error)
- func TBytesFromPbUnchecked[T proto.Message](obj T) TBytes[T]
- func TBytesFromString[T any](s string) TBytes[T]
- func (b TBytes[T]) ForCBuffer() (unsafe.Pointer, int)
- func (b TBytes[T]) JsonUnmarshal() (*T, error)
- func (b TBytes[T]) JsonUnmarshalUnchecked() *T
- func (b TBytes[T]) Len() int
- func (b TBytes[T]) PbUnmarshal() (*T, error)
- func (b TBytes[T]) PbUnmarshalUnchecked() *T
- func (b TBytes[T]) Unmarshal(unmarshal func([]byte, any) error) (*T, error)
- func (b TBytes[T]) UnmarshalUnchecked(unmarshal func([]byte, any) error) *T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CBuffer ¶
type CBuffer struct {
// contains filtered or unexported fields
}
CBuffer Rust buffer for Go
type GoFFIClient ¶
type GoFFIClient struct {
// contains filtered or unexported fields
}
func NewGoFFIClient ¶
func NewGoFFIClient(c thrift.TClient) *GoFFIClient
func NewGoFFIClientFactory ¶
func NewGoFFIClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *GoFFIClient
func NewGoFFIClientProtocol ¶
func NewGoFFIClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *GoFFIClient
func (*GoFFIClient) Client_ ¶
func (p *GoFFIClient) Client_() thrift.TClient
type GoFFIEchoGoArgs ¶
type GoFFIEchoGoArgs struct {
Req *Ping `thrift:"req,1" json:"req"`
}
func NewGoFFIEchoGoArgs ¶
func NewGoFFIEchoGoArgs() *GoFFIEchoGoArgs
func (*GoFFIEchoGoArgs) GetReq ¶
func (p *GoFFIEchoGoArgs) GetReq() (v *Ping)
func (*GoFFIEchoGoArgs) IsSetReq ¶
func (p *GoFFIEchoGoArgs) IsSetReq() bool
func (*GoFFIEchoGoArgs) ReadField1 ¶
func (p *GoFFIEchoGoArgs) ReadField1(iprot thrift.TProtocol) error
func (*GoFFIEchoGoArgs) String ¶
func (p *GoFFIEchoGoArgs) String() string
type GoFFIEchoGoResult ¶
type GoFFIEchoGoResult struct {
Success *Pong `thrift:"success,0,optional" json:"success,omitempty"`
}
func NewGoFFIEchoGoResult ¶
func NewGoFFIEchoGoResult() *GoFFIEchoGoResult
func (*GoFFIEchoGoResult) GetSuccess ¶
func (p *GoFFIEchoGoResult) GetSuccess() (v *Pong)
func (*GoFFIEchoGoResult) IsSetSuccess ¶
func (p *GoFFIEchoGoResult) IsSetSuccess() bool
func (*GoFFIEchoGoResult) Read ¶
func (p *GoFFIEchoGoResult) Read(iprot thrift.TProtocol) (err error)
func (*GoFFIEchoGoResult) ReadField0 ¶
func (p *GoFFIEchoGoResult) ReadField0(iprot thrift.TProtocol) error
func (*GoFFIEchoGoResult) String ¶
func (p *GoFFIEchoGoResult) String() string
type GoFFIProcessor ¶
type GoFFIProcessor struct {
// contains filtered or unexported fields
}
func NewGoFFIProcessor ¶
func NewGoFFIProcessor(handler GoFFI) *GoFFIProcessor
func (*GoFFIProcessor) AddToProcessorMap ¶
func (p *GoFFIProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction)
func (*GoFFIProcessor) GetProcessorFunction ¶
func (p *GoFFIProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool)
func (*GoFFIProcessor) Process ¶
func (p *GoFFIProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException)
func (*GoFFIProcessor) ProcessorMap ¶
func (p *GoFFIProcessor) ProcessorMap() map[string]thrift.TProcessorFunction
type Ping ¶
type Ping struct {
Msg string `thrift:"msg,1" json:"msg"`
}
var GoFFIEchoGoArgs_Req_DEFAULT *Ping
var RustFFIEchoRsArgs_Req_DEFAULT *Ping
type Pong ¶
type Pong struct {
Msg string `thrift:"msg,1" json:"msg"`
}
var GoFFIEchoGoResult_Success_DEFAULT *Pong
var RustFFIEchoRsResult_Success_DEFAULT *Pong
type ResultCode ¶
type ResultCode = int8
const ( RcNoError ResultCode = 0 RcDecode ResultCode = -1 RcEncode ResultCode = -2 RcUnknown ResultCode = -128 )
type RustFFIClient ¶
type RustFFIClient struct {
// contains filtered or unexported fields
}
func NewRustFFIClient ¶
func NewRustFFIClient(c thrift.TClient) *RustFFIClient
func NewRustFFIClientFactory ¶
func NewRustFFIClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *RustFFIClient
func NewRustFFIClientProtocol ¶
func NewRustFFIClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *RustFFIClient
func (*RustFFIClient) Client_ ¶
func (p *RustFFIClient) Client_() thrift.TClient
type RustFFIEchoRsArgs ¶
type RustFFIEchoRsArgs struct {
Req *Ping `thrift:"req,1" json:"req"`
}
func NewRustFFIEchoRsArgs ¶
func NewRustFFIEchoRsArgs() *RustFFIEchoRsArgs
func (*RustFFIEchoRsArgs) GetReq ¶
func (p *RustFFIEchoRsArgs) GetReq() (v *Ping)
func (*RustFFIEchoRsArgs) IsSetReq ¶
func (p *RustFFIEchoRsArgs) IsSetReq() bool
func (*RustFFIEchoRsArgs) Read ¶
func (p *RustFFIEchoRsArgs) Read(iprot thrift.TProtocol) (err error)
func (*RustFFIEchoRsArgs) ReadField1 ¶
func (p *RustFFIEchoRsArgs) ReadField1(iprot thrift.TProtocol) error
func (*RustFFIEchoRsArgs) String ¶
func (p *RustFFIEchoRsArgs) String() string
type RustFFIEchoRsResult ¶
type RustFFIEchoRsResult struct {
Success *Pong `thrift:"success,0,optional" json:"success,omitempty"`
}
func NewRustFFIEchoRsResult ¶
func NewRustFFIEchoRsResult() *RustFFIEchoRsResult
func (*RustFFIEchoRsResult) GetSuccess ¶
func (p *RustFFIEchoRsResult) GetSuccess() (v *Pong)
func (*RustFFIEchoRsResult) IsSetSuccess ¶
func (p *RustFFIEchoRsResult) IsSetSuccess() bool
func (*RustFFIEchoRsResult) Read ¶
func (p *RustFFIEchoRsResult) Read(iprot thrift.TProtocol) (err error)
func (*RustFFIEchoRsResult) ReadField0 ¶
func (p *RustFFIEchoRsResult) ReadField0(iprot thrift.TProtocol) error
func (*RustFFIEchoRsResult) String ¶
func (p *RustFFIEchoRsResult) String() string
type RustFFIProcessor ¶
type RustFFIProcessor struct {
// contains filtered or unexported fields
}
func NewRustFFIProcessor ¶
func NewRustFFIProcessor(handler RustFFI) *RustFFIProcessor
func (*RustFFIProcessor) AddToProcessorMap ¶
func (p *RustFFIProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction)
func (*RustFFIProcessor) GetProcessorFunction ¶
func (p *RustFFIProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool)
func (*RustFFIProcessor) Process ¶
func (p *RustFFIProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException)
func (*RustFFIProcessor) ProcessorMap ¶
func (p *RustFFIProcessor) ProcessorMap() map[string]thrift.TProcessorFunction
type RustFfi ¶
type RustFfi interface {
EchoRs(req TBytes[*Ping]) RustFfiResult[Pong]
}
var GlobalRustFfi RustFfi = RustFfiImpl{}
type RustFfiImpl ¶
type RustFfiImpl struct{}
func (RustFfiImpl) EchoRs ¶
func (RustFfiImpl) EchoRs(req TBytes[*Ping]) RustFfiResult[Pong]
type RustFfiResult ¶
type RustFfiResult[T any] struct { CBuffer Code ResultCode // contains filtered or unexported fields }
RustFfiResult Rust FFI Result for Go NOTE: must call Free method to free rust memory buffer!
func (RustFfiResult[T]) AsError ¶
func (r RustFfiResult[T]) AsError() error
AsError as an error NOTE: reference Rust memory buffer
func (RustFfiResult[T]) IsOk ¶
func (r RustFfiResult[T]) IsOk() bool
func (RustFfiResult[T]) JsonUnmarshal ¶
func (r RustFfiResult[T]) JsonUnmarshal() (*T, error)
JsonUnmarshal as json to unmarshal NOTE: maybe reference Rust memory buffer
func (RustFfiResult[T]) JsonUnmarshalUnchecked ¶
func (r RustFfiResult[T]) JsonUnmarshalUnchecked() *T
JsonUnmarshalUnchecked as json to unmarshal NOTE: maybe reference Rust memory buffer
func (RustFfiResult[T]) PbUnmarshal ¶
func (r RustFfiResult[T]) PbUnmarshal() (*T, error)
PbUnmarshal as protobuf to unmarshal NOTE: maybe reference Rust memory buffer
func (RustFfiResult[T]) PbUnmarshalUnchecked ¶
func (r RustFfiResult[T]) PbUnmarshalUnchecked() *T
PbUnmarshalUnchecked as protobuf to unmarshal NOTE: maybe reference Rust memory buffer
func (RustFfiResult[T]) String ¶
func (r RustFfiResult[T]) String() string
func (RustFfiResult[T]) Unmarshal ¶
func (r RustFfiResult[T]) Unmarshal(unmarshal func([]byte, any) error) (*T, error)
Unmarshal unmarshal to object NOTE: maybe reference Rust memory buffer
func (RustFfiResult[T]) UnmarshalUnchecked ¶
func (r RustFfiResult[T]) UnmarshalUnchecked(unmarshal func([]byte, any) error) *T
UnmarshalUnchecked unmarshal to object NOTE: maybe reference Rust memory buffer
type TBytes ¶
type TBytes[T any] struct { // contains filtered or unexported fields }
TBytes bytes with type marker
func TBytesFromBytes ¶
TBytesFromBytes new TBytes from bytes
func TBytesFromJson ¶
func TBytesFromJsonUnchecked ¶
func TBytesFromPbUnchecked ¶
func TBytesFromString ¶
TBytesFromString new TBytes from string
func (TBytes[T]) JsonUnmarshal ¶
JsonUnmarshal as json to unmarshal NOTE: maybe reference Rust memory buffer
func (TBytes[T]) JsonUnmarshalUnchecked ¶
func (b TBytes[T]) JsonUnmarshalUnchecked() *T
JsonUnmarshalUnchecked as json to unmarshal NOTE: maybe reference Rust memory buffer
func (TBytes[T]) PbUnmarshal ¶
PbUnmarshal as protobuf to unmarshal NOTE: maybe reference Rust memory buffer
func (TBytes[T]) PbUnmarshalUnchecked ¶
func (b TBytes[T]) PbUnmarshalUnchecked() *T
PbUnmarshalUnchecked as protobuf to unmarshal NOTE: maybe reference Rust memory buffer