config

package
v3.14.0-alpha Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2021 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigVersion = 1

ConfigVersion is the current version of the config

Variables

This section is empty.

Functions

This section is empty.

Types

type Advanced

type Advanced struct{}

Advanced settings

type Config

type Config struct {
	// Private settings
	Comment         string `json:"_"`
	Version         int64  `json:"_version"`
	InformedConsent bool   `json:"_informed_consent"`

	Sharing  Sharing  `json:"sharing"`
	Nettests Nettests `json:"nettests"`
	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) Lock

func (c *Config) Lock()

Lock acquires the write mutex

func (*Config) MaybeMigrate

func (c *Config) MaybeMigrate() error

MaybeMigrate checks the current config version and the config file on disk and if necessary performs and upgrade of the configuration file.

func (*Config) Unlock

func (c *Config) Unlock()

Unlock releases the write mutex

func (*Config) Write

func (c *Config) Write() error

Write the config file in json to the path

type Nettests

type Nettests struct {
	WebsitesMaxRuntime           int64    `json:"websites_max_runtime"`
	WebsitesURLLimit             int64    `json:"websites_url_limit"`
	WebsitesEnabledCategoryCodes []string `json:"websites_enabled_category_codes"`
}

Nettests related settings

type Sharing

type Sharing struct {
	UploadResults bool `json:"upload_results"`
}

Sharing settings

Jump to

Keyboard shortcuts

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