Documentation ¶
Index ¶
- Constants
- func GetFullPath(jsonFileName string) (string, error)
- type KpmConf
- type Settings
- func (settings *Settings) AcquirePackageCacheLock(logWriter io.Writer) error
- func (settings *Settings) DefaultOciPlainHttp() bool
- func (settings *Settings) DefaultOciRef() string
- func (settings *Settings) DefaultOciRegistry() string
- func (settings *Settings) DefaultOciRepo() string
- func (settings *Settings) ForceOciPlainHttp() (bool, bool)
- func (settings *Settings) LoadSettingsFromEnv() (*Settings, *reporter.KpmEvent)
- func (settings *Settings) ReleasePackageCacheLock() error
Constants ¶
const CONFIG_JSON_PATH = ".kpm/config/config.json"
The config.json used to persist user information
const DEFAULT_OCI_PLAIN_HTTP = ON
const DEFAULT_OCI_PLAIN_HTTP_ENV = "OCI_REG_PLAIN_HTTP"
const DEFAULT_REGISTRY = "ghcr.io"
const DEFAULT_REGISTRY_ENV = "KPM_REG"
const DEFAULT_REPO = "kcl-lang"
const DEFAULT_REPO_ENV = "KPM_REPO"
const KPM_JSON_PATH = ".kpm/config/kpm.json"
The kpm.json used to describe the default configuration of kpm.
const OFF = "off"
const ON = "on"
const PACKAGE_CACHE_PATH = ".kpm/config/package-cache"
The package-cache path, kpm will try lock 'package-cache' before downloading a package.
Variables ¶
This section is empty.
Functions ¶
func GetFullPath ¶
GetFullPath returns the full path file path under '$HOME/.kpm/config/'
Types ¶
type KpmConf ¶
type KpmConf struct { DefaultOciRegistry string DefaultOciRepo string DefaultOciPlainHttp *bool `json:",omitempty"` }
The kpm configuration
func DefaultKpmConf ¶
func DefaultKpmConf() KpmConf
DefaultKpmConf create a default configuration for kpm.
type Settings ¶
type Settings struct { CredentialsFile string KpmConfFile string // the default configuration for kpm. Conf KpmConf // the flock used to lock the 'package-cache' file. PackageCacheLock *flock.Flock // the error catch from the closure in once.Do() ErrorEvent *reporter.KpmEvent }
func (*Settings) AcquirePackageCacheLock ¶
AcquirePackageCacheLock will try to lock the 'package-cache' file.
func (*Settings) DefaultOciPlainHttp ¶ added in v0.3.3
DefaultOciPlainHttp return the default OCI plain http 'false'. Deprecated: DefaultOciPlainHttp is deprecated, please use ForceOciPlainHttp() instead.
func (*Settings) DefaultOciRef ¶ added in v0.3.2
DefaultOciRef return the default OCI ref 'ghcr.io/kcl-lang'.
func (*Settings) DefaultOciRegistry ¶
DefaultOciRepo return the default OCI registry 'ghcr.io'.
func (*Settings) DefaultOciRepo ¶
DefaultOciRepo return the default OCI repo 'kcl-lang'.
func (*Settings) ForceOciPlainHttp ¶ added in v0.9.1
ForceOciPlainHttp return the force OCI plain http.
func (*Settings) LoadSettingsFromEnv ¶ added in v0.3.2
LoadSettingsFromEnv will load the kpm settings from environment variables.
func (*Settings) ReleasePackageCacheLock ¶
ReleasePackageCacheLock will try to unlock the 'package-cache' file.