Documentation ¶
Index ¶
- type MemDb
- func (memDb *MemDb) GetManifest() *pb.MemdbConfig
- func (memDb *MemDb) GetPlaceSvExistence() map[string]map[string]int32
- func (memDb *MemDb) GetStatVars(places []string) ([]string, []string)
- func (memDb *MemDb) GetSvg() map[string]*pb.StatVarGroupNode
- func (memDb *MemDb) HasStatVar(statVar string) bool
- func (memDb *MemDb) IsEmpty() bool
- func (memDb *MemDb) LoadConfig(ctx context.Context, file string) error
- func (memDb *MemDb) LoadFromGcs(ctx context.Context, bucket, prefix string) error
- func (memDb *MemDb) ReadPointValue(statVar, place, date string) (*pb.PointStat, *pb.StatMetadata)
- func (memDb *MemDb) ReadSeries(statVar, place string) []*pb.Series
- func (memDb *MemDb) ReadStatDate(statVar string) *pb.StatDateList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemDb ¶
type MemDb struct {
// contains filtered or unexported fields
}
MemDb holds imported data in memory.
func (*MemDb) GetManifest ¶
func (memDb *MemDb) GetManifest() *pb.MemdbConfig
GetManifest get the manifest data.
func (*MemDb) GetPlaceSvExistence ¶ added in v1.35.0
GetPlaceSvExistence get the place sv existence info
func (*MemDb) GetStatVars ¶
GetStatVars retrieves the stat vars from private import that have data for the given places.
func (*MemDb) GetSvg ¶ added in v1.35.0
func (memDb *MemDb) GetSvg() map[string]*pb.StatVarGroupNode
GetSvg get the svg data.
func (*MemDb) HasStatVar ¶
HasStatVar checks if a stat var exists in the memory database.
func (*MemDb) LoadConfig ¶ added in v1.35.0
LoadConfig loads the memdb config from file.
func (*MemDb) LoadFromGcs ¶
LoadFromGcs loads tmcf + csv files into memory database This should be called after LoadConfig() so config is already set.
func (*MemDb) ReadPointValue ¶
func (memDb *MemDb) ReadPointValue(statVar, place, date string) ( *pb.PointStat, *pb.StatMetadata, )
ReadPointValue reads one observation point. If date is "", the latest observation is returned, otherwise, the observation corresponding to the given date is returned.
func (*MemDb) ReadSeries ¶
ReadSeries reads stat series from in-memory DB.
func (*MemDb) ReadStatDate ¶ added in v1.34.0
func (memDb *MemDb) ReadStatDate(statVar string) *pb.StatDateList
ReadStatDate reads observation date frequency for a given stat var.