1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/vendor/github.com/stevvooe/ttrpc/config.go
Michael Crosby ad2b34f205 Bump containerd to cc969fb42f427a68a8cc6870ef47f17
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-12-04 14:14:42 -05:00

23 lines
557 B
Go

package ttrpc
import "github.com/pkg/errors"
type serverConfig struct {
handshaker Handshaker
}
type ServerOpt func(*serverConfig) error
// WithServerHandshaker can be passed to NewServer to ensure that the
// handshaker is called before every connection attempt.
//
// Only one handshaker is allowed per server.
func WithServerHandshaker(handshaker Handshaker) ServerOpt {
return func(c *serverConfig) error {
if c.handshaker != nil {
return errors.New("only one handshaker allowed per server")
}
c.handshaker = handshaker
return nil
}
}