config

package
v5.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

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 (

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

Functions

func GetAPIResultsBucketURL

func GetAPIResultsBucketURL() (string, error)

GetAPIResultsBucketURL returns the bucket URL for storing cron job results.

func GetAdditionalParams

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

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

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

func GetInputBucketPrefix

func GetInputBucketPrefix() (string, error)

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

func GetInputBucketPrefixFile

func GetInputBucketPrefixFile() (string, error)

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

func GetInputBucketURL

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

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

func GetRawBigQueryTable() (string, error)

GetRawBigQueryTable returns the table name to transfer cron job results.

func GetRawResultDataBucketURL

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 requests.

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

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

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