Documentation ¶
Index ¶
- type KpmClient
- func (c *KpmClient) AcquirePackageCacheLock() error
- func (c *KpmClient) AddDepToPkg(kclPkg *pkg.KclPkg, d *pkg.Dependency) error
- func (c *KpmClient) AddDepWithOpts(kclPkg *pkg.KclPkg, opt *opt.AddOptions) (*pkg.KclPkg, error)
- func (c *KpmClient) Compile(kclPkg *pkg.KclPkg, kclvmCompiler *runner.Compiler) (*kcl.KCLResultList, error)
- func (c *KpmClient) CompileOciPkg(ociSource, version string, opts *opt.CompileOptions) (*kcl.KCLResultList, error)
- func (c *KpmClient) CompilePkgWithOpts(kclPkg *pkg.KclPkg, opts *opt.CompileOptions) (*kcl.KCLResultList, error)
- func (c *KpmClient) CompileTarPkg(tarPath string, opts *opt.CompileOptions) (*kcl.KCLResultList, error)
- func (c *KpmClient) CompileWithOpts(opts *opt.CompileOptions) (*kcl.KCLResultList, error)
- func (c *KpmClient) Download(dep *pkg.Dependency, localPath string) (*pkg.Dependency, error)
- func (c *KpmClient) DownloadFromGit(dep *pkg.Git, localPath string) (string, error)
- func (c *KpmClient) DownloadFromOci(dep *pkg.Oci, localPath string) (string, error)
- func (c *KpmClient) FetchOciManifestIntoJsonStr(opts opt.OciFetchOptions) (string, error)
- func (c *KpmClient) FillDepInfo(dep *pkg.Dependency) error
- func (c *KpmClient) FillDependenciesInfo(modFile *pkg.ModFile) error
- func (c *KpmClient) GetLogWriter() io.Writer
- func (c *KpmClient) GetNoSumCheck() bool
- func (c *KpmClient) GetSettings() *settings.Settings
- func (c *KpmClient) InitEmptyPkg(kclPkg *pkg.KclPkg) error
- func (c *KpmClient) LoadLockDeps(pkgPath string) (*pkg.Dependencies, error)
- func (c *KpmClient) LoadModFile(pkgPath string) (*pkg.ModFile, error)
- func (c *KpmClient) LoadPkgFromPath(pkgPath string) (*pkg.KclPkg, error)
- func (c *KpmClient) LoginOci(hostname, username, password string) error
- func (c *KpmClient) LogoutOci(hostname string) error
- func (c *KpmClient) Package(kclPkg *pkg.KclPkg, tarPath string, vendorMode bool) error
- func (c *KpmClient) PackagePkg(kclPkg *pkg.KclPkg, vendorMode bool) (string, error)
- func (c *KpmClient) ParseOciOptionFromString(oci string, tag string) (*opt.OciOptions, error)
- func (c *KpmClient) ParseOciRef(ociRef string) (*opt.OciOptions, error)
- func (c *KpmClient) PullFromOci(localPath, source, tag string) error
- func (c *KpmClient) PushToOci(localPath string, ociOpts *opt.OciOptions) error
- func (c *KpmClient) ReleasePackageCacheLock() error
- func (c *KpmClient) ResolveDepsIntoMap(kclPkg *pkg.KclPkg) (map[string]string, error)
- func (c *KpmClient) ResolveDepsMetadataInJsonStr(kclPkg *pkg.KclPkg, update bool) (string, error)
- func (c *KpmClient) ResolvePkgDepsMetadata(kclPkg *pkg.KclPkg, update bool) error
- func (c *KpmClient) SetHomePath(homePath string)
- func (c *KpmClient) SetLogWriter(writer io.Writer)
- func (c *KpmClient) SetNoSumCheck(noSumCheck bool)
- func (c *KpmClient) UpdateDeps(kclPkg *pkg.KclPkg) error
- func (c *KpmClient) VendorDeps(kclPkg *pkg.KclPkg) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KpmClient ¶
type KpmClient struct {
// contains filtered or unexported fields
}
KpmClient is the client of kpm.
func NewKpmClient ¶
NewKpmClient will create a new kpm client with default settings.
func (*KpmClient) AcquirePackageCacheLock ¶
AcquirePackageCacheLock will acquire the lock of the package cache.
func (*KpmClient) AddDepToPkg ¶
AddDepToPkg will add a dependency to the kcl package.
func (*KpmClient) AddDepWithOpts ¶
AddDepWithOpts will add a dependency to the current kcl package.
func (*KpmClient) Compile ¶
func (c *KpmClient) Compile(kclPkg *pkg.KclPkg, kclvmCompiler *runner.Compiler) (*kcl.KCLResultList, error)
Compile will call kcl compiler to compile the current kcl package and its dependent packages.
func (*KpmClient) CompileOciPkg ¶
func (c *KpmClient) CompileOciPkg(ociSource, version string, opts *opt.CompileOptions) (*kcl.KCLResultList, error)
CompileOciPkg will compile the kcl package from the OCI reference or url.
func (*KpmClient) CompilePkgWithOpts ¶
func (c *KpmClient) CompilePkgWithOpts(kclPkg *pkg.KclPkg, opts *opt.CompileOptions) (*kcl.KCLResultList, error)
CompilePkgWithOpts will compile the kcl package with the compile options.
func (*KpmClient) CompileTarPkg ¶
func (c *KpmClient) CompileTarPkg(tarPath string, opts *opt.CompileOptions) (*kcl.KCLResultList, error)
CompileTarPkg will compile the kcl package from the tar package.
func (*KpmClient) CompileWithOpts ¶
func (c *KpmClient) CompileWithOpts(opts *opt.CompileOptions) (*kcl.KCLResultList, error)
CompileWithOpts will compile the kcl program with the compile options.
func (*KpmClient) Download ¶
func (c *KpmClient) Download(dep *pkg.Dependency, localPath string) (*pkg.Dependency, error)
Download will download the dependency to the local path.
func (*KpmClient) DownloadFromGit ¶
DownloadFromGit will download the dependency from the git repository.
func (*KpmClient) DownloadFromOci ¶
DownloadFromOci will download the dependency from the oci repository.
func (*KpmClient) FetchOciManifestIntoJsonStr ¶
func (c *KpmClient) FetchOciManifestIntoJsonStr(opts opt.OciFetchOptions) (string, error)
FetchOciManifestConfIntoJsonStr will fetch the oci manifest config of the kcl package from the oci registry and return it into json string.
func (*KpmClient) FillDepInfo ¶
func (c *KpmClient) FillDepInfo(dep *pkg.Dependency) error
FillDepInfo will fill registry information for a dependency.
func (*KpmClient) FillDependenciesInfo ¶
FillDependenciesInfo will fill registry information for all dependencies in a kcl.mod.
func (*KpmClient) GetLogWriter ¶
func (*KpmClient) GetNoSumCheck ¶ added in v0.4.4
GetNoSumCheck will return the 'noSumCheck' flag.
func (*KpmClient) GetSettings ¶
GetSettings will return the settings of kpm client.
func (*KpmClient) InitEmptyPkg ¶
InitEmptyPkg will initialize an empty kcl package.
func (*KpmClient) LoadLockDeps ¶ added in v0.4.0
func (c *KpmClient) LoadLockDeps(pkgPath string) (*pkg.Dependencies, error)
func (*KpmClient) LoadModFile ¶ added in v0.4.0
func (*KpmClient) LoadPkgFromPath ¶ added in v0.4.0
func (*KpmClient) Package ¶
Package will package the current kcl package into a "*.tar" file into 'tarPath'.
func (*KpmClient) PackagePkg ¶
PackagePkg will package the current kcl package into a "*.tar" file in under the package path.
func (*KpmClient) ParseOciOptionFromString ¶
ParseOciOptionFromString will parser '<repo_name>:<repo_tag>' into an 'OciOptions' with an OCI registry. the default OCI registry is 'docker.io'. if the 'ociUrl' is only '<repo_name>', ParseOciOptionFromString will take 'latest' as the default tag.
func (*KpmClient) ParseOciRef ¶
func (c *KpmClient) ParseOciRef(ociRef string) (*opt.OciOptions, error)
ParseOciRef will parser '<repo_name>:<repo_tag>' into an 'OciOptions'.
func (*KpmClient) PullFromOci ¶
PullFromOci will pull a kcl package from oci registry and unpack it.
func (*KpmClient) PushToOci ¶
func (c *KpmClient) PushToOci(localPath string, ociOpts *opt.OciOptions) error
PushToOci will push a kcl package to oci registry.
func (*KpmClient) ReleasePackageCacheLock ¶
ReleasePackageCacheLock will release the lock of the package cache.
func (*KpmClient) ResolveDepsIntoMap ¶
ResolveDepsIntoMap will calculate the map of kcl package name and local storage path of the external packages.
func (*KpmClient) ResolveDepsMetadataInJsonStr ¶
ResolveDepsMetadataInJsonStr will calculate the local storage path of the external package, and check whether the package exists locally. If the package does not exist, it will re-download to the local. Finally, the calculated metadata of the dependent packages is serialized into a json string and returned.
func (*KpmClient) ResolvePkgDepsMetadata ¶
ResolveDepsMetadata will calculate the local storage path of the external package, and check whether the package exists locally. If the package does not exist, it will re-download to the local.
func (*KpmClient) SetHomePath ¶
SetHomePath will set the home path of kpm.
func (*KpmClient) SetLogWriter ¶
func (*KpmClient) SetNoSumCheck ¶ added in v0.4.4
SetNoSumCheck will set the 'noSumCheck' flag.
func (*KpmClient) UpdateDeps ¶ added in v0.4.0
UpdateDeps will update the dependencies.