Documentation ¶
Overview ¶
Deprecated: This package is deprecated and will be removed in a future release.
Index ¶
- Constants
- func DFS(graph DependencyGraph, dependency string, visited map[string]bool, ...) []string
- func GetReleasesFromSource(sourceType, uri string) ([]string, error)deprecated
- func OutputDependencies(graph DependencyGraph) []string
- func RunTestWithGlobalLockAndKpmCli(t *testing.T, testSuites []TestSuite)
- type AddOption
- type AddOptions
- type CheckOption
- type CheckOptions
- type DepGraph
- type DependencyGraph
- type GraphOption
- type GraphOptions
- type InitOption
- type InitOptions
- type KpmClient
- func (c *KpmClient) AcquireDepSum(dep pkg.Dependency) (string, error)
- func (c *KpmClient) AcquirePackageCacheLock() error
- func (c *KpmClient) AcquireTheLatestOciVersion(ociSource downloader.Oci) (string, error)
- func (c *KpmClient) Add(options ...AddOption) 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) Check(options ...CheckOption) error
- func (c *KpmClient) Compile(kclPkg *pkg.KclPkg, kclvmCompiler *runner.Compiler) (*kcl.KCLResultList, error)
- func (c *KpmClient) CompileGitPkg(gitOpts *git.CloneOptions, compileOpts *opt.CompileOptions) (*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, homePath, localPath string) (*pkg.Dependency, error)
- func (c *KpmClient) DownloadDeps(deps *pkg.Dependencies, lockDeps *pkg.Dependencies, ...) (*pkg.Dependencies, error)
- func (c *KpmClient) DownloadFromGit(dep *downloader.Git, localPath string) (string, error)
- func (c *KpmClient) DownloadFromOci(dep *downloader.Oci, localPath string) (string, error)
- func (c *KpmClient) DownloadPkgFromOci(dep *downloader.Oci, localPath string) (*pkg.KclPkg, error)
- func (c *KpmClient) FetchOciManifestIntoJsonStr(opts opt.OciFetchOptions) (string, error)
- func (c *KpmClient) FillDepInfo(dep *pkg.Dependency, homepath string) error
- func (c *KpmClient) FillDependenciesInfo(modFile *pkg.ModFile) error
- func (c *KpmClient) GetCredentials(hostName string) (*remoteauth.Credential, error)
- func (c *KpmClient) GetCredsClient() (*downloader.CredClient, error)
- func (c *KpmClient) GetLogWriter() io.Writer
- func (c *KpmClient) GetNoSumCheck() bool
- func (c *KpmClient) GetSettings() *settings.Settings
- func (c *KpmClient) Graph(opts ...GraphOption) (*DepGraph, error)
- func (c *KpmClient) Init(options ...InitOption) error
- func (c *KpmClient) InitEmptyPkg(kclPkg *pkg.KclPkg) error
- func (c *KpmClient) InitGraphAndDownloadDeps(kclPkg *pkg.KclPkg) (*pkg.Dependencies, graph.Graph[module.Version, module.Version], error)
- func (c *KpmClient) LoadLockDeps(pkgPath string) (*pkg.Dependencies, error)
- func (c *KpmClient) LoadModFile(path string) (*pkg.ModFile, error)deprecated
- func (c *KpmClient) LoadPkgFromPath(path string) (*pkg.KclPkg, error)deprecated
- 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) ParseKclModFile(kclPkg *pkg.KclPkg) (map[string]map[string]string, error)deprecated
- func (c *KpmClient) ParseOciOptionFromString(oci string, tag string) (*opt.OciOptions, error)
- func (c *KpmClient) ParseOciRef(ociRef string) (*opt.OciOptions, error)
- func (c *KpmClient) Pull(options ...PullOption) (*pkg.KclPkg, error)
- func (c *KpmClient) PullFromOci(localPath, source, tag string) error
- func (c *KpmClient) Push(opts ...PushOption) 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) Run(options ...RunOption) (*kcl.KCLResultList, error)
- func (c *KpmClient) RunWithOpts(opts ...opt.Option) (*kcl.KCLResultList, error)
- func (c *KpmClient) SetHomePath(homePath string)
- func (c *KpmClient) SetInsecureSkipTLSverify(insecureSkipTLSverify bool)
- func (c *KpmClient) SetLogWriter(writer io.Writer)
- func (c *KpmClient) SetNoSumCheck(noSumCheck bool)
- func (c *KpmClient) Update(options ...UpdateOption) (*pkg.KclPkg, error)
- func (c *KpmClient) UpdateDeps(kclPkg *pkg.KclPkg) error
- func (c *KpmClient) ValidateDependency(dep *pkg.Dependency) errordeprecated
- func (c *KpmClient) ValidatePkgPullFromOci(ociOpts *opt.OciOptions, storagePath string) errordeprecated
- func (c *KpmClient) VendorDeps(kclPkg *pkg.KclPkg) error
- type PullOption
- type PullOptions
- type PushOption
- type PushOptions
- type RunOption
- func WithArguments(args []string) RunOption
- func WithCompileOnly(compileOnly bool) RunOption
- func WithDebug(debug bool) RunOption
- func WithDisableNone(disableNone bool) RunOption
- func WithExternalPkgs(externalPkgs []string) RunOption
- func WithLogger(l io.Writer) RunOption
- func WithOverrides(overrides []string, debug bool) RunOption
- func WithPathSelectors(pathSelectors []string) RunOption
- func WithRunModSpec(modSpec *downloader.ModSpec) RunOption
- func WithRunOptions(runOpts *RunOptions) RunOption
- func WithRunSource(source *downloader.Source) RunOption
- func WithRunSourceUrl(sourceUrl string) RunOption
- func WithRunSourceUrls(sourceUrls []string) RunOption
- func WithRunSources(sources []*downloader.Source) RunOption
- func WithSettingFiles(settingFiles []string) RunOption
- func WithShowHidden(showHidden bool) RunOption
- func WithSortKeys(sortKeys bool) RunOption
- func WithStrictRange(strictRange bool) RunOption
- func WithVendor(vendor bool) RunOption
- func WithWorkDir(workDir string) RunOption
- type RunOptions
- type TestSuite
- type UpdateOption
- type UpdateOptions
Constants ¶
const PKG_NAME_PATTERN = "%s_%s"
Variables ¶
This section is empty.
Functions ¶
func DFS ¶ added in v0.8.0
func DFS(graph DependencyGraph, dependency string, visited map[string]bool, result []string) []string
Traverse dependency graph using depth-first search (DFS)
func GetReleasesFromSource
deprecated
added in
v0.8.7
func OutputDependencies ¶ added in v0.8.0
func OutputDependencies(graph DependencyGraph) []string
Output dependencies in the same format as go mod graph
func RunTestWithGlobalLockAndKpmCli ¶ added in v0.11.0
Use a global variable to store the kpmcli instance.
Types ¶
type AddOption ¶ added in v0.11.0
type AddOption func(*AddOptions) error
func WithAddKclPkg ¶ added in v0.11.0
func WithAddModSpec ¶ added in v0.11.0
func WithAddModSpec(modSpec *downloader.ModSpec) AddOption
func WithAddSource ¶ added in v0.11.0
func WithAddSource(source *downloader.Source) AddOption
func WithAddSourceUrl ¶ added in v0.11.0
type AddOptions ¶ added in v0.11.0
type AddOptions struct { // Source is the source of the package to be pulled. // Including git, oci, local. Source *downloader.Source KclPkg *pkg.KclPkg }
func NewAddOptions ¶ added in v0.11.0
func NewAddOptions(opts ...AddOption) *AddOptions
type CheckOption ¶ added in v0.11.0
type CheckOption func(*CheckOptions) error
func WithCheckKclMod ¶ added in v0.11.0
func WithCheckKclMod(kclMod *pkg.KclPkg) CheckOption
type CheckOptions ¶ added in v0.11.0
type DepGraph ¶ added in v0.11.0
type DepGraph struct {
// contains filtered or unexported fields
}
DepGraph is the dependency graph.
func NewDepGraph ¶ added in v0.11.0
func NewDepGraph() *DepGraph
NewDepGraph creates a new dependency graph.
type DependencyGraph ¶ added in v0.8.0
Construct dependency graph
func ConstructDependencyGraph ¶ added in v0.8.0
func ConstructDependencyGraph(dependencies map[string]map[string]string) DependencyGraph
Function to construct dependency graph from dependency map
func ConstructDependencyGraphFromModFile ¶ added in v0.8.0
func ConstructDependencyGraphFromModFile(kpmClient *KpmClient, kclPkg *pkg.KclPkg) (DependencyGraph, error)
Function to construct dependency graph by parsing kcl.mod file
type GraphOption ¶ added in v0.11.0
type GraphOption func(*GraphOptions) error
func WithGraphMod ¶ added in v0.11.0
func WithGraphMod(kMod *pkg.KclPkg) GraphOption
WithGraphMod sets the kMod for creating a dependency graph.
type GraphOptions ¶ added in v0.11.0
type GraphOptions struct {
// contains filtered or unexported fields
}
GraphOptions is the options for creating a dependency graph.
type InitOption ¶ added in v0.11.0
type InitOption func(*InitOptions) error
func WithInitModName ¶ added in v0.11.0
func WithInitModName(modName string) InitOption
func WithInitModPath ¶ added in v0.11.0
func WithInitModPath(modPath string) InitOption
func WithInitModVersion ¶ added in v0.11.0
func WithInitModVersion(modVersion string) InitOption
func WithInitWorkDir ¶ added in v0.11.0
func WithInitWorkDir(workDir string) InitOption
type InitOptions ¶ added in v0.11.0
InitOptions contains the options for initializing a kcl package.
type KpmClient ¶
type KpmClient struct { // The downloader of the dependencies. DepDownloader *downloader.DepDownloader // The checker to validate dependencies ModChecker *checker.ModChecker // 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) AcquireDepSum ¶ added in v0.8.7
func (c *KpmClient) AcquireDepSum(dep pkg.Dependency) (string, error)
AcquireDepSum will acquire the checksum of the dependency from the OCI registry.
func (*KpmClient) AcquirePackageCacheLock ¶
AcquirePackageCacheLock will acquire the lock of the package cache.
func (*KpmClient) AcquireTheLatestOciVersion ¶ added in v0.8.7
func (c *KpmClient) AcquireTheLatestOciVersion(ociSource downloader.Oci) (string, error)
AcquireTheLatestOciVersion will acquire the latest version of the OCI reference. Deprecated: use the 'downloader.LatestVersion' instead.
func (*KpmClient) AddDepToPkg ¶
AddDepToPkg will add a dependency to the kcl package. Deprecated: Use `Add` instead.
func (*KpmClient) AddDepWithOpts ¶
AddDepWithOpts will add a dependency to the current kcl package. Deperated: Use Add instead.
func (*KpmClient) Check ¶ added in v0.11.0
func (c *KpmClient) Check(options ...CheckOption) error
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. Deprecated: Use `Run` instead.
func (*KpmClient) CompileGitPkg ¶ added in v0.8.0
func (c *KpmClient) CompileGitPkg(gitOpts *git.CloneOptions, compileOpts *opt.CompileOptions) (*kcl.KCLResultList, error)
CompileGitPkg will compile the kcl package from the git url. Deprecated: Use `Run` instead.
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. Deprecated: Use `Run` instead.
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. Deprecated: Use `Run` instead.
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. Deprecated: Use `Run` instead.
func (*KpmClient) CompileWithOpts ¶
func (c *KpmClient) CompileWithOpts(opts *opt.CompileOptions) (*kcl.KCLResultList, error)
CompileWithOpts will compile the kcl program with the compile options. Deprecated: Use `Run` instead.
func (*KpmClient) Download ¶
func (c *KpmClient) Download(dep *pkg.Dependency, homePath, localPath string) (*pkg.Dependency, error)
Download will download the dependency to the local path. Deprecated: the function is not used anymore, use `downloader.Download` instead.
func (*KpmClient) DownloadDeps ¶ added in v0.8.7
func (c *KpmClient) DownloadDeps(deps *pkg.Dependencies, lockDeps *pkg.Dependencies, depGraph graph.Graph[module.Version, module.Version], pkghome string, parent module.Version) (*pkg.Dependencies, error)
downloadDeps will download all the dependencies of the current kcl package. Deprecated: this function is not used anymore, it will be removed in the future.
func (*KpmClient) DownloadFromGit ¶
DownloadFromGit will download the dependency from the git repository. Deprecated: use 'DownloadFromGit' instead.
func (*KpmClient) DownloadFromOci ¶
DownloadFromOci will download the dependency from the oci repository. Deprecated: Use the DownloadPkgFromOci instead.
func (*KpmClient) DownloadPkgFromOci ¶ added in v0.8.3
LoadPkgFromOci will download the kcl package from the oci repository and return an `KclPkg`. Deprecated: this function is deprecated and will be removed in a future release.
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. Deprecated: use `SumChecker.FetchOciManifestIntoJsonStr` instead.
func (*KpmClient) FillDepInfo ¶
func (c *KpmClient) FillDepInfo(dep *pkg.Dependency, homepath string) error
FillDepInfo will fill registry information for a dependency. Deprecated: this function is not used anymore.
func (*KpmClient) FillDependenciesInfo ¶
FillDependenciesInfo will fill registry information for all dependencies in a kcl.mod. Deprecated: this function is not used anymore.
func (*KpmClient) GetCredentials ¶ added in v0.9.1
func (c *KpmClient) GetCredentials(hostName string) (*remoteauth.Credential, error)
GetCredentials will return the credentials of the host.
func (*KpmClient) GetCredsClient ¶ added in v0.9.1
func (c *KpmClient) GetCredsClient() (*downloader.CredClient, error)
GetCredsClient will return the credential client.
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) Graph ¶ added in v0.11.0
func (c *KpmClient) Graph(opts ...GraphOption) (*DepGraph, error)
Graph creates a dependency graph for the given KCL Module.
func (*KpmClient) Init ¶ added in v0.11.0
func (c *KpmClient) Init(options ...InitOption) error
func (*KpmClient) InitEmptyPkg ¶
InitEmptyPkg will initialize an empty kcl package.
func (*KpmClient) InitGraphAndDownloadDeps ¶ added in v0.8.0
func (c *KpmClient) InitGraphAndDownloadDeps(kclPkg *pkg.KclPkg) (*pkg.Dependencies, graph.Graph[module.Version, module.Version], error)
InitGraphAndDownloadDeps initializes a dependency graph and call downloadDeps function. Deprecated: this function is not used anymore and will be removed in the future.
func (*KpmClient) LoadLockDeps ¶ added in v0.4.0
func (c *KpmClient) LoadLockDeps(pkgPath string) (*pkg.Dependencies, error)
Load the kcl.mod.lock and acquire the checksum of the dependencies from OCI registry. Deprecated: use `pkg.LoadLockDeps` instead.
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 parse '<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. Deprecated: this function is deprecated and will be removed in a future release.
func (*KpmClient) ParseOciRef ¶
func (c *KpmClient) ParseOciRef(ociRef string) (*opt.OciOptions, error)
ParseOciRef will parse '<repo_name>:<repo_tag>' into an 'OciOptions'. Deprecated: ParseOciRef is deprecated and will be removed in a future release.
func (*KpmClient) Pull ¶ added in v0.9.0
func (c *KpmClient) Pull(options ...PullOption) (*pkg.KclPkg, error)
func (*KpmClient) PullFromOci ¶
PullFromOci will pull a kcl package from oci registry and unpack it. Deprecated: use `Pull` instead.
func (*KpmClient) Push ¶ added in v0.11.0
func (c *KpmClient) Push(opts ...PushOption) error
Push will push a kcl package to a 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. Since redownloads are not triggered if local dependencies exists, indirect dependencies are also synchronized to the lock file by `lockDeps`.
func (*KpmClient) Run ¶ added in v0.9.1
func (c *KpmClient) Run(options ...RunOption) (*kcl.KCLResultList, error)
Run runs the kcl package.
func (*KpmClient) RunWithOpts ¶ added in v0.8.6
RunWithOpts will compile the kcl package with the compile options. Deprecated: Use `Run` instead.
func (*KpmClient) SetHomePath ¶
SetHomePath will set the home path of kpm.
func (*KpmClient) SetInsecureSkipTLSverify ¶ added in v0.10.0
SetInsecureSkipTLSverify will set the flag of whether to skip the verification of TLS.
func (*KpmClient) SetLogWriter ¶
func (*KpmClient) SetNoSumCheck ¶ added in v0.4.4
SetNoSumCheck will set the 'noSumCheck' flag.
func (*KpmClient) Update ¶ added in v0.10.0
func (c *KpmClient) Update(options ...UpdateOption) (*pkg.KclPkg, error)
func (*KpmClient) UpdateDeps ¶ added in v0.4.0
UpdateDeps will update the dependencies. Deprecated: Use `Update` instead.
func (*KpmClient) ValidateDependency
deprecated
added in
v0.11.0
func (c *KpmClient) ValidateDependency(dep *pkg.Dependency) error
Deprecated: ValidateDependency is deprecated, use `Check` replaced.
func (*KpmClient) ValidatePkgPullFromOci
deprecated
added in
v0.11.0
func (c *KpmClient) ValidatePkgPullFromOci(ociOpts *opt.OciOptions, storagePath string) error
Deprecated: This function is deprecated and will be removed in a future release.
type PullOption ¶ added in v0.9.0
type PullOption func(*PullOptions) error
func WithLocalPath ¶ added in v0.9.0
func WithLocalPath(path string) PullOption
func WithPullModSpec ¶ added in v0.11.0
func WithPullModSpec(modSpec *downloader.ModSpec) PullOption
func WithPullSource ¶ added in v0.9.0
func WithPullSource(source *downloader.Source) PullOption
func WithPullSourceUrl ¶ added in v0.9.0
func WithPullSourceUrl(sourceUrl string) PullOption
type PullOptions ¶ added in v0.9.0
type PullOptions struct { // Source is the source of the package to be pulled. // Including git, oci, local. Source *downloader.Source // LocalPath is the local path to download the package. LocalPath string }
The PullOptions struct contains the options for pulling a package from the registry.
func NewPullOptions ¶ added in v0.9.0
func NewPullOptions(opts ...PullOption) *PullOptions
type PushOption ¶ added in v0.11.0
type PushOption func(*PushOptions) error
func WithPushModPath ¶ added in v0.11.0
func WithPushModPath(modPath string) PushOption
WithPushModPath sets the modPath for the Push method.
func WithPushSource ¶ added in v0.11.0
func WithPushSource(source downloader.Source) PushOption
WithPushSource sets the source for the Push method.
func WithPushVendorMode ¶ added in v0.11.0
func WithPushVendorMode(vendorMode bool) PushOption
WithPushVendorMode sets the vendor mode for the Push method.
type PushOptions ¶ added in v0.11.0
type PushOptions struct { // By default, the registry, repository, reference and tag are set to the default values // registry is set to the default registry `ghcr.io` in the settings // repository is set to the default repository `kcl-lang` in the settings // reference is set to the package name in `kcl.mod` // tag is set to the package version in `kcl.mod` Source downloader.Source ModPath string VendorMode bool }
PushOptions contains the options for the Push method.
type RunOption ¶ added in v0.9.1
type RunOption func(*RunOptions) error
func WithArguments ¶ added in v0.9.1
WithArguments sets the arguments for running the kcl package.
func WithCompileOnly ¶ added in v0.9.1
WithCompileOnly sets the compile only mode for running the kcl package.
func WithDisableNone ¶ added in v0.9.1
WithDisableNone sets the disable none mode for running the kcl package.
func WithExternalPkgs ¶ added in v0.9.1
WithExternalPkgs sets the external packages for running the kcl package.
func WithLogger ¶ added in v0.9.4
func WithOverrides ¶ added in v0.9.1
WithOverrides sets the overrides for running the kcl package.
func WithPathSelectors ¶ added in v0.9.1
WithPathSelectors sets the path selectors for running the kcl package.
func WithRunModSpec ¶ added in v0.11.0
func WithRunModSpec(modSpec *downloader.ModSpec) RunOption
func WithRunOptions ¶ added in v0.11.0
func WithRunOptions(runOpts *RunOptions) RunOption
Use the another RunOptions to override the current RunOptions.
func WithRunSource ¶ added in v0.9.1
func WithRunSource(source *downloader.Source) RunOption
WithRunSources sets the source for running the kcl package.
func WithRunSourceUrl ¶ added in v0.9.1
WithRunSourceUrl sets the source url for running the kcl package.
func WithRunSourceUrls ¶ added in v0.9.1
WithRunSourceUrls sets the source urls for running the kcl package.
func WithRunSources ¶ added in v0.9.1
func WithRunSources(sources []*downloader.Source) RunOption
WithRunSources sets the sources for running the kcl package.
func WithSettingFiles ¶ added in v0.9.1
WithSettingFiles sets the setting files for running the kcl package.
func WithShowHidden ¶ added in v0.9.1
WithShowHidden sets the show hidden mode for running the kcl package.
func WithSortKeys ¶ added in v0.9.1
WithSortKeys sets the sort keys for running the kcl package.
func WithStrictRange ¶ added in v0.9.1
WithStrictRange sets the strict range mode for running the kcl package.
func WithVendor ¶ added in v0.9.1
WithVendor sets the vendor mode for running the kcl package.
func WithWorkDir ¶ added in v0.9.1
WithWorkDir sets the work directory for running the kcl package.
type RunOptions ¶ added in v0.9.1
type RunOptions struct { // Sources is the sources of the package. // It can be a local *.k path, a local *.tar/*.tgz path, a local directory, a remote git/oci path,. Sources []*downloader.Source *kcl.Option // contains filtered or unexported fields }
RunOptions contains the options for running a kcl package.
type UpdateOption ¶ added in v0.10.0
type UpdateOption func(*UpdateOptions) error
func WithOffline ¶ added in v0.11.0
func WithOffline(offline bool) UpdateOption
WithOffline sets the offline option to update the package.
func WithUpdateModFile ¶ added in v0.11.0
func WithUpdateModFile(updateModFile bool) UpdateOption
WithUpdateModFile sets the flag to update the mod file.
func WithUpdatedKclPkg ¶ added in v0.10.0
func WithUpdatedKclPkg(kpkg *pkg.KclPkg) UpdateOption
WithUpdatedKclPkg sets the kcl package to be updated.
type UpdateOptions ¶ added in v0.10.0
type UpdateOptions struct {
// contains filtered or unexported fields
}
UpdateOptions is the option for updating a package. Updating a package means iterating all the dependencies of the package and updating the dependencies and selecting the version of the dependencies by MVS.