Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrAuthrizationFailed = errors.New("authorization failed")
Functions ¶
This section is empty.
Types ¶
type AuthManager ¶
type AuthManager struct {
// contains filtered or unexported fields
}
AuthManager represent an authenticator manager.
func NewAuthManager ¶
func NewAuthManager() *AuthManager
NewAuthManager returns a new authenticator manager.
func (*AuthManager) AddAuthenticator ¶
func (mgr *AuthManager) AddAuthenticator(authenticator Authenticator)
AddAuthenticator adds a new authenticator.
func (*AuthManager) Authenticate ¶
Authenticate authenticates the connection with the startup message.
func (*AuthManager) ClearAuthenticators ¶
func (mgr *AuthManager) ClearAuthenticators()
ClearAuthenticators clears all authenticators.
type Authenticator ¶
Authenticator represents an authenticator interface.
type CleartextPasswordAuthenticator ¶
type CleartextPasswordAuthenticator struct {
// contains filtered or unexported fields
}
CleartextPasswordAuthenticator represents an authenticator for the cleartext password.
func NewCleartextPasswordAuthenticatorWith ¶
func NewCleartextPasswordAuthenticatorWith(username string, password string) *CleartextPasswordAuthenticator
NewCleartextPasswordAuthenticator returns a new authenticator with the specified username and password.
func (*CleartextPasswordAuthenticator) Authenticate ¶
func (authenticator *CleartextPasswordAuthenticator) Authenticate(conn Conn, startupMessage *message.Startup) (bool, error)
Authenticate authenticates the specified connection.
type Conn ¶
type Conn interface { net.Conn // MessageReader returns a message reader. MessageReader() *message.MessageReader // ResponseMessage returns a response message. ResponseMessage(resMsg message.Response) error // ResponseMessages returns response messages. ResponseMessages(resMsgs message.Responses) error // ResponseError returns a response error. ResponseError(err error) error }
Conn represents a connection.
Click to show internal directories.
Click to hide internal directories.