mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
18c7c67308
- pkg/useragent - pkg/units - pkg/ulimit - pkg/truncindex - pkg/timeoutconn - pkg/term - pkg/tarsum - pkg/tailfile - pkg/systemd - pkg/stringutils - pkg/stringid - pkg/streamformatter - pkg/sockets - pkg/signal - pkg/proxy - pkg/progressreader - pkg/pools - pkg/plugins - pkg/pidfile - pkg/parsers - pkg/parsers/filters - pkg/parsers/kernel - pkg/parsers/operatingsystem Signed-off-by: Vincent Demeester <vincent@sbr.pm>
31 lines
698 B
Go
31 lines
698 B
Go
package proxy
|
|
|
|
import (
|
|
"net"
|
|
)
|
|
|
|
// StubProxy is a proxy that is a stub (does nothing).
|
|
type StubProxy struct {
|
|
frontendAddr net.Addr
|
|
backendAddr net.Addr
|
|
}
|
|
|
|
// Run does nothing.
|
|
func (p *StubProxy) Run() {}
|
|
|
|
// Close does nothing.
|
|
func (p *StubProxy) Close() {}
|
|
|
|
// FrontendAddr returns the frontend address.
|
|
func (p *StubProxy) FrontendAddr() net.Addr { return p.frontendAddr }
|
|
|
|
// BackendAddr returns the backend address.
|
|
func (p *StubProxy) BackendAddr() net.Addr { return p.backendAddr }
|
|
|
|
// NewStubProxy creates a new StubProxy
|
|
func NewStubProxy(frontendAddr, backendAddr net.Addr) (Proxy, error) {
|
|
return &StubProxy{
|
|
frontendAddr: frontendAddr,
|
|
backendAddr: backendAddr,
|
|
}, nil
|
|
}
|