Documentation
¶
Index ¶
- Variables
- func IncomingProtoHandshake(ctx context.Context, conn net.Conn, pt ProtoChecker) (*handshakeproto.Proto, error)
- func OutgoingProtoHandshake(ctx context.Context, conn net.Conn, proto *handshakeproto.Proto) (remoteProto *handshakeproto.Proto, err error)
- type CredentialChecker
- type HandshakeError
- type ProtoChecker
- type Result
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUnexpectedPayload = HandshakeError{/* contains filtered or unexported fields */} ErrDeadlineExceeded = HandshakeError{/* contains filtered or unexported fields */} ErrInvalidCredentials = HandshakeError{/* contains filtered or unexported fields */} ErrPeerDeclinedCredentials = HandshakeError{Err: errors.New("remote peer declined the credentials")} ErrSkipVerifyNotAllowed = HandshakeError{/* contains filtered or unexported fields */} ErrUnexpected = HandshakeError{/* contains filtered or unexported fields */} ErrIncompatibleVersion = HandshakeError{/* contains filtered or unexported fields */} ErrIncompatibleProto = HandshakeError{/* contains filtered or unexported fields */} ErrRemoteIncompatibleProto = HandshakeError{Err: errors.New("remote peer declined the proto")} ErrGotUnexpectedMessage = errors.New("go not a handshake message") )
Functions ¶
func IncomingProtoHandshake ¶ added in v0.2.0
func IncomingProtoHandshake(ctx context.Context, conn net.Conn, pt ProtoChecker) (*handshakeproto.Proto, error)
func OutgoingProtoHandshake ¶ added in v0.2.0
func OutgoingProtoHandshake(ctx context.Context, conn net.Conn, proto *handshakeproto.Proto) (remoteProto *handshakeproto.Proto, err error)
Types ¶
type CredentialChecker ¶
type CredentialChecker interface {
MakeCredentials(remotePeerId string) *handshakeproto.Credentials
CheckCredential(remotePeerId string, cred *handshakeproto.Credentials) (result Result, err error)
}
type HandshakeError ¶
type HandshakeError struct {
Err error
// contains filtered or unexported fields
}
func (HandshakeError) Error ¶
func (he HandshakeError) Error() string
type ProtoChecker ¶ added in v0.2.0
type ProtoChecker struct {
AllowedProtoTypes []handshakeproto.ProtoType
SupportedEncodings []handshakeproto.Encoding
}
type Result ¶ added in v0.2.2
func IncomingHandshake ¶
func IncomingHandshake(ctx context.Context, conn io.ReadWriteCloser, peerId string, cc CredentialChecker) (result Result, err error)
func OutgoingHandshake ¶
func OutgoingHandshake(ctx context.Context, conn io.ReadWriteCloser, peerId string, cc CredentialChecker) (result Result, err error)
Click to show internal directories.
Click to hide internal directories.