config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2022 License: Apache-2.0 Imports: 8 Imported by: 4

Documentation

Index

Constants

View Source
const (
	DefaultDaemonMode  string = "multiple"
	DaemonModeMultiple string = "multiple"
	DaemonModeShared   string = "shared"
	DaemonModeNone     string = "none"
	DaemonModePrefetch string = "prefetch"
	DefaultLogLevel    string = "info"
)

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig(configFile string, cfg *DaemonConfig) error

func SaveConfig

func SaveConfig(c DaemonConfig, configFile string) error

Types

type Config

type Config struct {
	Address              string        `toml:"-"`
	ConvertVpcRegistry   bool          `toml:"-"`
	DaemonCfgPath        string        `toml:"daemon_cfg_path"`
	DaemonCfg            DaemonConfig  `toml:"-"`
	PublicKeyFile        string        `toml:"-"`
	RootDir              string        `toml:"-"`
	CacheDir             string        `toml:"cache_dir"`
	GCPeriod             time.Duration `toml:"gc_period"`
	ValidateSignature    bool          `toml:"validate_signature"`
	NydusdBinaryPath     string        `toml:"nydusd_binary_path"`
	NydusImageBinaryPath string        `toml:"nydus_image_binary"`
	DaemonMode           string        `toml:"daemon_mode"`
	AsyncRemove          bool          `toml:"async_remove"`
	EnableMetrics        bool          `toml:"enable_metrics"`
	MetricsFile          string        `toml:"metrics_file"`
	EnableStargz         bool          `toml:"enable_stargz"`
	LogLevel             string        `toml:"-"`
	LogDir               string        `toml:"log_dir"`
	LogToStdout          bool          `toml:"log_to_stdout"`
	DisableCacheManager  bool          `toml:"disable_cache_manager"`
	EnableNydusOverlayFS bool          `toml:"enable_nydus_overlayfs"`
	NydusdThreadNum      int           `toml:"nydusd_thread_num"`
}

func (*Config) FillupWithDefaults

func (c *Config) FillupWithDefaults() error

func (*Config) SetupNydusBinaryPaths

func (c *Config) SetupNydusBinaryPaths() error

type DaemonConfig

type DaemonConfig struct {
	Device         DeviceConfig `json:"device"`
	Mode           string       `json:"mode"`
	DigestValidate bool         `json:"digest_validate"`
	IOStatsFiles   bool         `json:"iostats_files,omitempty"`
	EnableXattr    bool         `json:"enable_xattr,omitempty"`
	FSPrefetch     struct {
		Enable       bool `json:"enable"`
		PrefetchAll  bool `json:"prefetch_all"`
		ThreadsCount int  `json:"threads_count"`
		MergingSize  int  `json:"merging_size"`
	} `json:"fs_prefetch,omitempty"`
}

func NewDaemonConfig

func NewDaemonConfig(cfg DaemonConfig, imageID string, vpcRegistry bool, labels map[string]string) (DaemonConfig, error)

type DeviceConfig

type DeviceConfig struct {
	Backend struct {
		BackendType string `json:"type"`
		Config      struct {
			// Localfs backend configs
			BlobFile     string `json:"blob_file,omitempty"`
			Dir          string `json:"dir,omitempty"`
			ReadAhead    bool   `json:"readahead"`
			ReadAheadSec int    `json:"readahead_sec,omitempty"`

			// Registry backend configs
			Host               string `json:"host,omitempty"`
			Repo               string `json:"repo,omitempty"`
			Auth               string `json:"auth,omitempty"`
			RegistryToken      string `json:"registry_token,omitempty"`
			BlobURLScheme      string `json:"blob_url_scheme,omitempty"`
			BlobRedirectedHost string `json:"blob_redirected_host,omitempty"`

			// OSS backend configs
			EndPoint        string `json:"endpoint,omitempty"`
			AccessKeyID     string `json:"access_key_id,omitempty"`
			AccessKeySecret string `json:"access_key_secret,omitempty"`
			BucketName      string `json:"bucket_name,omitempty"`
			ObjectPrefix    string `json:"object_prefix,omitempty"`

			// Shared by registry and oss backend
			Scheme string `json:"scheme,omitempty"`

			// Below configs are common configs shared by all backends
			Proxy struct {
				URL           string `json:"url,omitempty"`
				Fallback      bool   `json:"fallback"`
				PingURL       string `json:"ping_url,omitempty"`
				CheckInterval int    `json:"check_interval,omitempty"`
			} `json:"proxy,omitempty"`
			Timeout        int `json:"timeout,omitempty"`
			ConnectTimeout int `json:"connect_timeout,omitempty"`
			RetryLimit     int `json:"retry_limit,omitempty"`
		} `json:"config"`
	} `json:"backend"`
	Cache struct {
		CacheType  string `json:"type"`
		Compressed bool   `json:"compressed,omitempty"`
		Config     struct {
			WorkDir           string `json:"work_dir"`
			DisableIndexedMap bool   `json:"disable_indexed_map"`
		} `json:"config"`
	} `json:"cache"`
}

Jump to

Keyboard shortcuts

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