Documentation ¶
Index ¶
- func NewConfigDBProxyError(err string) error
- type CustomRequestActionInterface
- func NewCustomDataKeyValueResponse(rows []CustomResponseKeyValue) CustomRequestActionInterface
- func NewCustomErrorResponse(err string, code uint16) CustomRequestActionInterface
- func NewCustomOKResponse(ar uint) CustomRequestActionInterface
- func NewCustomQueryRequest(query string) CustomRequestActionInterface
- type CustomResponseKeyValue
- type DBProxyError
- type DBProxyFilter
- type DBProxyInterface
- type RequestQueryFilterCallback
- type ResponseFilterCallback
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewConfigDBProxyError ¶
Types ¶
type CustomRequestActionInterface ¶
type CustomRequestActionInterface interface {
// contains filtered or unexported methods
}
func NewCustomDataKeyValueResponse ¶
func NewCustomDataKeyValueResponse(rows []CustomResponseKeyValue) CustomRequestActionInterface
func NewCustomErrorResponse ¶
func NewCustomErrorResponse(err string, code uint16) CustomRequestActionInterface
Custom responses constructors Make new Custom Error Response
func NewCustomOKResponse ¶
func NewCustomOKResponse(ar uint) CustomRequestActionInterface
func NewCustomQueryRequest ¶
func NewCustomQueryRequest(query string) CustomRequestActionInterface
type CustomResponseKeyValue ¶
type DBProxyError ¶
type DBProxyError struct {
// contains filtered or unexported fields
}
func (DBProxyError) Error ¶
func (e DBProxyError) Error() string
func (DBProxyError) IsDBProxyConfigError ¶
func (e DBProxyError) IsDBProxyConfigError() bool
func (DBProxyError) Kind ¶
func (e DBProxyError) Kind() string
type DBProxyFilter ¶
type DBProxyFilter interface { RequestCallback(query string, sessionID string) (CustomRequestActionInterface, error) ResponseCallback(sessionID string, err error) }
Interface for a filter structure It is alternative for callbacks and can keep some state inside
type DBProxyInterface ¶
type DBProxyInterface interface { SetCallbacks(requestCallback RequestQueryFilterCallback, responseCallback ResponseFilterCallback) SetFilter(filterObj DBProxyFilter) SetLoggers(t *log.Logger, e *log.Logger) Init() error Run() error // this function should start new goroutine IsStopped() bool WaitStop() Stop() error }
func NewMySQLProxy ¶
func NewMySQLProxy(proxyHost, mysqlHost string) (DBProxyInterface, error)
type RequestQueryFilterCallback ¶
type RequestQueryFilterCallback func(query string, sessionID string) (CustomRequestActionInterface, error)
type ResponseFilterCallback ¶
Click to show internal directories.
Click to hide internal directories.