Documentation
¶
Overview ¶
Package intermediate serves as the foundation of the http.egress.core microservice.
The HTTP egress microservice relays HTTP requests to the internet.
Index ¶
- type Intermediate
- type Mock
- func (svc *Mock) MakeRequest(w http.ResponseWriter, r *http.Request) (err error)
- func (svc *Mock) MockMakeRequest(handler func(w http.ResponseWriter, r *http.Request) (err error)) *Mock
- func (svc *Mock) OnShutdown(ctx context.Context) (err error)
- func (svc *Mock) OnStartup(ctx context.Context) (err error)
- type ToDo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Intermediate ¶
Intermediate extends and customizes the generic base connector. Code generated microservices then extend the intermediate.
func NewService ¶
func NewService(impl ToDo, version int) *Intermediate
NewService creates a new intermediate service.
type Mock ¶
type Mock struct { *Intermediate // contains filtered or unexported fields }
Mock is a mockable version of the http.egress.core microservice, allowing functions, event sinks and web handlers to be mocked.
func (*Mock) MakeRequest ¶
MakeRequest runs the mock handler set by MockMakeRequest.
func (*Mock) MockMakeRequest ¶
func (svc *Mock) MockMakeRequest(handler func(w http.ResponseWriter, r *http.Request) (err error)) *Mock
MockMakeRequest sets up a mock handler for the MakeRequest endpoint.
func (*Mock) OnShutdown ¶
OnShutdown is a no op.
type ToDo ¶
type ToDo interface { OnStartup(ctx context.Context) (err error) OnShutdown(ctx context.Context) (err error) MakeRequest(w http.ResponseWriter, r *http.Request) (err error) }
ToDo defines the interface that the microservice must implement. The intermediate delegates handling to this interface.