Documentation ¶
Overview ¶
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at *
- http://www.dreaminglwj.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
Package remote is a generated GoMock package.
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at *
- http://www.dreaminglwj.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
Index ¶
- Constants
- func ACLInterceptor(credentials primitive.Credentials) primitive.Interceptor
- func NewRemotingClient() *remotingClient
- type ClientRequestFunc
- type CustomHeader
- type LanguageCode
- type MockRemotingClient
- func (m *MockRemotingClient) EXPECT() *MockRemotingClientMockRecorder
- func (m *MockRemotingClient) InvokeAsync(ctx context.Context, addr string, request *RemotingCommand, ...) error
- func (m *MockRemotingClient) InvokeOneWay(ctx context.Context, addr string, request *RemotingCommand, ...) error
- func (m *MockRemotingClient) InvokeSync(ctx context.Context, addr string, request *RemotingCommand, ...) (*RemotingCommand, error)
- func (m *MockRemotingClient) RegisterInterceptor(interceptors ...primitive.Interceptor)
- func (m *MockRemotingClient) RegisterRequestFunc(code int16, f ClientRequestFunc)
- func (m *MockRemotingClient) ShutDown()
- type MockRemotingClientMockRecorder
- func (mr *MockRemotingClientMockRecorder) InvokeAsync(ctx, addr, request, timeout, callback interface{}) *gomock.Call
- func (mr *MockRemotingClientMockRecorder) InvokeOneWay(ctx, addr, request, timeout interface{}) *gomock.Call
- func (mr *MockRemotingClientMockRecorder) InvokeSync(ctx, addr, request, timeout interface{}) *gomock.Call
- func (mr *MockRemotingClientMockRecorder) RegisterInterceptor(interceptors ...interface{}) *gomock.Call
- func (mr *MockRemotingClientMockRecorder) RegisterRequestFunc(code, f interface{}) *gomock.Call
- func (mr *MockRemotingClientMockRecorder) ShutDown() *gomock.Call
- type RPCHook
- type RemotingClient
- type RemotingCommand
- type ResponseFuture
- type TcpOption
Constants ¶
const ( // 0, REQUEST_COMMAND RPCType = 0 // 1, RPC RPCOneWay = 1 //ResponseType for response ResponseType = 1 )
const ( JsonCodecs = byte(0) RocketMQCodecs = byte(1) )
Variables ¶
This section is empty.
Functions ¶
func ACLInterceptor ¶
func ACLInterceptor(credentials primitive.Credentials) primitive.Interceptor
func NewRemotingClient ¶
func NewRemotingClient() *remotingClient
Types ¶
type ClientRequestFunc ¶
type ClientRequestFunc func(*RemotingCommand, net.Addr) *RemotingCommand
type CustomHeader ¶
type LanguageCode ¶
type LanguageCode byte
func (LanguageCode) MarshalJSON ¶
func (lc LanguageCode) MarshalJSON() ([]byte, error)
func (LanguageCode) String ¶
func (lc LanguageCode) String() string
func (*LanguageCode) UnmarshalJSON ¶
func (lc *LanguageCode) UnmarshalJSON(b []byte) error
type MockRemotingClient ¶
type MockRemotingClient struct {
// contains filtered or unexported fields
}
MockRemotingClient is a mock of RemotingClient interface
func NewMockRemotingClient ¶
func NewMockRemotingClient(ctrl *gomock.Controller) *MockRemotingClient
NewMockRemotingClient creates a new mock instance
func (*MockRemotingClient) EXPECT ¶
func (m *MockRemotingClient) EXPECT() *MockRemotingClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockRemotingClient) InvokeAsync ¶
func (m *MockRemotingClient) InvokeAsync(ctx context.Context, addr string, request *RemotingCommand, timeout time.Duration, callback func(*ResponseFuture)) error
InvokeAsync mocks base method
func (*MockRemotingClient) InvokeOneWay ¶
func (m *MockRemotingClient) InvokeOneWay(ctx context.Context, addr string, request *RemotingCommand, timeout time.Duration) error
InvokeOneWay mocks base method
func (*MockRemotingClient) InvokeSync ¶
func (m *MockRemotingClient) InvokeSync(ctx context.Context, addr string, request *RemotingCommand, timeout time.Duration) (*RemotingCommand, error)
InvokeSync mocks base method
func (*MockRemotingClient) RegisterInterceptor ¶
func (m *MockRemotingClient) RegisterInterceptor(interceptors ...primitive.Interceptor)
RegisterInterceptor mocks base method
func (*MockRemotingClient) RegisterRequestFunc ¶
func (m *MockRemotingClient) RegisterRequestFunc(code int16, f ClientRequestFunc)
RegisterRequestFunc mocks base method
func (*MockRemotingClient) ShutDown ¶
func (m *MockRemotingClient) ShutDown()
ShutDown mocks base method
type MockRemotingClientMockRecorder ¶
type MockRemotingClientMockRecorder struct {
// contains filtered or unexported fields
}
MockRemotingClientMockRecorder is the mock recorder for MockRemotingClient
func (*MockRemotingClientMockRecorder) InvokeAsync ¶
func (mr *MockRemotingClientMockRecorder) InvokeAsync(ctx, addr, request, timeout, callback interface{}) *gomock.Call
InvokeAsync indicates an expected call of InvokeAsync
func (*MockRemotingClientMockRecorder) InvokeOneWay ¶
func (mr *MockRemotingClientMockRecorder) InvokeOneWay(ctx, addr, request, timeout interface{}) *gomock.Call
InvokeOneWay indicates an expected call of InvokeOneWay
func (*MockRemotingClientMockRecorder) InvokeSync ¶
func (mr *MockRemotingClientMockRecorder) InvokeSync(ctx, addr, request, timeout interface{}) *gomock.Call
InvokeSync indicates an expected call of InvokeSync
func (*MockRemotingClientMockRecorder) RegisterInterceptor ¶
func (mr *MockRemotingClientMockRecorder) RegisterInterceptor(interceptors ...interface{}) *gomock.Call
RegisterInterceptor indicates an expected call of RegisterInterceptor
func (*MockRemotingClientMockRecorder) RegisterRequestFunc ¶
func (mr *MockRemotingClientMockRecorder) RegisterRequestFunc(code, f interface{}) *gomock.Call
RegisterRequestFunc indicates an expected call of RegisterRequestFunc
func (*MockRemotingClientMockRecorder) ShutDown ¶
func (mr *MockRemotingClientMockRecorder) ShutDown() *gomock.Call
ShutDown indicates an expected call of ShutDown
type RPCHook ¶
type RPCHook interface { DoBeforeRequest(string, *RemotingCommand) DoAfterResponse(string, *RemotingCommand) }
type RemotingClient ¶
type RemotingClient interface { RegisterRequestFunc(code int16, f ClientRequestFunc) RegisterInterceptor(interceptors ...primitive.Interceptor) InvokeSync(ctx context.Context, addr string, request *RemotingCommand, timeout time.Duration) (*RemotingCommand, error) InvokeAsync(ctx context.Context, addr string, request *RemotingCommand, timeout time.Duration, callback func(*ResponseFuture)) error InvokeOneWay(ctx context.Context, addr string, request *RemotingCommand, timeout time.Duration) error ShutDown() }
type RemotingCommand ¶
type RemotingCommand struct { Code int16 `json:"code"` Language LanguageCode `json:"language,string"` Version int16 `json:"version"` Opaque int32 `json:"opaque"` Flag int32 `json:"flag"` Remark string `json:"remark"` ExtFields map[string]string `json:"extFields"` Body []byte `json:"-"` }
func NewRemotingCommand ¶
func NewRemotingCommand(code int16, header CustomHeader, body []byte) *RemotingCommand
func (*RemotingCommand) String ¶
func (command *RemotingCommand) String() string
type ResponseFuture ¶
type ResponseFuture struct { ResponseCommand *RemotingCommand SendRequestOK bool Err error Opaque int32 Timeout time.Duration BeginTimestamp time.Duration Done chan bool // contains filtered or unexported fields }
ResponseFuture
func NewResponseFuture ¶
func NewResponseFuture(ctx context.Context, opaque int32, timeout time.Duration, callback func(*ResponseFuture)) *ResponseFuture
NewResponseFuture create ResponseFuture with opaque, timeout and callback