common

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2020 License: BSD-3-Clause Imports: 9 Imported by: 5

Documentation

Index

Constants

View Source
const AccountsTable string = "accounts"

AccountsTable stores account information

View Source
const ActiveProbesTable string = "active_probes"

ActiveProbesTable stores the active probe metadata

View Source
const CollectorsTable string = "collectors"

CollectorsTable stores collector information

View Source
const CountriesTable string = "countries"

CountriesTable stores country information

View Source
const JobAlertsTable string = "job_alerts"

JobAlertsTable stores metadata about alert type jobs

View Source
const JobTasksTable string = "job_tasks"

JobTasksTable stores metadata abou task type jobs

View Source
const JobsTable string = "jobs"

JobsTable stores the jobs scheduled

View Source
const ProbeUpdatesTable string = "probe_updates"

ProbeUpdatesTable stores every update message from probes

View Source
const TasksTable string = "tasks"

TasksTable stores metadata about task

View Source
const TestHelpersTable string = "test_helpers"

TestHelpersTable stores the test helper information

View Source
const URLCategoriesTable string = "url_categories"

URLCategoriesTable stores the URL category code information

View Source
const URLsTable string = "urls"

URLsTable stores URL information

Variables

View Source
var (
	// CommitHash contains the current Git revision. Use make to build to make
	// sure this gets set.
	CommitHash string
	// BuildDate contains the date of the current build.
	BuildDate string
)
View Source
var AllCategoryCodes = mapStrStruct{"ALDR": {}, "REL": {}, "PORN": {},
	"PROV": {}, "POLR": {}, "HUMR": {}, "ENV": {}, "MILX": {},
	"HATE": {}, "NEWS": {}, "XED": {}, "PUBH": {}, "GMB": {},
	"ANON": {}, "DATE": {}, "GRP": {}, "LGBT": {}, "FILE": {},
	"HACK": {}, "COMT": {}, "MMED": {}, "HOST": {}, "SRCH": {},
	"GAME": {}, "CULTR": {}, "ECON": {}, "GOVT": {}, "COMM": {},
	"CTRL": {}, "IGO": {}, "MISC": {}}

AllCategoryCodes The list of all the supported category codes from the citizenlab test-list. See: https://github.com/citizenlab/test-lists/blob/master/lists/00-LEGEND-new_category_codes.csv

View Source
var AllCountryCodes = mapStrStruct{}/* 245 elements not displayed */

AllCountryCodes Official ISO 3166-2 alpha 2 country codes (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) We also use the user-assignable ZZ and XX country codes to indicate "Unknown country" and "All countries" respectively .

View Source
var CurrentOrchestraVersion = OrchestraVersion{
	Major:  0,
	Minor:  3,
	Patch:  2,
	Suffix: "",
}

CurrentOrchestraVersion is the current version of orchestra. Remember to change this before making a release

Functions

func Asset

func Asset(name string) ([]byte, error)

Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetDir

func AssetDir(name string) ([]string, error)

AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:

data/
  foo.txt
  img/
    a.png
    b.png

then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.

func AssetInfo

func AssetInfo(name string) (os.FileInfo, error)

AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetNames

func AssetNames() []string

AssetNames returns the names of the assets. nolint: deadcode

func MapToUppercase

func MapToUppercase(vs []string) []string

MapToUppercase returns the list with all the strings uppercased

func MustAsset

func MustAsset(name string) []byte

MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables. nolint: deadcode

func RestoreAsset

func RestoreAsset(dir, name string) error

RestoreAsset restores an asset under the given directory

func RestoreAssets

func RestoreAssets(dir, name string) error

RestoreAssets restores an asset under the given directory recursively

func ValidateCSVMapStr

func ValidateCSVMapStr(csvStr string, m mapStrStruct) bool

ValidateCSVMapStr Check if a CSV map string contains all values inside of a target mapStrStruct

Types

type OrchestraInfo

type OrchestraInfo struct {
	Version    string
	CommitHash string
	BuildDate  string
}

OrchestraInfo contains information for the current orchestra build

type OrchestraVersion

type OrchestraVersion struct {
	Major  int
	Minor  int
	Patch  int
	Suffix string
}

OrchestraVersion contains the version information for orchestra

func (OrchestraVersion) String

func (v OrchestraVersion) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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