Documentation ¶
Index ¶
- Constants
- Variables
- func CalculateHash(data string) uint32
- func CalculateHashesOfColumns(columns []string) []uint32
- func CheckTableName(table string) error
- func CreateWhereClause(columns []string, hashes []uint32) string
- func SplitToParts(key string) []string
- type GenericStorage
- func (gs *GenericStorage) AddToMap(table string, key string, objectKey string, object interface{}) error
- func (gs *GenericStorage) DelFromMap(table string, key string, objectKey string) error
- func (gs *GenericStorage) DelKey(table string, key string) (int64, error)
- func (gs *GenericStorage) GetFromMap(table string, key string, objectKey string, reference interface{}) error
- func (gs *GenericStorage) GetFullKey(key string) (string, error)
- func (gs *GenericStorage) GetKey(table string, key string) (string, error)
- func (gs *GenericStorage) GetKeys(table string, pattern string) ([]string, error)
- func (gs *GenericStorage) GetMap(table string, key string, reference interface{}) error
- func (gs *GenericStorage) Init() error
- func (gs *GenericStorage) SetKey(table string, key string, value string, expiration time.Duration) error
- type MySQLStorage
- func (mss *MySQLStorage) AddToMap(table string, key string, objectKey string, object string) error
- func (mss *MySQLStorage) Create(credentials map[string]string) error
- func (mss *MySQLStorage) DelFromMap(table string, key string, objectKey string) error
- func (mss *MySQLStorage) DelKey(table string, key string) (int64, error)
- func (mss *MySQLStorage) Destroy() error
- func (mss *MySQLStorage) GetFromMap(table string, key string, objectKey string) (string, error)
- func (mss *MySQLStorage) GetFullKey(key string) (string, error)
- func (mss *MySQLStorage) GetKey(table string, key string) (string, error)
- func (mss *MySQLStorage) GetKeys(table string, pattern string) ([]string, error)
- func (mss *MySQLStorage) GetMap(table string, key string) (map[string]string, error)
- func (mss *MySQLStorage) Init() error
- func (mss *MySQLStorage) KeysCleanUp() error
- func (mss *MySQLStorage) SetKey(table string, key string, value string, expiration time.Duration) error
- func (mss *MySQLStorage) Setup(credentials map[string]string) error
- type PostgreSQLStorage
- func (pss *PostgreSQLStorage) AddToMap(table string, key string, objectKey string, object string) error
- func (pss *PostgreSQLStorage) Create(credentials map[string]string) error
- func (pss *PostgreSQLStorage) DelFromMap(table string, key string, objectKey string) error
- func (pss *PostgreSQLStorage) DelKey(table string, key string) (int64, error)
- func (pss *PostgreSQLStorage) Destroy() error
- func (pss *PostgreSQLStorage) GetFromMap(table string, key string, objectKey string) (string, error)
- func (pss *PostgreSQLStorage) GetFullKey(key string) (string, error)
- func (pss *PostgreSQLStorage) GetKey(table string, key string) (string, error)
- func (pss *PostgreSQLStorage) GetKeys(table string, pattern string) ([]string, error)
- func (pss *PostgreSQLStorage) GetMap(table string, key string) (map[string]string, error)
- func (pss *PostgreSQLStorage) Init() error
- func (pss *PostgreSQLStorage) KeysCleanUp() error
- func (pss *PostgreSQLStorage) SetKey(table string, key string, value string, expiration time.Duration) error
- func (pss *PostgreSQLStorage) Setup(credentials map[string]string) error
- type RedisStorage
- func (rs *RedisStorage) AddToMap(table string, key string, objectKey string, object string) error
- func (rs *RedisStorage) Create(credentials map[string]string) error
- func (rs *RedisStorage) DelFromMap(table string, key string, objectKey string) error
- func (rs *RedisStorage) DelKey(table string, key string) (int64, error)
- func (rs *RedisStorage) Destroy() error
- func (rs *RedisStorage) GetFromMap(table string, key string, objectKey string) (string, error)
- func (rs *RedisStorage) GetFullKey(key string) (string, error)
- func (rs *RedisStorage) GetKey(table string, key string) (string, error)
- func (rs *RedisStorage) GetKeys(table string, pattern string) ([]string, error)
- func (rs *RedisStorage) GetMap(table string, key string) (map[string]string, error)
- func (rs *RedisStorage) Init() error
- func (rs *RedisStorage) SetKey(table string, key string, value string, expiration time.Duration) error
- func (rs *RedisStorage) Setup(credentials map[string]string) error
- type SQLiteStorage
- func (ss *SQLiteStorage) AddToMap(table string, key string, objectKey string, object string) error
- func (ss *SQLiteStorage) Create(credentials map[string]string) error
- func (ss *SQLiteStorage) DelFromMap(table string, key string, objectKey string) error
- func (ss *SQLiteStorage) DelKey(table string, key string) (int64, error)
- func (ss *SQLiteStorage) Destroy() error
- func (ss *SQLiteStorage) GetFromMap(table string, key string, objectKey string) (string, error)
- func (ss *SQLiteStorage) GetFullKey(key string) (string, error)
- func (ss *SQLiteStorage) GetKey(table string, key string) (string, error)
- func (ss *SQLiteStorage) GetKeys(table string, pattern string) ([]string, error)
- func (ss *SQLiteStorage) GetMap(table string, key string) (map[string]string, error)
- func (ss *SQLiteStorage) Init() error
- func (ss *SQLiteStorage) KeysCleanUp() error
- func (ss *SQLiteStorage) SetKey(table string, key string, value string, expiration time.Duration) error
- func (ss *SQLiteStorage) Setup(credentials map[string]string) error
- type Storage
Constants ¶
View Source
const NumberOfColumns = 10
View Source
const TruncateInterval = 60 * 1000
Variables ¶
View Source
var LastTruncate = int64(0)
View Source
var MY_SQL_STORAGE = "mysql"
View Source
var POSTGRE_SQL_STORAGE = "postgresql"
View Source
var REDIS_STORAGE = "redis"
View Source
var SQLITE_STORAGE = "sqlite"
Functions ¶
func CalculateHash ¶
func CheckTableName ¶
func CreateWhereClause ¶
func SplitToParts ¶
Types ¶
type GenericStorage ¶
func (*GenericStorage) AddToMap ¶
func (gs *GenericStorage) AddToMap(table string, key string, objectKey string, object interface{}) error
func (*GenericStorage) DelFromMap ¶
func (gs *GenericStorage) DelFromMap(table string, key string, objectKey string) error
func (*GenericStorage) DelKey ¶
func (gs *GenericStorage) DelKey(table string, key string) (int64, error)
func (*GenericStorage) GetFromMap ¶
func (gs *GenericStorage) GetFromMap(table string, key string, objectKey string, reference interface{}) error
func (*GenericStorage) GetFullKey ¶
func (gs *GenericStorage) GetFullKey(key string) (string, error)
func (*GenericStorage) GetKey ¶
func (gs *GenericStorage) GetKey(table string, key string) (string, error)
func (*GenericStorage) GetKeys ¶
func (gs *GenericStorage) GetKeys(table string, pattern string) ([]string, error)
func (*GenericStorage) GetMap ¶
func (gs *GenericStorage) GetMap(table string, key string, reference interface{}) error
func (*GenericStorage) Init ¶
func (gs *GenericStorage) Init() error
type MySQLStorage ¶
func (*MySQLStorage) DelFromMap ¶
func (mss *MySQLStorage) DelFromMap(table string, key string, objectKey string) error
func (*MySQLStorage) DelKey ¶
func (mss *MySQLStorage) DelKey(table string, key string) (int64, error)
func (*MySQLStorage) Destroy ¶
func (mss *MySQLStorage) Destroy() error
func (*MySQLStorage) GetFromMap ¶
func (*MySQLStorage) GetFullKey ¶
func (mss *MySQLStorage) GetFullKey(key string) (string, error)
func (*MySQLStorage) GetKey ¶
func (mss *MySQLStorage) GetKey(table string, key string) (string, error)
func (*MySQLStorage) GetKeys ¶
func (mss *MySQLStorage) GetKeys(table string, pattern string) ([]string, error)
func (*MySQLStorage) Init ¶
func (mss *MySQLStorage) Init() error
func (*MySQLStorage) KeysCleanUp ¶
func (mss *MySQLStorage) KeysCleanUp() error
type PostgreSQLStorage ¶
func (*PostgreSQLStorage) Create ¶
func (pss *PostgreSQLStorage) Create(credentials map[string]string) error
func (*PostgreSQLStorage) DelFromMap ¶
func (pss *PostgreSQLStorage) DelFromMap(table string, key string, objectKey string) error
func (*PostgreSQLStorage) DelKey ¶
func (pss *PostgreSQLStorage) DelKey(table string, key string) (int64, error)
func (*PostgreSQLStorage) Destroy ¶
func (pss *PostgreSQLStorage) Destroy() error
func (*PostgreSQLStorage) GetFromMap ¶
func (*PostgreSQLStorage) GetFullKey ¶
func (pss *PostgreSQLStorage) GetFullKey(key string) (string, error)
func (*PostgreSQLStorage) GetKey ¶
func (pss *PostgreSQLStorage) GetKey(table string, key string) (string, error)
func (*PostgreSQLStorage) GetKeys ¶
func (pss *PostgreSQLStorage) GetKeys(table string, pattern string) ([]string, error)
func (*PostgreSQLStorage) Init ¶
func (pss *PostgreSQLStorage) Init() error
func (*PostgreSQLStorage) KeysCleanUp ¶
func (pss *PostgreSQLStorage) KeysCleanUp() error
type RedisStorage ¶
type RedisStorage struct {
// contains filtered or unexported fields
}
func (*RedisStorage) DelFromMap ¶
func (rs *RedisStorage) DelFromMap(table string, key string, objectKey string) error
func (*RedisStorage) DelKey ¶
func (rs *RedisStorage) DelKey(table string, key string) (int64, error)
func (*RedisStorage) Destroy ¶
func (rs *RedisStorage) Destroy() error
func (*RedisStorage) GetFromMap ¶
func (*RedisStorage) GetFullKey ¶
func (rs *RedisStorage) GetFullKey(key string) (string, error)
func (*RedisStorage) GetKey ¶
func (rs *RedisStorage) GetKey(table string, key string) (string, error)
func (*RedisStorage) GetKeys ¶
func (rs *RedisStorage) GetKeys(table string, pattern string) ([]string, error)
func (*RedisStorage) Init ¶
func (rs *RedisStorage) Init() error
type SQLiteStorage ¶
func (*SQLiteStorage) DelFromMap ¶
func (ss *SQLiteStorage) DelFromMap(table string, key string, objectKey string) error
func (*SQLiteStorage) DelKey ¶
func (ss *SQLiteStorage) DelKey(table string, key string) (int64, error)
func (*SQLiteStorage) Destroy ¶
func (ss *SQLiteStorage) Destroy() error
func (*SQLiteStorage) GetFromMap ¶
func (*SQLiteStorage) GetFullKey ¶
func (ss *SQLiteStorage) GetFullKey(key string) (string, error)
func (*SQLiteStorage) GetKey ¶
func (ss *SQLiteStorage) GetKey(table string, key string) (string, error)
func (*SQLiteStorage) GetKeys ¶
func (ss *SQLiteStorage) GetKeys(table string, pattern string) ([]string, error)
func (*SQLiteStorage) Init ¶
func (ss *SQLiteStorage) Init() error
func (*SQLiteStorage) KeysCleanUp ¶
func (ss *SQLiteStorage) KeysCleanUp() error
type Storage ¶
type Storage interface { Setup(credentials map[string]string) error Init() error Create(credentials map[string]string) error Destroy() error GetKeys(table string, pattern string) ([]string, error) SetKey(table string, key string, value string, expiration time.Duration) error GetFullKey(key string) (string, error) GetKey(table string, key string) (string, error) DelKey(table string, key string) (int64, error) AddToMap(table string, key string, objectKey string, object string) error DelFromMap(table string, key string, objectKey string) error GetFromMap(table string, key string, objectKey string) (string, error) GetMap(table string, key string) (map[string]string, error) }
Click to show internal directories.
Click to hide internal directories.