settings

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2023 License: Apache-2.0 Imports: 10 Imported by: 11

Documentation

Index

Constants

View Source
const CONFIG_JSON_PATH = ".kpm/config/config.json"

The config.json used to persist user information

View Source
const DEFAULT_REGISTRY = "ghcr.io"
View Source
const DEFAULT_REPO = "kusionstack"
View Source
const KPM_JSON_PATH = ".kpm/config/kpm.json"

The kpm.json used to describe the default configuration of kpm.

View Source
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

func GetFullPath(jsonFileName string) (string, error)

GetFullPath returns the full path file path under '$HOME/.kpm/config/'

Types

type KpmConf

type KpmConf struct {
	DefaultOciRegistry string
	DefaultOciRepo     string
}

The kpm configuration

func DefaultKpmConf

func DefaultKpmConf() KpmConf

DefaultKpmConf create a default configuration for kpm.

type Settings

type Settings struct {
	CredentialsFile string
	// the default configuration for kpm.
	Conf KpmConf

	// the flock used to lock the 'package-cache' file.
	PackageCacheLock *flock.Flock
}

func GetSettings

func GetSettings() (*Settings, error)

GetSettings will return the kpm setting singleton.

func (*Settings) AcquirePackageCacheLock

func (settings *Settings) AcquirePackageCacheLock() error

AcquirePackageCacheLock will try to lock the 'package-cache' file.

func (*Settings) DefaultOciRegistry

func (settings *Settings) DefaultOciRegistry() string

DefaultOciRepo return the default OCI registry 'ghcr.io'.

func (*Settings) DefaultOciRepo

func (settings *Settings) DefaultOciRepo() string

DefaultOciRepo return the default OCI repo 'kusionstack'.

func (*Settings) ReleasePackageCacheLock

func (settings *Settings) ReleasePackageCacheLock() error

ReleasePackageCacheLock will try to unlock the 'package-cache' file.

Jump to

Keyboard shortcuts

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