config

package
v0.3.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2022 License: Apache-2.0 Imports: 10 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"
)
View Source
const (
	DaemonBackendFusedev string = "fusedev"
	DaemonBackendFscache string = "fscache"
)

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig(configFile string, cfg *DaemonConfig) error

func SaveConfig

func SaveConfig(c interface{}, configFile string) error

Types

type BackendConfig added in v0.3.0

type BackendConfig 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"`
	SkipVerify bool   `json:"skip_verify,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"`
}

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"`
	DaemonBackend        string        `toml:"daemon_backend"`
	SyncRemove           bool          `toml:"sync_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"`
	CleanupOnClose       bool          `toml:"cleanup_on_close"`
}

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 `json:"fs_prefetch,omitempty"`
	FscacheDaemonConfig
}

func NewDaemonConfig

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

type DeviceConfig

type DeviceConfig struct {
	Backend struct {
		BackendType string        `json:"type"`
		Config      BackendConfig `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"`
}

type FSPrefetch added in v0.3.0

type FSPrefetch struct {
	Enable        bool `json:"enable"`
	PrefetchAll   bool `json:"prefetch_all"`
	ThreadsCount  int  `json:"threads_count"`
	MergingSize   int  `json:"merging_size"`
	BandwidthRate int  `json:"bandwidth_rate"`
}

type FscacheDaemonConfig added in v0.3.0

type FscacheDaemonConfig struct {
	// These fields is only for fscache daemon.
	Type     string `json:"type"`
	ID       string `json:"id"`
	DomainID string `json:"domain_id"`
	Config   struct {
		ID            string        `json:"id"`
		BackendType   string        `json:"backend_type"`
		BackendConfig BackendConfig `json:"backend_config"`
		CacheType     string        `json:"cache_type"`
		CacheConfig   struct {
			WorkDir string `json:"workdir"`
		} `json:"cache_config"`
		MetadataPath string `json:"metadata_path"`
	} `json:"config"`
	FSPrefetch `json:"fs_prefetch,omitempty"`
}

Jump to

Keyboard shortcuts

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