securableConn

package
v0.0.0-...-1310e1d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2018 License: MIT Imports: 5 Imported by: 2

Documentation

Overview

Package securableConn hides the difference between a plain text connection and an encrypted one so there is no need to track the difference from outside.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn interface {
	io.Closer
	SwitchToTLS() error
	LocalAddr() net.Addr
	RemoteAddr() net.Addr
	Writer() *bufio.Writer
	Reader() *bufio.Reader
	IsSecure() bool
}

Conn interface exposes the method that will work either with plain and encrypted connections. The interface will always return the encrypted connection if available.

func New

func New(plain net.Conn, secure *tls.Conn, cert *tls.Certificate) Conn

New creates a new securableConn.Conn. It can already have a secure channel open, in which case it will be used

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL