cache

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2021 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