cache

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EXPIRE_TIME = 15 * time.Minute

Functions

func GetColumns

func GetColumns(tx *Tx, tableName string) ([]schema.ColumnMeta, error)

func GetIndexes

func GetIndexes(tx *Tx, tableName string) ([]schema.IndexMeta, error)

func SetTableMetaCache

func SetTableMetaCache(tbMetaCache ITableMetaCache)

Types

type ITableMetaCache

type ITableMetaCache interface {
	GetTableMeta(tx *sql.Tx, tableName, resourceId string) (schema.TableMeta, error)

	Refresh(tx *sql.Tx, resourceId string)
}

func GetTableMetaCache

func GetTableMetaCache() ITableMetaCache

func NewMysqlTableMetaCache

func NewMysqlTableMetaCache(dsn string) ITableMetaCache

type MysqlTableMetaCache

type MysqlTableMetaCache struct {
	// contains filtered or unexported fields
}

func (*MysqlTableMetaCache) FetchSchema

func (cache *MysqlTableMetaCache) FetchSchema(tx *Tx, tableName string) (schema.TableMeta, error)

func (*MysqlTableMetaCache) GetCacheKey

func (cache *MysqlTableMetaCache) GetCacheKey(tableName string, resourceId string) string

func (*MysqlTableMetaCache) GetTableMeta

func (cache *MysqlTableMetaCache) GetTableMeta(tx *sql.Tx, tableName, resourceId string) (schema.TableMeta, error)

func (*MysqlTableMetaCache) Refresh

func (cache *MysqlTableMetaCache) Refresh(tx *sql.Tx, resourceId string)

type Tx

type Tx struct {
	*sql.Tx
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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