Documentation
¶
Index ¶
- Variables
- 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) 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) 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
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 ¶
This section is empty.
Types ¶
type AuthMethod ¶
type AuthMethod uint8
const ( AuthNone AuthMethod = iota AuthGSSAPI AuthUserPass AuthChallengeHandshake AuthChallengeResponse AuthSSL AuthNDS AuthMultiAuthFramework AuthJSON AuthN AuthNoAcceptable AuthMethod = 0xff )
Auth Methods
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) ServerHandshake ¶
func (p Proto) ServerHandshake(c net.Conn, methods ...AuthMethod) (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) 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.