config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	atomic.Value
}

func New

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

func NewWithRaw

func NewWithRaw(cfg *RawConfig) *Config

func (*Config) Get

func (cfg *Config) Get() *RawConfig

type Features

type Features struct {
	CheckDiskQuota bool         `yaml:"check_disk_quota"`
	DiskUsageLimit HumanizeSize `yaml:"disk_usage_limit"`
}

type HumanizeSize

type HumanizeSize uint64

func (*HumanizeSize) UnmarshalYAML

func (s *HumanizeSize) UnmarshalYAML(unmarshal func(interface{}) error) error

type PullConfig

type PullConfig struct {
	DockerConfigDir           string `yaml:"docker_config_dir"`
	ProxyURL                  string `yaml:"proxy_url"`
	DragonflyEndpoint         string `yaml:"dragonfly_endpoint"`
	Concurrency               uint   `yaml:"concurrency"`
	PullLayerTimeoutInSeconds uint   `yaml:"pull_layer_timeout_in_seconds"`
}

type RawConfig

type RawConfig struct {
	// Pattern:
	// 	static: /var/lib/dragonfly/model-csi/volumes/$volumeName/model
	// dynamic: /var/lib/dragonfly/model-csi/volumes/$volumeName/models
	//          /var/lib/dragonfly/model-csi/volumes/$volumeName/csi.sock
	ServiceName              string     `yaml:"service_name"`
	RootDir                  string     `yaml:"root_dir"`
	ExternalCSIEndpoint      string     `yaml:"external_csi_endpoint"`
	ExternalCSIAuthorization string     `yaml:"external_csi_authorization"`
	DynamicCSIEndpoint       string     `yaml:"dynamic_csi_endpoint"`
	CSIEndpoint              string     `yaml:"csi_endpoint"`
	MetricsAddr              string     `yaml:"metrics_addr"`
	TraceEndpoint            string     `yaml:"trace_endpoint"`
	PprofAddr                string     `yaml:"pprof_addr"`
	PullConfig               PullConfig `yaml:"pull_config"`
	Features                 Features   `yaml:"features"`
	NodeID                   string     // From env CSI_NODE_ID
	Mode                     string     // From env X_CSI_MODE: "controller" or "node"
}

func (*RawConfig) GetCSISockDirForDynamic

func (cfg *RawConfig) GetCSISockDirForDynamic(volumeName string) string

/var/lib/dragonfly/model-csi/volumes/$volumeName/csi

func (*RawConfig) GetModelDir

func (cfg *RawConfig) GetModelDir(volumeName string) string

/var/lib/dragonfly/model-csi/volumes/$volumeName/model

func (*RawConfig) GetModelDirForDynamic

func (cfg *RawConfig) GetModelDirForDynamic(volumeName, mountID string) string

/var/lib/dragonfly/model-csi/volumes/$volumeName/models/$mountID/model

func (*RawConfig) GetModelsDirForDynamic

func (cfg *RawConfig) GetModelsDirForDynamic(volumeName string) string

/var/lib/dragonfly/model-csi/volumes/$volumeName/models

func (*RawConfig) GetMountIDDirForDynamic

func (cfg *RawConfig) GetMountIDDirForDynamic(volumeName, mountID string) string

/var/lib/dragonfly/model-csi/volumes/$volumeName/models/$mountID

func (*RawConfig) GetVolumeDir

func (cfg *RawConfig) GetVolumeDir(volumeName string) string

/var/lib/dragonfly/model-csi/volumes/$volumeName

func (*RawConfig) GetVolumeDirForDynamic

func (cfg *RawConfig) GetVolumeDirForDynamic(volumeName string) string

/var/lib/dragonfly/model-csi/volumes/$volumeName

func (*RawConfig) GetVolumesDir

func (cfg *RawConfig) GetVolumesDir() string

/var/lib/dragonfly/model-csi/volumes

func (*RawConfig) IsControllerMode

func (cfg *RawConfig) IsControllerMode() bool

func (*RawConfig) IsNodeMode

func (cfg *RawConfig) IsNodeMode() bool

func (*RawConfig) ParameterKeyCheckDiskQuota

func (cfg *RawConfig) ParameterKeyCheckDiskQuota() string

func (*RawConfig) ParameterKeyExcludeModelWeights

func (cfg *RawConfig) ParameterKeyExcludeModelWeights() string

func (*RawConfig) ParameterKeyMountID

func (cfg *RawConfig) ParameterKeyMountID() string

func (*RawConfig) ParameterKeyReference

func (cfg *RawConfig) ParameterKeyReference() string

func (*RawConfig) ParameterKeyStatusProgress

func (cfg *RawConfig) ParameterKeyStatusProgress() string

func (*RawConfig) ParameterKeyStatusState

func (cfg *RawConfig) ParameterKeyStatusState() string

func (*RawConfig) ParameterKeyType

func (cfg *RawConfig) ParameterKeyType() string

func (*RawConfig) ParameterVolumeContextNodeIP

func (cfg *RawConfig) ParameterVolumeContextNodeIP() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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