Documentation ¶
Index ¶
- type RelpDialer
- type RelpPlainDialer
- func (relpd *RelpPlainDialer) Close() error
- func (relpd *RelpPlainDialer) Dial(hostname string, port int, _ *tls.Config) (bool, error)
- func (relpd *RelpPlainDialer) Read(dest []byte) (int, error)
- func (relpd *RelpPlainDialer) SetReadDeadline(dur time.Duration) error
- func (relpd *RelpPlainDialer) SetWriteDeadline(dur time.Duration) error
- func (relpd *RelpPlainDialer) Write(src []byte) (int, error)
- type RelpTLSDialer
- func (relpd *RelpTLSDialer) Close() error
- func (relpd *RelpTLSDialer) Dial(hostname string, port int, cfg *tls.Config) (bool, error)
- func (relpd *RelpTLSDialer) Read(dest []byte) (int, error)
- func (relpd *RelpTLSDialer) SetReadDeadline(dur time.Duration) error
- func (relpd *RelpTLSDialer) SetWriteDeadline(dur time.Duration) error
- func (relpd *RelpTLSDialer) Write(src []byte) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RelpDialer ¶
type RelpDialer interface { // Dial dials to the given hostname and port, providing the tls.Config if necessary. Returns if the connection is encrypted, and // if any errors were encountered. Dial(hostname string, port int, cfg *tls.Config) (bool, error) // SetReadDeadline sets the deadline for reading operations. The duration is added on top of current time. SetReadDeadline(add time.Duration) error // SetWriteDeadline sets the deadline for writing operations. The duration is added on top of current time. SetWriteDeadline(add time.Duration) error // Write writes the src byte array to the connection. Returns the written amount of bytes and any possible errors. Write(src []byte) (int, error) // Read reads the data from the connection to the dest byte array. Returns the amount of bytes read and any possible errors. Read(dest []byte) (int, error) // Close closes the connection, returning any possible errors. Close() error }
RelpDialer is the interface for all the methods RELP dialers should contain. Check RelpPlainDialer and RelpTLSDialer for implementations.
type RelpPlainDialer ¶
type RelpPlainDialer struct {
// contains filtered or unexported fields
}
RelpPlainDialer contains the net.Conn struct used for unencrypted connections.
func (*RelpPlainDialer) Close ¶
func (relpd *RelpPlainDialer) Close() error
Close closes the connection
func (*RelpPlainDialer) Dial ¶
Dial connects to the specified hostname and port Returns boolean if the connection is encrypted or not and possible errors as the second return value.
func (*RelpPlainDialer) Read ¶
func (relpd *RelpPlainDialer) Read(dest []byte) (int, error)
Read reads the incoming data to the specified byte array
func (*RelpPlainDialer) SetReadDeadline ¶
func (relpd *RelpPlainDialer) SetReadDeadline(dur time.Duration) error
SetReadDeadline sets the deadline for reading. The given duration is added on current time.
func (*RelpPlainDialer) SetWriteDeadline ¶
func (relpd *RelpPlainDialer) SetWriteDeadline(dur time.Duration) error
SetWriteDeadline sets the deadline for writing. The given duration is added on current time.
type RelpTLSDialer ¶
type RelpTLSDialer struct {
// contains filtered or unexported fields
}
RelpTLSDialer contains the encrypted tls.Conn connection struct
func (*RelpTLSDialer) Close ¶
func (relpd *RelpTLSDialer) Close() error
Close closes the connection.
func (*RelpTLSDialer) Dial ¶
Dial sets up the encrypted connection using the given tls.Config Returns boolean if the connection is encrypted or not and possible errors as the second return value.
func (*RelpTLSDialer) Read ¶
func (relpd *RelpTLSDialer) Read(dest []byte) (int, error)
Read reads the data from the connection to the given byte array
func (*RelpTLSDialer) SetReadDeadline ¶
func (relpd *RelpTLSDialer) SetReadDeadline(dur time.Duration) error
SetReadDeadline sets the deadline for reading operations. The duration is added on current time.
func (*RelpTLSDialer) SetWriteDeadline ¶
func (relpd *RelpTLSDialer) SetWriteDeadline(dur time.Duration) error
SetWriteDeadline sets the deadline for writing operations. The duration is added on current time.