func (factory *proxyFactory) New(clientID []byte, clientSession base.ClientSession) (base.Proxy, error) {
	decryptor, err := factory.setting.DecryptorFactory().New(clientID)
	if err != nil {
		return nil, err
	}
	proxy, err := NewMysqlProxy(clientSession, decryptor, factory.setting)
	if err != nil {
		return nil, err
	}
	if !factory.setting.TableSchemaStore().IsEmpty() {
		queryEncryptor, err := encryptor.NewMysqlQueryEncryptor(factory.setting.TableSchemaStore(), clientID, factory.dataEncryptor)
		if err != nil {
			return nil, err
		}
		proxy.AddQueryObserver(queryEncryptor)
	}
	proxy.SubscribeOnAllColumnsDecryption(decryptor)
	return proxy, nil
}
New return mysql proxy implementation
package mysql
import (
	"github.com/cossacklabs/acra/decryptor/base"
	"github.com/cossacklabs/acra/encryptor"
)
type proxyFactory struct {
	dataEncryptor encryptor.DataEncryptor
	setting       base.ProxySetting
}
func NewProxyFactory(proxySetting base.ProxySetting) (base.ProxyFactory, error) {
	dataEncryptor, err := encryptor.NewAcrawriterDataEncryptor(proxySetting.KeyStore())
	if err != nil {
		return nil, err
	}
	return &proxyFactory{
		dataEncryptor: dataEncryptor,
		setting:       proxySetting,
	}, nil
}