2014-01-28 19:28:32 -05:00
|
|
|
package proxy
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net"
|
|
|
|
)
|
|
|
|
|
2015-07-25 04:35:07 -04:00
|
|
|
// StubProxy is a proxy that is a stub (does nothing).
|
2014-01-28 19:28:32 -05:00
|
|
|
type StubProxy struct {
|
|
|
|
frontendAddr net.Addr
|
|
|
|
backendAddr net.Addr
|
|
|
|
}
|
|
|
|
|
2015-07-25 04:35:07 -04:00
|
|
|
// Run does nothing.
|
|
|
|
func (p *StubProxy) Run() {}
|
|
|
|
|
|
|
|
// Close does nothing.
|
|
|
|
func (p *StubProxy) Close() {}
|
|
|
|
|
|
|
|
// FrontendAddr returns the frontend address.
|
2014-01-28 19:28:32 -05:00
|
|
|
func (p *StubProxy) FrontendAddr() net.Addr { return p.frontendAddr }
|
|
|
|
|
2015-07-25 04:35:07 -04:00
|
|
|
// BackendAddr returns the backend address.
|
|
|
|
func (p *StubProxy) BackendAddr() net.Addr { return p.backendAddr }
|
|
|
|
|
|
|
|
// NewStubProxy creates a new StubProxy
|
2014-01-28 19:28:32 -05:00
|
|
|
func NewStubProxy(frontendAddr, backendAddr net.Addr) (Proxy, error) {
|
|
|
|
return &StubProxy{
|
|
|
|
frontendAddr: frontendAddr,
|
|
|
|
backendAddr: backendAddr,
|
|
|
|
}, nil
|
|
|
|
}
|