Documentation ¶
Overview ¶
Copyright (c) 2021 - for information on the respective copyright owner see the NOTICE file and/or the repository https://github.com/carbynestack/ephemeral.
SPDX-License-Identifier: Apache-2.0
Copyright (c) 2021-2024 - for information on the respective copyright owner see the NOTICE file and/or the repository https://github.com/carbynestack/ephemeral.
SPDX-License-Identifier: Apache-2.0
Copyright (c) 2021-2024 - for information on the respective copyright owner see the NOTICE file and/or the repository https://github.com/carbynestack/ephemeral.
SPDX-License-Identifier: Apache-2.0
Index ¶
- Constants
- func RetryingDialer(sleep, timeout time.Duration, sideEffect func()) func(addr, port string) (conn net.Conn, err error)
- func RetryingDialerWithContext(sleep time.Duration, timeout time.Duration, l *zap.SugaredLogger) func(ctx context.Context, addr, port string) (conn net.Conn, err error)
- func RetryingDialerWithContextAndLogTimeout(sleep time.Duration, timeout time.Duration, l *zap.SugaredLogger, ...) func(ctx context.Context, addr, port string) (conn net.Conn, err error)
- type AbstractProxy
- type NetworkChecker
- type NoopChecker
- type PingAwareTarget
- type Proxy
- type TCPChecker
- type TCPCheckerConf
Constants ¶
const ( // PingMsg - message received from the clients. PingMsg = "ping" // PongMsg - message sent back to the clients. PongMsg = "pong" )
Variables ¶
This section is empty.
Functions ¶
func RetryingDialer ¶
func RetryingDialer(sleep, timeout time.Duration, sideEffect func()) func(addr, port string) (conn net.Conn, err error)
RetryingDialer tries to establish a TCP connection to a socket until the timeout is reached.
func RetryingDialerWithContext ¶
func RetryingDialerWithContext(sleep time.Duration, timeout time.Duration, l *zap.SugaredLogger) func(ctx context.Context, addr, port string) (conn net.Conn, err error)
RetryingDialerWithContext tries to establish a TCP connection to a socket until the timeout is reached or the context is cancelled.
func RetryingDialerWithContextAndLogTimeout ¶
func RetryingDialerWithContextAndLogTimeout(sleep time.Duration, timeout time.Duration, l *zap.SugaredLogger, logPeriod time.Duration) func(ctx context.Context, addr, port string) (conn net.Conn, err error)
RetryingDialerWithContextAndLogTimeout uses an individual log message timer.
Used for testing
Types ¶
type AbstractProxy ¶
AbstractProxy is an interface for proxy.
type NetworkChecker ¶
NetworkChecker verifies the network connectivity between the players before starting the computation.
type NoopChecker ¶
type NoopChecker struct { }
NoopChecker verifies the network for all MPC players is in place.
type PingAwareTarget ¶
type PingAwareTarget struct { Next tcpproxy.Target Logger *zap.SugaredLogger }
PingAwareTarget is a target that notifies about the start of the listener by means of the ping message.
func (*PingAwareTarget) HandleConn ¶
func (n *PingAwareTarget) HandleConn(conn net.Conn)
HandleConn checks whether the byte stream contains ping. If it is a ping, we respond back with pong indicating the listener has started. The sender of the ping is responsible for closing the connection. In case of no ping, the data is forwarded to the Next Target.
type Proxy ¶
type Proxy struct {
// contains filtered or unexported fields
}
Proxy is a wrapper around the tcpproxy and ping aware proxy. It establishes the connection between MPC master and slave.
func NewProxy ¶
func NewProxy(lg *zap.SugaredLogger, conf *SPDZEngineTypedConfig, checker NetworkChecker) *Proxy
NewProxy returns a new instance of ephemeral proxy.
type TCPChecker ¶
type TCPChecker struct {
// contains filtered or unexported fields
}
TCPChecker verifies the network for all MPC players is in place.
func NewTCPChecker ¶
func NewTCPChecker(conf *TCPCheckerConf) *TCPChecker
NewTCPChecker returns an instance of TCPChecker
type TCPCheckerConf ¶
type TCPCheckerConf struct { DialTimeout time.Duration RetryTimeout time.Duration Logger *zap.SugaredLogger }
TCPCheckerConf is the configuration of TCPChecker