config

package
v0.3.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2019 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Advanced

type Advanced struct {
	UseDomainFronting bool   `json:"use_domain_fronting"`
	SendCrashReports  bool   `json:"send_crash_reports"`
	CollectorURL      string `json:"collector_url"`
	BouncerURL        string `json:"bouncer_url"`
}

Advanced settings

type AutomatedTesting

type AutomatedTesting struct {
	Enabled          bool     `json:"enabled"`
	EnabledTests     []string `json:"enabled_tests"`
	MonthlyAllowance string   `json:"monthly_allowance"`
}

AutomatedTesting settings

type Config

type Config struct {
	// Private settings
	Comment         string `json:"_"`
	Version         int64  `json:"_version"`
	InformedConsent bool   `json:"_informed_consent"`
	IsBeta          bool   `json:"_is_beta"` // This is a boolean flag used to indicate this installation of OONI Probe was a beta install. These installations will have their data deleted across releases.

	AutoUpdate       bool             `json:"auto_update"`
	Sharing          Sharing          `json:"sharing"`
	Notifications    Notifications    `json:"notifications"`
	AutomatedTesting AutomatedTesting `json:"automated_testing"`
	NettestGroups    NettestGroups    `json:"test_settings"`
	Advanced         Advanced         `json:"advanced"`
	// contains filtered or unexported fields
}

Config for the OONI Probe installation

func ParseConfig

func ParseConfig(b []byte) (*Config, error)

ParseConfig returns config from JSON bytes.

func ReadConfig

func ReadConfig(path string) (*Config, error)

ReadConfig reads the configuration from the path

func (*Config) Default

func (c *Config) Default() error

Default config settings

func (*Config) Lock

func (c *Config) Lock()

Lock acquires the write mutex

func (*Config) Unlock

func (c *Config) Unlock()

Unlock releases the write mutex

func (*Config) Validate

func (c *Config) Validate() error

Validate the config file

func (*Config) Write

func (c *Config) Write() error

Write the config file in json to the path

type InstantMessaging

type InstantMessaging struct {
	EnabledTests []string `json:"enabled_tests"`
}

InstantMessaging nettest group

func (*InstantMessaging) NettestConfigs

func (s *InstantMessaging) NettestConfigs() []NettestConfig

NettestConfigs returns a list configured enabled tests for the group

type Middlebox

type Middlebox struct {
	EnabledTests []string `json:"enabled_tests"`
}

Middlebox nettest group

type NettestConfig

type NettestConfig struct {
	Name    string
	Options string
}

NettestConfig represents the configuration for a particular nettest

type NettestGroups

type NettestGroups struct {
	Websites         Websites         `json:"websites"`
	InstantMessaging InstantMessaging `json:"instant_messaging"`
	Performance      Performance      `json:"performance"`
	Middlebox        Middlebox        `json:"middlebox"`
}

NettestGroups related settings

type Notifications

type Notifications struct {
	Enabled                bool `json:"enabled"`
	NotifyOnTestCompletion bool `json:"notify_on_test_completion"`
	NotifyOnNews           bool `json:"notify_on_news"`
}

Notifications settings

type Performance

type Performance struct {
	NDTServer      string `json:"ndt_server"`
	NDTServerPort  string `json:"ndt_server_port"`
	DashServer     string `json:"dash_server"`
	DashServerPort string `json:"dash_server_port"`
}

Performance nettest group

type Sharing

type Sharing struct {
	IncludeIP      bool `json:"include_ip"`
	IncludeASN     bool `json:"include_asn"`
	IncludeCountry bool `json:"include_country"`
	IncludeGPS     bool `json:"include_gps"`
	UploadResults  bool `json:"upload_results"`
}

Sharing settings

type Websites

type Websites struct {
	EnabledCategories []string `json:"enabled_categories"`
	Limit             int      `json:"limit"`
}

Websites test group

func (*Websites) NettestConfigs

func (s *Websites) NettestConfigs() []NettestConfig

NettestConfigs returns a list configured enabled tests for the group

Jump to

Keyboard shortcuts

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