Documentation ¶
Index ¶
- Variables
- func EncodePacketHeader(buf []byte, dst int, addr net.Addr) (int, error)
- func ParsePacketHeader(p []byte) (net.Addr, int, error)
- type AuthMethod
- type Auther
- type AutherFunc
- type Command
- type Dialer
- type DialerFunc
- type Proto
- func (p Proto) ClientHandshake(c net.Conn, methods ...AuthMethod) (auth AuthMethod, err error)
- func (p Proto) ClientHandshakeRead(c net.Conn) (auth AuthMethod, err error)
- func (p Proto) ClientHandshakeWrite(c net.Conn, methods ...AuthMethod) error
- func (p Proto) ReadReply(c net.Conn, cmd Command) (Reply, net.Addr, error)
- func (p Proto) ReadRequest(c net.Conn) (Command, net.Addr, error)
- func (p Proto) ServerHandshake(c net.Conn, methods ...AuthMethod) (auth AuthMethod, err error)
- func (p Proto) ServerHandshakeRead(c net.Conn, methods ...AuthMethod) (auth AuthMethod, err error)
- func (p Proto) ServerHandshakeWrite(c net.Conn, auth AuthMethod) (err error)
- func (p Proto) WriteReply(c net.Conn, rep Reply, addr net.Addr) (err error)
- func (p Proto) WriteRequest(c net.Conn, cmd Command, addr net.Addr) (err error)
- type Reply
- type TCPAddr
- type UDPAddr
- type UDPConn
- func (c UDPConn) Close() (err error)
- func (c UDPConn) LocalAddr() net.Addr
- func (c UDPConn) Read(p []byte) (n int, err error)
- func (c UDPConn) ReadFrom(p []byte) (n int, addr net.Addr, err error)
- func (c UDPConn) RemoteAddr() net.Addr
- func (c UDPConn) SetDeadline(t time.Time) error
- func (c UDPConn) SetReadDeadline(t time.Time) error
- func (c UDPConn) SetWriteDeadline(t time.Time) error
- func (c UDPConn) Write(p []byte) (n int, err error)
- func (c UDPConn) WriteTo(p []byte, addr net.Addr) (n int, err error)
- type UserPassAuth
- func (a UserPassAuth) ReadReply(c net.Conn) (status int, err error)
- func (a UserPassAuth) ReadRequest(c net.Conn) (usr, pwd string, err error)
- func (UserPassAuth) StatusFailure() int
- func (UserPassAuth) StatusSuccess() int
- func (a UserPassAuth) WriteReply(c net.Conn, status int) (err error)
- func (a UserPassAuth) WriteRequest(c net.Conn, usr, pwd string) (err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUnsupportedProtocol = errors.New("unsupported protocol") ErrUnsupportedCommand = errors.New("unsupported command") ErrUnsupportedAddressType = errors.New("unsupported address type") ErrNoAcceptableAuth = errors.New("no acceptable auth method") )
Errors
Functions ¶
Types ¶
type AuthMethod ¶
type AuthMethod uint8
const ( AuthNone AuthMethod = iota AuthGSSAPI AuthUserPass AuthChallengeHandshake AuthChallengeResponse AuthSSL AuthNDS AuthMultiAuthFramework AuthJSON AuthN AuthNoAcceptable AuthMethod = 0xff )
Auth Methods
func (AuthMethod) String ¶
func (m AuthMethod) String() string
type AutherFunc ¶
func (AutherFunc) Auth ¶
func (f AutherFunc) Auth(ctx context.Context, meth AuthMethod, c net.Conn) error
type Command ¶
type Command uint8
Command is request command or reply code.
type Dialer ¶
type DialerFunc ¶
func (DialerFunc) DialContext ¶
type Proto ¶
type Proto struct{}
func (Proto) ClientHandshake ¶
func (p Proto) ClientHandshake(c net.Conn, methods ...AuthMethod) (auth AuthMethod, err error)
func (Proto) ClientHandshakeRead ¶
func (p Proto) ClientHandshakeRead(c net.Conn) (auth AuthMethod, err error)
func (Proto) ClientHandshakeWrite ¶
func (p Proto) ClientHandshakeWrite(c net.Conn, methods ...AuthMethod) error
func (Proto) ServerHandshake ¶
func (p Proto) ServerHandshake(c net.Conn, methods ...AuthMethod) (auth AuthMethod, err error)
func (Proto) ServerHandshakeRead ¶
func (p Proto) ServerHandshakeRead(c net.Conn, methods ...AuthMethod) (auth AuthMethod, err error)
func (Proto) ServerHandshakeWrite ¶
func (p Proto) ServerHandshakeWrite(c net.Conn, auth AuthMethod) (err error)
func (Proto) WriteReply ¶
type Reply ¶
type Reply Command
type UDPConn ¶
type UDPConn struct {
// contains filtered or unexported fields
}
func (UDPConn) RemoteAddr ¶
type UserPassAuth ¶
type UserPassAuth struct{}
func (UserPassAuth) ReadRequest ¶
func (a UserPassAuth) ReadRequest(c net.Conn) (usr, pwd string, err error)
func (UserPassAuth) StatusFailure ¶
func (UserPassAuth) StatusFailure() int
func (UserPassAuth) StatusSuccess ¶
func (UserPassAuth) StatusSuccess() int
func (UserPassAuth) WriteReply ¶
func (a UserPassAuth) WriteReply(c net.Conn, status int) (err error)
func (UserPassAuth) WriteRequest ¶
func (a UserPassAuth) WriteRequest(c net.Conn, usr, pwd string) (err error)
Click to show internal directories.
Click to hide internal directories.