api/internal/endpoints/endpoint.go
Peter Kurfer 7c2a41ad25 Move TLS/cert handling to main app
- apply changes in proxy plugin and TLS interceptor
- add HTTPS proxy support
- move ca-generation command to main app
- minor refactoring to improve API stability
- move mocks to extra packages to avoid cycling imports
- fix bug in multi-port configuration
- change HTTP proxy to redirect to HTTP mock instead of maintaining custom rules
2020-04-26 00:32:46 +02:00

30 lines
577 B
Go

//go:generate mockgen -source=endpoint.go -destination=./../../internal/mock/endpoints/endpoint_mock.go -package=endpoints_mock
package endpoints
import (
"github.com/baez90/inetmock/pkg/api"
)
type Endpoint interface {
Start() error
Shutdown() error
Name() string
}
type endpoint struct {
name string
handler api.ProtocolHandler
config api.HandlerConfig
}
func (e endpoint) Name() string {
return e.name
}
func (e *endpoint) Start() (err error) {
return e.handler.Start(e.config)
}
func (e *endpoint) Shutdown() (err error) {
return e.handler.Shutdown()
}