Documentation ¶
Index ¶
- type DerivAPI
- type HTTPAPI
- type MockDerivAPI
- type MockDerivAPI_Expecter
- type MockDerivAPI_Handle_Call
- func (_c *MockDerivAPI_Handle_Call) Return(_a0 error) *MockDerivAPI_Handle_Call
- func (_c *MockDerivAPI_Handle_Call) Run(run func(_a0 *core.Conn, _a1 *request.Request)) *MockDerivAPI_Handle_Call
- func (_c *MockDerivAPI_Handle_Call) RunAndReturn(run func(*core.Conn, *request.Request) error) *MockDerivAPI_Handle_Call
- type MockHTTPAPI
- type MockHTTPAPI_Expecter
- type MockHTTPAPI_Handle_Call
- func (_c *MockHTTPAPI_Handle_Call) Return(_a0 error) *MockHTTPAPI_Handle_Call
- func (_c *MockHTTPAPI_Handle_Call) Run(run func(_a0 *core.Conn, _a1 *request.HTTPReq)) *MockHTTPAPI_Handle_Call
- func (_c *MockHTTPAPI_Handle_Call) RunAndReturn(run func(*core.Conn, *request.HTTPReq) error) *MockHTTPAPI_Handle_Call
- type Router
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockDerivAPI ¶
MockDerivAPI is an autogenerated mock type for the DerivAPI type
func NewMockDerivAPI ¶
func NewMockDerivAPI(t interface { mock.TestingT Cleanup(func()) }) *MockDerivAPI
NewMockDerivAPI creates a new instance of MockDerivAPI. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockDerivAPI) EXPECT ¶
func (_m *MockDerivAPI) EXPECT() *MockDerivAPI_Expecter
type MockDerivAPI_Expecter ¶
type MockDerivAPI_Expecter struct {
// contains filtered or unexported fields
}
func (*MockDerivAPI_Expecter) Handle ¶
func (_e *MockDerivAPI_Expecter) Handle(_a0 interface{}, _a1 interface{}) *MockDerivAPI_Handle_Call
Handle is a helper method to define mock.On call
- _a0 *core.Conn
- _a1 *request.Request
type MockDerivAPI_Handle_Call ¶
MockDerivAPI_Handle_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Handle'
func (*MockDerivAPI_Handle_Call) Return ¶
func (_c *MockDerivAPI_Handle_Call) Return(_a0 error) *MockDerivAPI_Handle_Call
func (*MockDerivAPI_Handle_Call) Run ¶
func (_c *MockDerivAPI_Handle_Call) Run(run func(_a0 *core.Conn, _a1 *request.Request)) *MockDerivAPI_Handle_Call
func (*MockDerivAPI_Handle_Call) RunAndReturn ¶
func (_c *MockDerivAPI_Handle_Call) RunAndReturn(run func(*core.Conn, *request.Request) error) *MockDerivAPI_Handle_Call
type MockHTTPAPI ¶
MockHTTPAPI is an autogenerated mock type for the HTTPAPI type
func NewMockHTTPAPI ¶
func NewMockHTTPAPI(t interface { mock.TestingT Cleanup(func()) }) *MockHTTPAPI
NewMockHTTPAPI creates a new instance of MockHTTPAPI. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockHTTPAPI) EXPECT ¶
func (_m *MockHTTPAPI) EXPECT() *MockHTTPAPI_Expecter
type MockHTTPAPI_Expecter ¶
type MockHTTPAPI_Expecter struct {
// contains filtered or unexported fields
}
func (*MockHTTPAPI_Expecter) Handle ¶
func (_e *MockHTTPAPI_Expecter) Handle(_a0 interface{}, _a1 interface{}) *MockHTTPAPI_Handle_Call
Handle is a helper method to define mock.On call
- _a0 *core.Conn
- _a1 *request.HTTPReq
type MockHTTPAPI_Handle_Call ¶
MockHTTPAPI_Handle_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Handle'
func (*MockHTTPAPI_Handle_Call) Return ¶
func (_c *MockHTTPAPI_Handle_Call) Return(_a0 error) *MockHTTPAPI_Handle_Call
func (*MockHTTPAPI_Handle_Call) Run ¶
func (_c *MockHTTPAPI_Handle_Call) Run(run func(_a0 *core.Conn, _a1 *request.HTTPReq)) *MockHTTPAPI_Handle_Call
func (*MockHTTPAPI_Handle_Call) RunAndReturn ¶
func (_c *MockHTTPAPI_Handle_Call) RunAndReturn(run func(*core.Conn, *request.HTTPReq) error) *MockHTTPAPI_Handle_Call
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
func New ¶
New creates a new instance of Router with the provided DerivAPI service. It takes derivProv of type DerivAPI. It returns a pointer to a Router instance.
func (*Router) Handle ¶
Handle processes a request and delegates it to the appropriate provider based on the request type. It takes conn of type *core.Conn and req of type core.Request. It returns an error if the request type is unsupported or if the underlying provider's Handle method returns an error.