Documentation ¶
Index ¶
- 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) LogWriter() io.Writer
- func (opts *CompileOptions) NoSumCheck() bool
- func (opts *CompileOptions) PkgPath() string
- func (opts *CompileOptions) SetEntries(entries []string)
- func (opts *CompileOptions) SetHasSettingsYaml(hasSettingsYaml bool)
- func (opts *CompileOptions) SetLogWriter(writer io.Writer)
- func (opts *CompileOptions) SetNoSumCheck(noSumCheck bool)
- func (opts *CompileOptions) SetPkgPath(pkgPath string)
- func (opts *CompileOptions) SetVendor(isVendor bool)
- type GitOptions
- type InitOptions
- type LocalOptions
- type OciFetchOptions
- type OciManifestOptions
- type OciOptions
- type RegistryOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddOptions ¶
type AddOptions struct { LocalPath string RegistryOpts RegistryOptions NoSumCheck bool }
func (*AddOptions) Validate ¶
func (opts *AddOptions) Validate() error
type CompileOptions ¶ added in v0.3.4
CompileOptions is the input options of 'kpm run'.
func DefaultCompileOptions ¶ added in v0.3.4
func DefaultCompileOptions() *CompileOptions
DefaultCompileOptions returns a default CompileOptions.
func MergeOptions ¶ added in v0.4.5
func MergeOptions(opts ...CompileOptions) CompileOptions
MergeOptions will merge the input options.
func WithEntries ¶ added in v0.4.5
func WithEntries(entries []string) CompileOptions
WithEntries will add entries to the compiler.
func WithKclOption ¶ added in v0.4.5
func WithKclOption(opt kcl.Option) CompileOptions
WithKclOption will add a kcl option to the compiler.
func WithNoSumCheck ¶ added in v0.4.5
func WithNoSumCheck(is bool) CompileOptions
WithNoSumCheck will set the 'no_sum_check' flag.
func WithVendor ¶ added in v0.4.5
func WithVendor(isVendor bool) CompileOptions
WithEntry will add an entry to the compiler.
func (*CompileOptions) AddEntry ¶ added in v0.3.4
func (opts *CompileOptions) AddEntry(entry string)
AddEntry will add a compile entry file to the compiler.
func (*CompileOptions) Entries ¶ added in v0.3.4
func (opts *CompileOptions) Entries() []string
Entrirs will return the entries of the compiler.
func (*CompileOptions) ExtendEntries ¶ added in v0.3.4
func (opts *CompileOptions) ExtendEntries(entries []string)
ExtendEntries will extend the entries of the compiler.
func (*CompileOptions) HasSettingsYaml ¶ added in v0.3.4
func (opts *CompileOptions) HasSettingsYaml() bool
HasSettingsYaml will return the 'hasSettingsYaml' flag.
func (*CompileOptions) IsVendor ¶ added in v0.3.4
func (opts *CompileOptions) IsVendor() bool
IsVendor will return the 'isVendor' flag.
func (*CompileOptions) LogWriter ¶ added in v0.3.7
func (opts *CompileOptions) LogWriter() io.Writer
LogWriter will return the log writer of the compiler.
func (*CompileOptions) NoSumCheck ¶ added in v0.4.4
func (opts *CompileOptions) NoSumCheck() bool
NoSumCheck will return the 'no_sum_check' flag.
func (*CompileOptions) PkgPath ¶ added in v0.3.4
func (opts *CompileOptions) PkgPath() string
PkgPath will return the home path for a kcl package during compilation
func (*CompileOptions) SetEntries ¶ added in v0.4.0
func (opts *CompileOptions) SetEntries(entries []string)
SetEntries will set the entries of the compiler.
func (*CompileOptions) SetHasSettingsYaml ¶ added in v0.3.4
func (opts *CompileOptions) SetHasSettingsYaml(hasSettingsYaml bool)
SetHasSettingsYaml will set the 'hasSettingsYaml' flag.
func (*CompileOptions) SetLogWriter ¶ added in v0.3.7
func (opts *CompileOptions) SetLogWriter(writer io.Writer)
SetLogWriter will set the log writer of the compiler.
func (*CompileOptions) SetNoSumCheck ¶ added in v0.4.4
func (opts *CompileOptions) SetNoSumCheck(noSumCheck bool)
SetNoSumCheck will set the 'no_sum_check' flag.
func (*CompileOptions) SetPkgPath ¶ added in v0.3.4
func (opts *CompileOptions) SetPkgPath(pkgPath string)
SetPkgPath will set the home path for a kcl package during compilation
func (*CompileOptions) SetVendor ¶ added in v0.3.4
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 ¶ added in v0.3.3
type LocalOptions struct {
Path string
}
LocalOptions for local packages. kpm will find packages from local path.
func (*LocalOptions) Validate ¶ added in v0.3.3
func (opts *LocalOptions) Validate() error
type OciFetchOptions ¶ added in v0.3.7
type OciFetchOptions struct { oras.FetchBytesOptions OciOptions }
OciFetchOptions is the input options of the api to fetch oci manifest.
type OciManifestOptions ¶ added in v0.3.7
type OciOptions ¶
type OciOptions struct { Reg string Repo string Tag string PkgName string Annotations map[string]string }
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 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 }