Documentation ¶
Index ¶
- Variables
- func CacheConnect(o InitCacheConnect) (err error)
- func Connect(o InitConnect)
- func ConnectClickhouse(o InitConnect) (err error)
- func Delete(i interface{}) (err error)
- func ForeachFunc(i interface{}, o *ParamObj, f func(interface{})) (err error)
- func ForeachItem(i interface{}, o *ParamObj) (err error)
- func Get(i interface{}, o *ParamObj) (err error)
- func GetMultiPlaceholder(l, c int) string
- func GetPlaceholder(l int) string
- func GetPlaceholderWithDiff(diff, l int) string
- func GetTableName(i interface{}) string
- func InitObj(i interface{}, o *ParamObj)
- func QueueInit(o InitQueueParam) (exitChan chan bool)
- func ReplacePlaceholder(sqlrq string) string
- func Set(i interface{}) (err error)
- type CacheObj
- func (c *CacheObj) CheckReconect(err error)
- func (c *CacheObj) Del(key string) (err error)
- func (c *CacheObj) Exists(key string) (ok bool, err error)
- func (c *CacheObj) Expire(key string, ex int) (err error)
- func (c *CacheObj) Get(key string) (b []byte, err error)
- func (c *CacheObj) GetObj(key string, i interface{}) (err error)
- func (c *CacheObj) Incr(key string, i int64) (ai int64, err error)
- func (c *CacheObj) Notify(key string, data []byte) (err error)
- func (c *CacheObj) NotifyMulti(keys []string, data []byte) (err error)
- func (c *CacheObj) NotifyStr(key string, data string) (err error)
- func (c *CacheObj) Search(q string, f func(string, []byte)) (err error)
- func (c *CacheObj) Set(key string, data interface{}) (err error)
- func (c *CacheObj) SetEx(key string, data interface{}, ex int) (err error)
- func (c *CacheObj) SetObj(key string, i interface{}) (err error)
- func (c *CacheObj) SetObjEx(key string, i interface{}, ex int) (err error)
- func (c *CacheObj) SetStr(key string, data string) (err error)
- func (c *CacheObj) SetStrEx(key string, data string, ex int) (err error)
- func (c *CacheObj) Subscribe(keys []string, f func(string, string) bool) (err error)
- type InitCacheConnect
- type InitConnect
- type InitQueueParam
- type ParamObj
- type Parent
- type QueueObj
- type SSLConf
Constants ¶
This section is empty.
Variables ¶
var ( // Chh - хэндлер clickhouse Chh *sqlx.DB )
var ( // Dbh - хэндлер базы Dbh *sqlx.DB )
Functions ¶
func ConnectClickhouse ¶
func ConnectClickhouse(o InitConnect) (err error)
ConnectClickhouse - Подключание к clickhouse
func ForeachFunc ¶
ForeachFunc - Получаем список объектов
func ForeachItem ¶
ForeachItem - Получаем список объектов
func GetMultiPlaceholder ¶
GetMultiPlaceholder - Формируем нужное кол-во placeholders для множественной вставки. l - кол-во элеменетов, c - кол-во повторов
func GetPlaceholder ¶
GetPlaceholder - Формируем нужное кол-во placeholders
func GetPlaceholderWithDiff ¶
GetPlaceholderWithDiff - Формируем нужное кол-во placeholders со смещением
func GetTableName ¶
func GetTableName(i interface{}) string
GetTableName - Получаем название таблицы
func QueueInit ¶
func QueueInit(o InitQueueParam) (exitChan chan bool)
QueueInit - Инициализируем очередь
func ReplacePlaceholder ¶
ReplacePlaceholder - Заменяем ? на $...
Types ¶
type CacheObj ¶
CacheObj - Объект коннекта к кэшу
var ( // Cdb - хэндлер кэша Cdb CacheObj )
func (*CacheObj) CheckReconect ¶
CheckReconect - проверяем нежкен ли реконект
func (*CacheObj) NotifyMulti ¶
NotifyMulti - отправляем уведомление
type InitCacheConnect ¶
InitCacheConnect - объект инициализации коннекта к кэшу
type InitConnect ¶
type InitConnect struct { Login string Password string Socket string DBName string Charset string SSL SSLConf Silent bool AppName string }
InitConnect - Объект конекта к базе
type InitQueueParam ¶
InitQueueParam - объект инициализации очереди
type ParamObj ¶
type ParamObj struct { PK interface{} Tx *sqlx.Tx Table string OrderBy string Limit string Offset string GroupBy string Where string Fields string CondEntries []string Values []interface{} }
ParamObj - Объект инициализации структуры
type Parent ¶
type Parent struct { DBParentObjInited bool `json:"-"` DBParentObjTx unsafe.Pointer `json:"-"` DBParentInitValue map[string]interface{} `json:"-"` }
Parent - Объект структуры для объектов