dbproxy

package
v0.0.0-...-acf744c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2018 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConfigDBProxyError

func NewConfigDBProxyError(err string) error

Types

type CustomRequestActionInterface

type CustomRequestActionInterface interface {
	// contains filtered or unexported methods
}

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 CustomResponseKeyValue struct {
	Key   string
	Value string
}

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

type ResponseFilterCallback func(sessionID string, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL