Documentation ¶
Index ¶
- Constants
- type AddOptions
- type CompileOptions
- func (opts *CompileOptions) AddEntry(entry string)
- func (opts *CompileOptions) Entries() []string
- func (opts *CompileOptions) ExtendEntries(entries []string)
- func (opts *CompileOptions) HasSettingsYaml() bool
- func (opts *CompileOptions) IsVendor() bool
- func (opts *CompileOptions) PkgPath() string
- func (opts *CompileOptions) SetHasSettingsYaml(hasSettingsYaml bool)
- func (opts *CompileOptions) SetPkgPath(pkgPath string)
- func (opts *CompileOptions) SetVendor(isVendor bool)
- type GitOptions
- type InitOptions
- type LocalOptions
- type OciOptions
- type RegistryOptions
Constants ¶
const OCI_SEPARATOR = ":"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddOptions ¶
type AddOptions struct { LocalPath string RegistryOpts RegistryOptions }
func (*AddOptions) Validate ¶
func (opts *AddOptions) Validate() error
type CompileOptions ¶
CompileOptions is the input options of 'kpm run'.
func DefaultCompileOptions ¶
func DefaultCompileOptions() *CompileOptions
DefaultCompileOptions returns a default CompileOptions.
func (*CompileOptions) AddEntry ¶
func (opts *CompileOptions) AddEntry(entry string)
AddEntry will add a compile entry file to the compiler.
func (*CompileOptions) Entries ¶
func (opts *CompileOptions) Entries() []string
Entrirs will return the entries of the compiler.
func (*CompileOptions) ExtendEntries ¶
func (opts *CompileOptions) ExtendEntries(entries []string)
ExtendEntries will extend the entries of the compiler.
func (*CompileOptions) HasSettingsYaml ¶
func (opts *CompileOptions) HasSettingsYaml() bool
HasSettingsYaml will return the 'hasSettingsYaml' flag.
func (*CompileOptions) IsVendor ¶
func (opts *CompileOptions) IsVendor() bool
IsVendor will return the 'isVendor' flag.
func (*CompileOptions) PkgPath ¶
func (opts *CompileOptions) PkgPath() string
PkgPath will return the home path for a kcl package during compilation
func (*CompileOptions) SetHasSettingsYaml ¶
func (opts *CompileOptions) SetHasSettingsYaml(hasSettingsYaml bool)
SetHasSettingsYaml will set the 'hasSettingsYaml' flag.
func (*CompileOptions) SetPkgPath ¶
func (opts *CompileOptions) SetPkgPath(pkgPath string)
SetPkgPath will set the home path for a kcl package during compilation
func (*CompileOptions) SetVendor ¶
func (opts *CompileOptions) SetVendor(isVendor bool)
SetVendor will set the 'isVendor' flag.
type GitOptions ¶
func (*GitOptions) Validate ¶
func (opts *GitOptions) Validate() error
type InitOptions ¶
Input options of 'kpm init'.
func (*InitOptions) Validate ¶
func (opts *InitOptions) Validate() error
type LocalOptions ¶
type LocalOptions struct {
Path string
}
LocalOptions for local packages. kpm will find packages from local path.
func (*LocalOptions) Validate ¶
func (opts *LocalOptions) Validate() error
type OciOptions ¶
OciOptions for download oci packages. kpm will download packages from oci registry by '{Reg}/{Repo}/{PkgName}:{Tag}'.
func ParseOciOptionFromOciUrl ¶
func ParseOciOptionFromOciUrl(url, tag string) (*OciOptions, *reporter.KpmEvent)
ParseOciOptionFromOciUrl will parse oci url into an 'OciOptions'. If the 'tag' is empty, ParseOciOptionFromOciUrl will take 'latest' as the default tag.
func ParseOciOptionFromString ¶
func ParseOciOptionFromString(oci string, tag string) (*OciOptions, error)
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 ParseOciRef ¶
func ParseOciRef(ociRef string) (*OciOptions, error)
ParseOciRef will parse 'repoName:repoTag' into OciOptions, with default registry host 'docker.io'.
func ParseOciUrl ¶
func ParseOciUrl(ociUrl string) (*OciOptions, *reporter.KpmEvent)
ParseOciUrl will parse 'oci://hostName/repoName:repoTag' into OciOptions without tag.
func (*OciOptions) AddStoragePathSuffix ¶
func (oci *OciOptions) AddStoragePathSuffix(pathPrefix string) string
AddStoragePathSuffix will take 'Registry/Repo/Tag' as a path suffix. e.g. Take '/usr/test' as input, and oci options is
OciOptions { Reg: 'docker.io', Repo: 'test/testRepo', Tag: 'v0.0.1' }
You will get a path '/usr/test/docker.io/test/testRepo/v0.0.1'.
func (*OciOptions) Validate ¶
func (opts *OciOptions) Validate() error
type RegistryOptions ¶
type RegistryOptions struct { Git *GitOptions Oci *OciOptions Local *LocalOptions }