statvar

package
v1.38.1 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SvgRoot is the root stat var group of the hierarchy. It's a virtual entity
	// that links to the top level category stat var groups.
	SvgRoot = "dc/g/Root"
)

Variables

This section is empty.

Functions

func BuildParentSvgMap

func BuildParentSvgMap(rawSvg map[string]*pb.StatVarGroupNode) map[string][]string

BuildParentSvgMap gets the mapping of svg/sv id to the parent svg for that svg/sv. Only gets the parent svg that have a path to the root node.

func BuildSQLiteIndex added in v1.38.0

func BuildSQLiteIndex(
	rawSvg map[string]*pb.StatVarGroupNode,
) (*sql.DB, error)

BuildSQLiteIndex builds the sqlite search index for all the stat vars.

func BuildStatVarSearchIndex

func BuildStatVarSearchIndex(
	rawSvg map[string]*pb.StatVarGroupNode,
	parentSvg map[string][]string) *resource.SearchIndex

BuildStatVarSearchIndex builds the search index for the stat var hierarchy.

func Count added in v1.33.0

func Count(
	ctx context.Context,
	st *store.Store,
	svOrSvgs []string,
	places []string,
) (map[string]map[string]int32, error)

Count checks if places have data for stat vars and stat var groups.

Returns a two level map from stat var dcid to place dcid to the number of stat vars with data. For a given stat var, if a place has no data, it will not show up in the second level map.

func GetEntityStatVarsHelper added in v1.34.0

func GetEntityStatVarsHelper(
	ctx context.Context, entities []string, store *store.Store) (
	map[string]*pb.StatVars, error)

GetEntityStatVarsHelper is a wrapper to get stat vars for given entities.

func GetPlaceStatVarsUnionV1

func GetPlaceStatVarsUnionV1(
	ctx context.Context, in *pb.GetPlaceStatVarsUnionRequest, store *store.Store,
) (*pb.GetPlaceStatVarsUnionResponse, error)

GetPlaceStatVarsUnionV1 implements API for Mixer.GetPlaceStatVarsUnionV1.

func GetPlaceStatsVar

func GetPlaceStatsVar(
	ctx context.Context, in *pb.GetPlaceStatsVarRequest, store *store.Store) (
	*pb.GetPlaceStatsVarResponse, error)

GetPlaceStatsVar implements API for Mixer.GetPlaceStatsVar. TODO(shifucun): Migrate clients to use GetPlaceStatVars and deprecate this.

func GetRawSvg

func GetRawSvg(ctx context.Context, store *store.Store) (
	map[string]*pb.StatVarGroupNode, error)

GetRawSvg gets the raw svg mapping.

func GetStatVarGroup

func GetStatVarGroup(
	ctx context.Context,
	in *pb.GetStatVarGroupRequest,
	store *store.Store,
	cache *resource.Cache,
) (*pb.StatVarGroups, error)

GetStatVarGroup implements API for Mixer.GetStatVarGroup.

func GetStatVarGroupNode

func GetStatVarGroupNode(
	ctx context.Context,
	in *pb.GetStatVarGroupNodeRequest,
	store *store.Store,
	cache *resource.Cache,
) (*pb.StatVarGroupNode, error)

GetStatVarGroupNode implements API for Mixer.GetStatVarGroupNode.

func GetStatVarMatch added in v1.34.0

func GetStatVarMatch(
	ctx context.Context,
	in *pb.GetStatVarMatchRequest,
	store *store.Store,
	cache *resource.Cache,
) (*pb.GetStatVarMatchResponse, error)

GetStatVarMatch implements API for Mixer.GetStatVarMatch.

func GetStatVarSummaryHelper added in v1.34.0

func GetStatVarSummaryHelper(
	ctx context.Context, entities []string, store *store.Store) (
	map[string]*pb.StatVarSummary, error)

GetStatVarSummaryHelper is a wrapper to get stat var summary.

func SearchStatVar

func SearchStatVar(
	ctx context.Context,
	in *pb.SearchStatVarRequest,
	store *store.Store,
	cache *resource.Cache,
) (
	*pb.SearchStatVarResponse, error,
)

SearchStatVar implements API for Mixer.SearchStatVar.

Types

type Document added in v1.38.0

type Document struct {
	// ID of the statvar.
	ID string
	// Title of the document. For a statvar this will be the DisplayName.
	Title string
	// A signature text that uniquely identifies the statvar from the key value text.
	Signature int
	// A key value pairs string describing the properties of a stat var.
	KeyValueText string
	// Number of constraints associated to a statvar.
	NumConstraints int32
}

A Document models a statvar indexed in the sqlite DB.

type TokenToMatches added in v1.33.0

type TokenToMatches map[string]map[string]struct{}

TokenToMatches is a map of token to a set of strings that match the token

Jump to

Keyboard shortcuts

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