Documentation ¶
Overview ¶
Package mdcache contains a Cache that caches source metadata.
Index ¶
- type Cache
- func (c *Cache) Close() error
- func (c *Cache) DBProperties(ctx context.Context, handle string) (map[string]any, error)
- func (c *Cache) DBPropertiesPair(ctx context.Context, src1, src2 *source.Source) (dbp1, dbp2 map[string]any, err error)
- func (c *Cache) SourceMeta(ctx context.Context, handle string) (*metadata.Source, error)
- func (c *Cache) SourceMetaPair(ctx context.Context, src1, src2 *source.Source) (md1, md2 *metadata.Source, err error)
- func (c *Cache) TableMeta(ctx context.Context, tbl source.Table) (*metadata.Table, error)
- func (c *Cache) TableMetaPair(ctx context.Context, tbl1, tbl2 source.Table) (md1, md2 *metadata.Table, err error)
- func (c *Cache) TableNames(ctx context.Context, handle string) ([]string, error)
- func (c *Cache) TableNamesPair(ctx context.Context, src1, src2 *source.Source) (tbls1, tbls2 []string, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache caches source metadata. Note that the accessor methods return the actual internal cache values, not copies, so the caller MUST NOT modify the returned values.
func (*Cache) DBProperties ¶
DBProperties returns the DB properties for the source. The returned value is the internal cache entry, so the caller MUST NOT modify it.
func (*Cache) DBPropertiesPair ¶
func (c *Cache) DBPropertiesPair(ctx context.Context, src1, src2 *source.Source, ) (dbp1, dbp2 map[string]any, err error)
DBPropertiesPair returns the DB properties for src1 and src2. The returned values are the internal cache entries, so the caller MUST NOT modify them.
func (*Cache) SourceMeta ¶
SourceMeta returns the metadata for the source. The returned value is the internal cache entry, so the caller MUST NOT modify it. Use metadata.Source.Clone if necessary.
func (*Cache) SourceMetaPair ¶
func (c *Cache) SourceMetaPair(ctx context.Context, src1, src2 *source.Source) (md1, md2 *metadata.Source, err error)
SourceMetaPair returns the metadata.Source pair for tbl1 and tbl2. The returned values are the internal cache entries, so the caller MUST NOT modify them. Use metadata.Source.Clone if necessary.
func (*Cache) TableMeta ¶
TableMeta returns the metadata for tbl. The returned value is the internal cache entry, so the caller MUST NOT modify it. Use metadata.Table.Clone if necessary.
func (*Cache) TableMetaPair ¶
func (c *Cache) TableMetaPair(ctx context.Context, tbl1, tbl2 source.Table) (md1, md2 *metadata.Table, err error)
TableMetaPair returns the metadata.Table pair for tbl1 and tbl2. The returned values are the internal cache entries, so the caller MUST NOT modify them. Use metadata.Table.Clone if necessary.
func (*Cache) TableNames ¶
TableNames returns the table names for the source. The returned value is the internal cache entry, so the caller MUST NOT modify it.