Documentation ¶
Index ¶
- Variables
- type AllowedHost
- type AllowedHosts
- type Dial
- type ReadTimeoutConn
- type TimeoutConn
- func (c *TimeoutConn) Read(b []byte) (int, error)
- func (c *TimeoutConn) SetDeadline(t time.Time) error
- func (c *TimeoutConn) SetReadDeadline(t time.Time) error
- func (c *TimeoutConn) SetReadTimeout(t time.Duration)
- func (c *TimeoutConn) SetWriteDeadline(t time.Time) error
- func (c *TimeoutConn) SetWriteTimeout(t time.Duration)
- func (c *TimeoutConn) Write(b []byte) (int, error)
- type WriteTimeoutConn
Constants ¶
This section is empty.
Variables ¶
var (
ErrAccessControlDialTargetHostNotAllowed = errors.New(
"unable to dial to the specified remote host due to restriction")
)
Errors
Functions ¶
This section is empty.
Types ¶
type AllowedHost ¶
AllowedHost returns whether or not give host is allowed
type AllowedHosts ¶
type AllowedHosts map[string]struct{}
AllowedHosts contains a map of allowed remote hosts
func (AllowedHosts) Allowed ¶
func (a AllowedHosts) Allowed(host string) bool
Allowed returns whether or not given host is allowed
type Dial ¶
Dial dial to remote machine
func AccessControlDial ¶
func AccessControlDial(allowed AllowedHost, dial Dial) Dial
AccessControlDial creates an access controlled Dial
func BuildSocks5Dial ¶
BuildSocks5Dial builds a Socks5 dialer
type ReadTimeoutConn ¶
ReadTimeoutConn is a reader that will enforce a timeout rules
func NewReadTimeoutConn ¶
func NewReadTimeoutConn(c net.Conn, timeout time.Duration) ReadTimeoutConn
NewReadTimeoutConn creates a ReadTimeoutConn
func (*ReadTimeoutConn) SetReadDeadline ¶
func (c *ReadTimeoutConn) SetReadDeadline(t time.Time) error
SetReadDeadline sets read deadline
func (*ReadTimeoutConn) SetReadTimeout ¶
func (c *ReadTimeoutConn) SetReadTimeout(t time.Duration)
SetReadTimeout sets write timeout
type TimeoutConn ¶
TimeoutConn read write
func NewTimeoutConn ¶
NewTimeoutConn creates a new TimeoutConn
func (*TimeoutConn) SetDeadline ¶
func (c *TimeoutConn) SetDeadline(t time.Time) error
SetDeadline sets read and write deadline
func (*TimeoutConn) SetReadDeadline ¶
func (c *TimeoutConn) SetReadDeadline(t time.Time) error
SetReadDeadline sets the next read deadline
func (*TimeoutConn) SetReadTimeout ¶
func (c *TimeoutConn) SetReadTimeout(t time.Duration)
SetReadTimeout sets read timeout
func (*TimeoutConn) SetWriteDeadline ¶
func (c *TimeoutConn) SetWriteDeadline(t time.Time) error
SetWriteDeadline sets the next read deadline
func (*TimeoutConn) SetWriteTimeout ¶
func (c *TimeoutConn) SetWriteTimeout(t time.Duration)
SetWriteTimeout sets write timeout
type WriteTimeoutConn ¶
WriteTimeoutConn is a writer that will enforce a timeout rules onto a net.Conn
func NewWriteTimeoutConn ¶
func NewWriteTimeoutConn(c net.Conn, timeout time.Duration) WriteTimeoutConn
NewWriteTimeoutConn creates a WriteTimeoutConnWriter
func (*WriteTimeoutConn) SetWriteDeadline ¶
func (c *WriteTimeoutConn) SetWriteDeadline(t time.Time) error
SetWriteDeadline sets write deadline
func (*WriteTimeoutConn) SetWriteTimeout ¶
func (c *WriteTimeoutConn) SetWriteTimeout(t time.Duration)
SetWriteTimeout sets write timeout