datasources

package
v0.0.0-...-e560ebb Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Client *bigquery.Client
	Config *Config
}

Client is used to fetch metrics from a given data source.

func (*Client) GetMetrics

func (c *Client) GetMetrics(ctx context.Context, dataSource string, period api.Period, dates, metrics []string) ([]*api.Section, error)

type Config

type Config struct {
	Sources map[string]SourceConfig `yaml:"sources"`
}

Config is used to configure the data source client

func UnmarshallConfig

func UnmarshallConfig(yamlConfig []byte) (*Config, error)

type SourceConfig

type SourceConfig struct {
	// Valid keys map to the Period enum in service.proto
	// i.e. DAY, WEEK
	Queries map[string]string `yaml:"queries,flow"`
}

SourceConfig specifies the configuration for a single data source

Jump to

Keyboard shortcuts

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