Documentation ¶
Index ¶
- type Handler
- type MockRenderParser
- func (_m *MockRenderParser) EXPECT() *MockRenderParser_Expecter
- func (_m *MockRenderParser) Name() string
- func (_m *MockRenderParser) Parse(data []byte) (*response.Response, error)
- func (_m *MockRenderParser) Render(ctx context.Context, reqID string, params []byte, deps map[string]any) (core.Request, error)
- type MockRenderParser_Expecter
- func (_e *MockRenderParser_Expecter) Name() *MockRenderParser_Name_Call
- func (_e *MockRenderParser_Expecter) Parse(data interface{}) *MockRenderParser_Parse_Call
- func (_e *MockRenderParser_Expecter) Render(ctx interface{}, reqID interface{}, params interface{}, deps interface{}) *MockRenderParser_Render_Call
- type MockRenderParser_Name_Call
- type MockRenderParser_Parse_Call
- func (_c *MockRenderParser_Parse_Call) Return(_a0 *response.Response, _a1 error) *MockRenderParser_Parse_Call
- func (_c *MockRenderParser_Parse_Call) Run(run func(data []byte)) *MockRenderParser_Parse_Call
- func (_c *MockRenderParser_Parse_Call) RunAndReturn(run func([]byte) (*response.Response, error)) *MockRenderParser_Parse_Call
- type MockRenderParser_Render_Call
- type MockValidator
- type MockValidator_Expecter
- type MockValidator_Validate_Call
- type MockWaitComposer
- type MockWaitComposer_Compose_Call
- func (_c *MockWaitComposer_Compose_Call) Return(_a0 map[string]any, _a1 error) *MockWaitComposer_Compose_Call
- func (_c *MockWaitComposer_Compose_Call) Run(run func()) *MockWaitComposer_Compose_Call
- func (_c *MockWaitComposer_Compose_Call) RunAndReturn(run func() (map[string]any, error)) *MockWaitComposer_Compose_Call
- type MockWaitComposer_Expecter
- type MockWaitComposer_Prepare_Call
- func (_c *MockWaitComposer_Prepare_Call) Return(_a0 string, _a1 map[string]any, _a2 error) *MockWaitComposer_Prepare_Call
- func (_c *MockWaitComposer_Prepare_Call) Run(run func(_a0 context.Context, _a1 string, _a2 Parser)) *MockWaitComposer_Prepare_Call
- func (_c *MockWaitComposer_Prepare_Call) RunAndReturn(run func(context.Context, string, Parser) (string, map[string]any, error)) *MockWaitComposer_Prepare_Call
- type Parser
- type RenderParser
- type Validator
- type WaitComposer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func New ¶
func New(val Validator, proc []RenderParser, composeFactory func(core.Waiter) WaitComposer) *Handler
New creates a new instance of Handler. It takes three parameters: val of type Validator, proc which is a slice of RenderParser, and composeFactory which is a function that takes a core.Waiter and returns a WaitComposer. It returns a pointer to a Handler.
func (*Handler) Handle ¶
func (h *Handler) Handle(ctx context.Context, params json.RawMessage, waiter core.Waiter, send core.Sender) (map[string]any, error)
Handle processes incoming requests and sends them using the provided sender. It takes a context.Context, a map of parameters, a core.Waiter, and a core.Sender. It returns a map containing the composed results and an error if any occurs during validation or sending requests. It returns an error if the validation of parameters fails or if sending a request fails.
type MockRenderParser ¶ added in v0.0.3
MockRenderParser is an autogenerated mock type for the RenderParser type
func NewMockRenderParser ¶ added in v0.0.3
func NewMockRenderParser(t interface { mock.TestingT Cleanup(func()) }) *MockRenderParser
NewMockRenderParser creates a new instance of MockRenderParser. 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 (*MockRenderParser) EXPECT ¶ added in v0.0.3
func (_m *MockRenderParser) EXPECT() *MockRenderParser_Expecter
func (*MockRenderParser) Name ¶ added in v0.1.0
func (_m *MockRenderParser) Name() string
Name provides a mock function with given fields:
type MockRenderParser_Expecter ¶ added in v0.0.3
type MockRenderParser_Expecter struct {
// contains filtered or unexported fields
}
func (*MockRenderParser_Expecter) Name ¶ added in v0.1.0
func (_e *MockRenderParser_Expecter) Name() *MockRenderParser_Name_Call
Name is a helper method to define mock.On call
func (*MockRenderParser_Expecter) Parse ¶ added in v0.0.3
func (_e *MockRenderParser_Expecter) Parse(data interface{}) *MockRenderParser_Parse_Call
Parse is a helper method to define mock.On call
- data []byte
func (*MockRenderParser_Expecter) Render ¶ added in v0.0.3
func (_e *MockRenderParser_Expecter) Render(ctx interface{}, reqID interface{}, params interface{}, deps interface{}) *MockRenderParser_Render_Call
Render is a helper method to define mock.On call
- ctx context.Context
- reqID string
- params []byte
- deps map[string]any
type MockRenderParser_Name_Call ¶ added in v0.1.0
MockRenderParser_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name'
func (*MockRenderParser_Name_Call) Return ¶ added in v0.1.0
func (_c *MockRenderParser_Name_Call) Return(_a0 string) *MockRenderParser_Name_Call
func (*MockRenderParser_Name_Call) Run ¶ added in v0.1.0
func (_c *MockRenderParser_Name_Call) Run(run func()) *MockRenderParser_Name_Call
func (*MockRenderParser_Name_Call) RunAndReturn ¶ added in v0.1.0
func (_c *MockRenderParser_Name_Call) RunAndReturn(run func() string) *MockRenderParser_Name_Call
type MockRenderParser_Parse_Call ¶ added in v0.0.3
MockRenderParser_Parse_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Parse'
func (*MockRenderParser_Parse_Call) Return ¶ added in v0.0.3
func (_c *MockRenderParser_Parse_Call) Return(_a0 *response.Response, _a1 error) *MockRenderParser_Parse_Call
func (*MockRenderParser_Parse_Call) Run ¶ added in v0.0.3
func (_c *MockRenderParser_Parse_Call) Run(run func(data []byte)) *MockRenderParser_Parse_Call
func (*MockRenderParser_Parse_Call) RunAndReturn ¶ added in v0.0.3
func (_c *MockRenderParser_Parse_Call) RunAndReturn(run func([]byte) (*response.Response, error)) *MockRenderParser_Parse_Call
type MockRenderParser_Render_Call ¶ added in v0.0.3
MockRenderParser_Render_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Render'
func (*MockRenderParser_Render_Call) Return ¶ added in v0.0.3
func (_c *MockRenderParser_Render_Call) Return(_a0 core.Request, _a1 error) *MockRenderParser_Render_Call
func (*MockRenderParser_Render_Call) Run ¶ added in v0.0.3
func (_c *MockRenderParser_Render_Call) Run(run func(ctx context.Context, reqID string, params []byte, deps map[string]any)) *MockRenderParser_Render_Call
func (*MockRenderParser_Render_Call) RunAndReturn ¶ added in v0.0.3
type MockValidator ¶ added in v0.0.3
MockValidator is an autogenerated mock type for the Validator type
func NewMockValidator ¶ added in v0.0.3
func NewMockValidator(t interface { mock.TestingT Cleanup(func()) }) *MockValidator
NewMockValidator creates a new instance of MockValidator. 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 (*MockValidator) EXPECT ¶ added in v0.0.3
func (_m *MockValidator) EXPECT() *MockValidator_Expecter
func (*MockValidator) Validate ¶ added in v0.0.3
func (_m *MockValidator) Validate(data []byte) error
Validate provides a mock function with given fields: data
type MockValidator_Expecter ¶ added in v0.0.3
type MockValidator_Expecter struct {
// contains filtered or unexported fields
}
func (*MockValidator_Expecter) Validate ¶ added in v0.0.3
func (_e *MockValidator_Expecter) Validate(data interface{}) *MockValidator_Validate_Call
Validate is a helper method to define mock.On call
- data []byte
type MockValidator_Validate_Call ¶ added in v0.0.3
MockValidator_Validate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Validate'
func (*MockValidator_Validate_Call) Return ¶ added in v0.0.3
func (_c *MockValidator_Validate_Call) Return(_a0 error) *MockValidator_Validate_Call
func (*MockValidator_Validate_Call) Run ¶ added in v0.0.3
func (_c *MockValidator_Validate_Call) Run(run func(data []byte)) *MockValidator_Validate_Call
func (*MockValidator_Validate_Call) RunAndReturn ¶ added in v0.0.3
func (_c *MockValidator_Validate_Call) RunAndReturn(run func([]byte) error) *MockValidator_Validate_Call
type MockWaitComposer ¶ added in v0.0.3
MockWaitComposer is an autogenerated mock type for the WaitComposer type
func NewMockWaitComposer ¶ added in v0.0.3
func NewMockWaitComposer(t interface { mock.TestingT Cleanup(func()) }) *MockWaitComposer
NewMockWaitComposer creates a new instance of MockWaitComposer. 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 (*MockWaitComposer) Compose ¶ added in v0.0.3
func (_m *MockWaitComposer) Compose() (map[string]any, error)
Compose provides a mock function with given fields:
func (*MockWaitComposer) EXPECT ¶ added in v0.0.3
func (_m *MockWaitComposer) EXPECT() *MockWaitComposer_Expecter
type MockWaitComposer_Compose_Call ¶ added in v0.0.3
MockWaitComposer_Compose_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Compose'
func (*MockWaitComposer_Compose_Call) Return ¶ added in v0.0.3
func (_c *MockWaitComposer_Compose_Call) Return(_a0 map[string]any, _a1 error) *MockWaitComposer_Compose_Call
func (*MockWaitComposer_Compose_Call) Run ¶ added in v0.0.3
func (_c *MockWaitComposer_Compose_Call) Run(run func()) *MockWaitComposer_Compose_Call
func (*MockWaitComposer_Compose_Call) RunAndReturn ¶ added in v0.0.3
func (_c *MockWaitComposer_Compose_Call) RunAndReturn(run func() (map[string]any, error)) *MockWaitComposer_Compose_Call
type MockWaitComposer_Expecter ¶ added in v0.0.3
type MockWaitComposer_Expecter struct {
// contains filtered or unexported fields
}
func (*MockWaitComposer_Expecter) Compose ¶ added in v0.0.3
func (_e *MockWaitComposer_Expecter) Compose() *MockWaitComposer_Compose_Call
Compose is a helper method to define mock.On call
func (*MockWaitComposer_Expecter) Prepare ¶ added in v0.1.0
func (_e *MockWaitComposer_Expecter) Prepare(_a0 interface{}, _a1 interface{}, _a2 interface{}) *MockWaitComposer_Prepare_Call
Prepare is a helper method to define mock.On call
- _a0 context.Context
- _a1 string
- _a2 Parser
type MockWaitComposer_Prepare_Call ¶ added in v0.1.0
MockWaitComposer_Prepare_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Prepare'
func (*MockWaitComposer_Prepare_Call) Return ¶ added in v0.1.0
func (_c *MockWaitComposer_Prepare_Call) Return(_a0 string, _a1 map[string]any, _a2 error) *MockWaitComposer_Prepare_Call
func (*MockWaitComposer_Prepare_Call) Run ¶ added in v0.1.0
func (_c *MockWaitComposer_Prepare_Call) Run(run func(_a0 context.Context, _a1 string, _a2 Parser)) *MockWaitComposer_Prepare_Call
func (*MockWaitComposer_Prepare_Call) RunAndReturn ¶ added in v0.1.0
func (_c *MockWaitComposer_Prepare_Call) RunAndReturn(run func(context.Context, string, Parser) (string, map[string]any, error)) *MockWaitComposer_Prepare_Call