Documentation
¶
Index ¶
- Constants
- Variables
- func BuildAuthCleartextChallenge() ([]byte, error)
- func BuildAuthMD5Challenge(salt [4]byte) ([]byte, error)
- func BuildAuthOk(serverVersion string, processID uint32, secretKey uint32) ([]byte, error)
- func BuildAuthSASLChallenge(mechanisms []string) ([]byte, error)
- func BuildAuthSASLContinue(data []byte) ([]byte, error)
- func BuildAuthSASLFinal(data []byte) ([]byte, error)
- func BuildTerminateWithError(msg, severity, code, detail string) ([]byte, error)
- func DecodeBytes(encoded string) []byte
- func ErrorResponse(msg, severity, code, detail string) []byte
- func GetQueryFromRequest(req interface{}) (string, error)
- func GetTablesFromQuery(query string) ([]string, error)
- func HandleClientMessage(req *v1.Struct, logger hclog.Logger) (*v1.Struct, error)
- func HandleServerMessage(resp *v1.Struct, logger hclog.Logger) (*v1.Struct, error)
- func IsPostgresSSLRequest(b []byte) bool
- func IsPostgresStartupMessage(b []byte) bool
Constants ¶
const MinPgSQLMessageLength = 5
Variables ¶
var PostgreSQLFrontEndMessageTypes = []uint8{
'B',
'C',
'D',
'E',
'F',
'f',
'd',
'c',
'H',
'P',
'p',
'Q',
'S',
'X',
}
Functions ¶
func BuildAuthCleartextChallenge ¶ added in v0.4.4
BuildAuthCleartextChallenge builds an AuthenticationCleartextPassword message.
func BuildAuthMD5Challenge ¶ added in v0.4.4
BuildAuthMD5Challenge builds an AuthenticationMD5Password message with the given salt.
func BuildAuthOk ¶ added in v0.4.4
BuildAuthOk builds the full post-authentication response sequence: AuthenticationOk + ParameterStatus(server_version) + ParameterStatus(client_encoding) + BackendKeyData + ReadyForQuery.
func BuildAuthSASLChallenge ¶ added in v0.4.4
BuildAuthSASLChallenge builds an AuthenticationSASL message listing the given mechanisms.
func BuildAuthSASLContinue ¶ added in v0.4.4
BuildAuthSASLContinue builds an AuthenticationSASLContinue message with server-first data.
func BuildAuthSASLFinal ¶ added in v0.4.4
BuildAuthSASLFinal builds an AuthenticationSASLFinal message with server-final data.
func BuildTerminateWithError ¶ added in v0.4.4
BuildTerminateWithError builds a Terminate message prepended with an ErrorResponse.
func DecodeBytes ¶
DecodeBytes decodes a base64 encoded string to bytes.
func ErrorResponse ¶ added in v0.1.4
func GetQueryFromRequest ¶ added in v0.0.18
GetQueryFromRequest decodes the request and returns the query.
func GetTablesFromQuery ¶ added in v0.0.18
GetTablesFromQuery returns the tables used in a query.
func HandleClientMessage ¶
HandleClientMessage handles the client message. This function should be called from onTrafficFromClient hook.
func HandleServerMessage ¶
HandleServerMessage handles the server response. This function should be called from onTrafficFromServer hook.
func IsPostgresSSLRequest ¶ added in v0.1.3
IsPostgresSSLRequest returns true if the message is a SSL request.
func IsPostgresStartupMessage ¶
IsPostgresStartupMessage returns true if the message is a startup message.
Types ¶
This section is empty.