mock

package
v0.11.3-generic-streaming Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Code generated by Kitex v0.9.1. DO NOT EDIT.

Index

Constants

This section is empty.

Variables

View Source
var File_pbapi_proto protoreflect.FileDescriptor

Functions

func NewInvoker

func NewInvoker(handler Mock, opts ...server.Option) server.Invoker

NewInvoker creates a server.Invoker with the given handler and options.

func NewServer

func NewServer(handler Mock, opts ...server.Option) server.Server

NewServer creates a server.Server with the given handler and options.

func NewServiceInfo

func NewServiceInfo() *kitex.ServiceInfo

NewServiceInfo creates a new ServiceInfo containing all methods

func NewServiceInfoForClient

func NewServiceInfoForClient() *kitex.ServiceInfo

NewServiceInfo creates a new ServiceInfo containing non-streaming methods

func NewServiceInfoForStreamClient

func NewServiceInfoForStreamClient() *kitex.ServiceInfo

func RegisterService

func RegisterService(svr server.Server, handler Mock, opts ...server.RegisterOption) error

Types

type BidirectionalStreamingTestArgs

type BidirectionalStreamingTestArgs struct {
	Req *MockReq
}

func (*BidirectionalStreamingTestArgs) FastRead

func (p *BidirectionalStreamingTestArgs) FastRead(buf []byte, _type int8, number int32) (n int, err error)

func (*BidirectionalStreamingTestArgs) FastWrite

func (p *BidirectionalStreamingTestArgs) FastWrite(buf []byte) (n int)

func (*BidirectionalStreamingTestArgs) GetFirstArgument

func (p *BidirectionalStreamingTestArgs) GetFirstArgument() interface{}

func (*BidirectionalStreamingTestArgs) GetReq

func (*BidirectionalStreamingTestArgs) IsSetReq

func (p *BidirectionalStreamingTestArgs) IsSetReq() bool

func (*BidirectionalStreamingTestArgs) Marshal

func (p *BidirectionalStreamingTestArgs) Marshal(out []byte) ([]byte, error)

func (*BidirectionalStreamingTestArgs) Size

func (p *BidirectionalStreamingTestArgs) Size() (n int)

func (*BidirectionalStreamingTestArgs) Unmarshal

func (p *BidirectionalStreamingTestArgs) Unmarshal(in []byte) error

type BidirectionalStreamingTestResult

type BidirectionalStreamingTestResult struct {
	Success *MockResp
}

func (*BidirectionalStreamingTestResult) FastRead

func (p *BidirectionalStreamingTestResult) FastRead(buf []byte, _type int8, number int32) (n int, err error)

func (*BidirectionalStreamingTestResult) FastWrite

func (p *BidirectionalStreamingTestResult) FastWrite(buf []byte) (n int)

func (*BidirectionalStreamingTestResult) GetResult

func (p *BidirectionalStreamingTestResult) GetResult() interface{}

func (*BidirectionalStreamingTestResult) GetSuccess

func (p *BidirectionalStreamingTestResult) GetSuccess() *MockResp

func (*BidirectionalStreamingTestResult) IsSetSuccess

func (p *BidirectionalStreamingTestResult) IsSetSuccess() bool

func (*BidirectionalStreamingTestResult) Marshal

func (p *BidirectionalStreamingTestResult) Marshal(out []byte) ([]byte, error)

func (*BidirectionalStreamingTestResult) SetSuccess

func (p *BidirectionalStreamingTestResult) SetSuccess(x interface{})

func (*BidirectionalStreamingTestResult) Size

func (p *BidirectionalStreamingTestResult) Size() (n int)

func (*BidirectionalStreamingTestResult) Unmarshal

func (p *BidirectionalStreamingTestResult) Unmarshal(in []byte) error

type Client

type Client interface {
	UnaryTest(ctx context.Context, Req *MockReq, callOptions ...callopt.Option) (r *MockResp, err error)
	ClientStreamingTest(ctx context.Context, callOptions ...callopt.Option) (stream Mock_ClientStreamingTestClient, err error)
	ServerStreamingTest(ctx context.Context, Req *MockReq, callOptions ...callopt.Option) (stream Mock_ServerStreamingTestClient, err error)
	BidirectionalStreamingTest(ctx context.Context, callOptions ...callopt.Option) (stream Mock_BidirectionalStreamingTestClient, err error)
}

Client is designed to provide IDL-compatible methods with call-option parameter for kitex framework.

func MustNewClient

func MustNewClient(destService string, opts ...client.Option) Client

MustNewClient creates a client for the service defined in IDL. It panics if any error occurs.

func NewClient

func NewClient(destService string, opts ...client.Option) (Client, error)

NewClient creates a client for the service defined in IDL.

type ClientStreamingTestArgs

type ClientStreamingTestArgs struct {
	Req *MockReq
}

func (*ClientStreamingTestArgs) FastRead

func (p *ClientStreamingTestArgs) FastRead(buf []byte, _type int8, number int32) (n int, err error)

func (*ClientStreamingTestArgs) FastWrite

func (p *ClientStreamingTestArgs) FastWrite(buf []byte) (n int)

func (*ClientStreamingTestArgs) GetFirstArgument

func (p *ClientStreamingTestArgs) GetFirstArgument() interface{}

func (*ClientStreamingTestArgs) GetReq

func (p *ClientStreamingTestArgs) GetReq() *MockReq

func (*ClientStreamingTestArgs) IsSetReq

func (p *ClientStreamingTestArgs) IsSetReq() bool

func (*ClientStreamingTestArgs) Marshal

func (p *ClientStreamingTestArgs) Marshal(out []byte) ([]byte, error)

func (*ClientStreamingTestArgs) Size

func (p *ClientStreamingTestArgs) Size() (n int)

func (*ClientStreamingTestArgs) Unmarshal

func (p *ClientStreamingTestArgs) Unmarshal(in []byte) error

type ClientStreamingTestResult

type ClientStreamingTestResult struct {
	Success *MockResp
}

func (*ClientStreamingTestResult) FastRead

func (p *ClientStreamingTestResult) FastRead(buf []byte, _type int8, number int32) (n int, err error)

func (*ClientStreamingTestResult) FastWrite

func (p *ClientStreamingTestResult) FastWrite(buf []byte) (n int)

func (*ClientStreamingTestResult) GetResult

func (p *ClientStreamingTestResult) GetResult() interface{}

func (*ClientStreamingTestResult) GetSuccess

func (p *ClientStreamingTestResult) GetSuccess() *MockResp

func (*ClientStreamingTestResult) IsSetSuccess

func (p *ClientStreamingTestResult) IsSetSuccess() bool

func (*ClientStreamingTestResult) Marshal

func (p *ClientStreamingTestResult) Marshal(out []byte) ([]byte, error)

func (*ClientStreamingTestResult) SetSuccess

func (p *ClientStreamingTestResult) SetSuccess(x interface{})

func (*ClientStreamingTestResult) Size

func (p *ClientStreamingTestResult) Size() (n int)

func (*ClientStreamingTestResult) Unmarshal

func (p *ClientStreamingTestResult) Unmarshal(in []byte) error

type Mock

type Mock interface {
	UnaryTest(ctx context.Context, req *MockReq) (res *MockResp, err error)
	ClientStreamingTest(stream Mock_ClientStreamingTestServer) (err error)
	ServerStreamingTest(req *MockReq, stream Mock_ServerStreamingTestServer) (err error)
	BidirectionalStreamingTest(stream Mock_BidirectionalStreamingTestServer) (err error)
}

type MockReq

type MockReq struct {
	Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}
var BidirectionalStreamingTestArgs_Req_DEFAULT *MockReq
var ClientStreamingTestArgs_Req_DEFAULT *MockReq
var ServerStreamingTestArgs_Req_DEFAULT *MockReq
var UnaryTestArgs_Req_DEFAULT *MockReq

func (*MockReq) Descriptor deprecated

func (*MockReq) Descriptor() ([]byte, []int)

Deprecated: Use MockReq.ProtoReflect.Descriptor instead.

func (*MockReq) FastRead

func (x *MockReq) FastRead(buf []byte, _type int8, number int32) (offset int, err error)

func (*MockReq) FastWrite

func (x *MockReq) FastWrite(buf []byte) (offset int)

func (*MockReq) GetMessage

func (x *MockReq) GetMessage() string

func (*MockReq) ProtoMessage

func (*MockReq) ProtoMessage()

func (*MockReq) ProtoReflect

func (x *MockReq) ProtoReflect() protoreflect.Message

func (*MockReq) Reset

func (x *MockReq) Reset()

func (*MockReq) Size

func (x *MockReq) Size() (n int)

func (*MockReq) String

func (x *MockReq) String() string

type MockResp

type MockResp struct {
	Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}
var BidirectionalStreamingTestResult_Success_DEFAULT *MockResp
var ClientStreamingTestResult_Success_DEFAULT *MockResp
var ServerStreamingTestResult_Success_DEFAULT *MockResp
var UnaryTestResult_Success_DEFAULT *MockResp

func (*MockResp) Descriptor deprecated

func (*MockResp) Descriptor() ([]byte, []int)

Deprecated: Use MockResp.ProtoReflect.Descriptor instead.

func (*MockResp) FastRead

func (x *MockResp) FastRead(buf []byte, _type int8, number int32) (offset int, err error)

func (*MockResp) FastWrite

func (x *MockResp) FastWrite(buf []byte) (offset int)

func (*MockResp) GetMessage

func (x *MockResp) GetMessage() string

func (*MockResp) ProtoMessage

func (*MockResp) ProtoMessage()

func (*MockResp) ProtoReflect

func (x *MockResp) ProtoReflect() protoreflect.Message

func (*MockResp) Reset

func (x *MockResp) Reset()

func (*MockResp) Size

func (x *MockResp) Size() (n int)

func (*MockResp) String

func (x *MockResp) String() string

type Mock_BidirectionalStreamingTestClient

type Mock_BidirectionalStreamingTestClient interface {
	streaming.Stream
	Send(*MockReq) error
	Recv() (*MockResp, error)
}

type Mock_BidirectionalStreamingTestServer

type Mock_BidirectionalStreamingTestServer interface {
	streaming.Stream
	Recv() (*MockReq, error)
	Send(*MockResp) error
}

type Mock_ClientStreamingTestClient

type Mock_ClientStreamingTestClient interface {
	streaming.Stream
	Send(*MockReq) error
	CloseAndRecv() (*MockResp, error)
}

type Mock_ClientStreamingTestServer

type Mock_ClientStreamingTestServer interface {
	streaming.Stream
	Recv() (*MockReq, error)
	SendAndClose(*MockResp) error
}

type Mock_ServerStreamingTestClient

type Mock_ServerStreamingTestClient interface {
	streaming.Stream
	Recv() (*MockResp, error)
}

type Mock_ServerStreamingTestServer

type Mock_ServerStreamingTestServer interface {
	streaming.Stream
	Send(*MockResp) error
}

type ServerStreamingTestArgs

type ServerStreamingTestArgs struct {
	Req *MockReq
}

func (*ServerStreamingTestArgs) FastRead

func (p *ServerStreamingTestArgs) FastRead(buf []byte, _type int8, number int32) (n int, err error)

func (*ServerStreamingTestArgs) FastWrite

func (p *ServerStreamingTestArgs) FastWrite(buf []byte) (n int)

func (*ServerStreamingTestArgs) GetFirstArgument

func (p *ServerStreamingTestArgs) GetFirstArgument() interface{}

func (*ServerStreamingTestArgs) GetReq

func (p *ServerStreamingTestArgs) GetReq() *MockReq

func (*ServerStreamingTestArgs) IsSetReq

func (p *ServerStreamingTestArgs) IsSetReq() bool

func (*ServerStreamingTestArgs) Marshal

func (p *ServerStreamingTestArgs) Marshal(out []byte) ([]byte, error)

func (*ServerStreamingTestArgs) Size

func (p *ServerStreamingTestArgs) Size() (n int)

func (*ServerStreamingTestArgs) Unmarshal

func (p *ServerStreamingTestArgs) Unmarshal(in []byte) error

type ServerStreamingTestResult

type ServerStreamingTestResult struct {
	Success *MockResp
}

func (*ServerStreamingTestResult) FastRead

func (p *ServerStreamingTestResult) FastRead(buf []byte, _type int8, number int32) (n int, err error)

func (*ServerStreamingTestResult) FastWrite

func (p *ServerStreamingTestResult) FastWrite(buf []byte) (n int)

func (*ServerStreamingTestResult) GetResult

func (p *ServerStreamingTestResult) GetResult() interface{}

func (*ServerStreamingTestResult) GetSuccess

func (p *ServerStreamingTestResult) GetSuccess() *MockResp

func (*ServerStreamingTestResult) IsSetSuccess

func (p *ServerStreamingTestResult) IsSetSuccess() bool

func (*ServerStreamingTestResult) Marshal

func (p *ServerStreamingTestResult) Marshal(out []byte) ([]byte, error)

func (*ServerStreamingTestResult) SetSuccess

func (p *ServerStreamingTestResult) SetSuccess(x interface{})

func (*ServerStreamingTestResult) Size

func (p *ServerStreamingTestResult) Size() (n int)

func (*ServerStreamingTestResult) Unmarshal

func (p *ServerStreamingTestResult) Unmarshal(in []byte) error

type StreamClient

type StreamClient interface {
	ClientStreamingTest(ctx context.Context, callOptions ...streamcall.Option) (stream Mock_ClientStreamingTestClient, err error)
	ServerStreamingTest(ctx context.Context, Req *MockReq, callOptions ...streamcall.Option) (stream Mock_ServerStreamingTestClient, err error)
	BidirectionalStreamingTest(ctx context.Context, callOptions ...streamcall.Option) (stream Mock_BidirectionalStreamingTestClient, err error)
}

StreamClient is designed to provide Interface for Streaming APIs.

func MustNewStreamClient

func MustNewStreamClient(destService string, opts ...streamclient.Option) StreamClient

MustNewStreamClient creates a stream client for the service's streaming APIs defined in IDL. It panics if any error occurs.

func NewStreamClient

func NewStreamClient(destService string, opts ...streamclient.Option) (StreamClient, error)

NewStreamClient creates a stream client for the service's streaming APIs defined in IDL.

type UnaryTestArgs

type UnaryTestArgs struct {
	Req *MockReq
}

func (*UnaryTestArgs) FastRead

func (p *UnaryTestArgs) FastRead(buf []byte, _type int8, number int32) (n int, err error)

func (*UnaryTestArgs) FastWrite

func (p *UnaryTestArgs) FastWrite(buf []byte) (n int)

func (*UnaryTestArgs) GetFirstArgument

func (p *UnaryTestArgs) GetFirstArgument() interface{}

func (*UnaryTestArgs) GetReq

func (p *UnaryTestArgs) GetReq() *MockReq

func (*UnaryTestArgs) IsSetReq

func (p *UnaryTestArgs) IsSetReq() bool

func (*UnaryTestArgs) Marshal

func (p *UnaryTestArgs) Marshal(out []byte) ([]byte, error)

func (*UnaryTestArgs) Size

func (p *UnaryTestArgs) Size() (n int)

func (*UnaryTestArgs) Unmarshal

func (p *UnaryTestArgs) Unmarshal(in []byte) error

type UnaryTestResult

type UnaryTestResult struct {
	Success *MockResp
}

func (*UnaryTestResult) FastRead

func (p *UnaryTestResult) FastRead(buf []byte, _type int8, number int32) (n int, err error)

func (*UnaryTestResult) FastWrite

func (p *UnaryTestResult) FastWrite(buf []byte) (n int)

func (*UnaryTestResult) GetResult

func (p *UnaryTestResult) GetResult() interface{}

func (*UnaryTestResult) GetSuccess

func (p *UnaryTestResult) GetSuccess() *MockResp

func (*UnaryTestResult) IsSetSuccess

func (p *UnaryTestResult) IsSetSuccess() bool

func (*UnaryTestResult) Marshal

func (p *UnaryTestResult) Marshal(out []byte) ([]byte, error)

func (*UnaryTestResult) SetSuccess

func (p *UnaryTestResult) SetSuccess(x interface{})

func (*UnaryTestResult) Size

func (p *UnaryTestResult) Size() (n int)

func (*UnaryTestResult) Unmarshal

func (p *UnaryTestResult) Unmarshal(in []byte) error

Jump to

Keyboard shortcuts

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