config

package
v4.13.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2023 License: Apache-2.0 Imports: 9 Imported by: 5

Documentation

Overview

Package config defines the configuration values for the cron job.

Index

Constants

View Source
const (
	// ShardMetadataFilename file contains metadata for the created shard.
	ShardMetadataFilename string = ".shard_metadata"
	// ShardNumFilename is the name of the file that stores the number of shards.
	ShardNumFilename string = ".shard_num"
	// TransferStatusFilename file identifies if shard transfer to BigQuery is completed.
	TransferStatusFilename string = ".transfer_complete"
)

Variables

View Source
var (
	// ErrorEmptyConfigValue indicates the value for the configuration option was empty.
	ErrorEmptyConfigValue = errors.New("config value set to empty")
	// ErrorValueConversion indicates an unexpected type was found for the value of the config option.
	ErrorValueConversion = errors.New("unexpected type, cannot convert value")
	// ErrorNoConfig indicates no config file was provided, or flag.Parse() was not called.
	ErrorNoConfig = errors.New("no configuration file provided with --" + configFlag)
)

Functions

func GetAPIResultsBucketURL added in v4.9.0

func GetAPIResultsBucketURL() (string, error)

GetAPIResultsBucketURL returns the bucket URL for storing cron job results.

func GetAdditionalParams added in v4.9.0

func GetAdditionalParams(subMapName string) (map[string]string, error)

func GetBigQueryDataset

func GetBigQueryDataset() (string, error)

GetBigQueryDataset returns the BQ dataset name to transfer cron job results.

func GetBigQueryTable

func GetBigQueryTable() (string, error)

GetBigQueryTable returns the table name to transfer cron job results.

func GetBlacklistedChecks

func GetBlacklistedChecks() ([]string, error)

GetBlacklistedChecks returns a list of checks which are not to be run.

func GetCIIDataBucketURL

func GetCIIDataBucketURL() (string, error)

GetCIIDataBucketURL returns the bucket URL where CII data is stored.

func GetCompletionThreshold

func GetCompletionThreshold() (float64, error)

GetCompletionThreshold returns fraction of shards to be populated before transferring cron job results.

func GetCriticalityValues added in v4.9.0

func GetCriticalityValues() (map[string]string, error)

GetCriticalityValues() returns a map of key, value pairs containing additional, criticality specific values.

func GetInputBucketPrefix added in v4.9.0

func GetInputBucketPrefix() (string, error)

GetInputBucketPrefix() returns the prefix used when fetching files from a bucket.

func GetInputBucketPrefixFile added in v4.9.0

func GetInputBucketPrefixFile() (string, error)

GetInputBucketPrefixFile() returns the file whose contents specify the prefix to use.

func GetInputBucketURL added in v4.9.0

func GetInputBucketURL() (string, error)

GetInputBucketURL() returns the bucket URL for input files.

func GetMetricExporter

func GetMetricExporter() (string, error)

GetMetricExporter returns the opencensus exporter type.

func GetMetricStackdriverPrefix added in v4.9.0

func GetMetricStackdriverPrefix() (string, error)

GetMetricStackdriverPrefix returns the prefix for stackdriver opencensus exporter.

func GetProjectID

func GetProjectID() (string, error)

GetProjectID returns the cloud projectID for the cron job.

func GetRawBigQueryTable added in v4.2.0

func GetRawBigQueryTable() (string, error)

GetRawBigQueryTable returns the table name to transfer cron job results.

func GetRawResultDataBucketURL added in v4.2.0

func GetRawResultDataBucketURL() (string, error)

GetRawResultDataBucketURL returns the bucketURL for storing cron job's raw results.

func GetRequestSubscriptionURL

func GetRequestSubscriptionURL() (string, error)

GetRequestSubscriptionURL returns the subscription name of the PubSub topic for cron job reuests.

func GetRequestTopicURL

func GetRequestTopicURL() (string, error)

GetRequestTopicURL returns the topic name for sending cron job PubSub requests.

func GetResultDataBucketURL

func GetResultDataBucketURL() (string, error)

GetResultDataBucketURL returns the bucketURL for storing cron job results.

func GetScorecardValues added in v4.9.0

func GetScorecardValues() (map[string]string, error)

GetScorecardValues() returns a map of key, value pairs containing additional, scorecard specific values.

func GetShardSize

func GetShardSize() (int, error)

GetShardSize returns the shard_size for the cron job.

func GetWebhookURL

func GetWebhookURL() (string, error)

GetWebhookURL returns the webhook URL to ping on a successful cron job completion.

func ReadConfig added in v4.9.0

func ReadConfig() error

ReadConfig reads the contents of a configuration file specified with --config for later use by getters. This function must be called before any other exported function, and after flag.Parse() is called.

Types

This section is empty.

Jump to

Keyboard shortcuts

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