opt

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2023 License: Apache-2.0 Imports: 8 Imported by: 15

Documentation

Index

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
}

func (*AddOptions) Validate

func (opts *AddOptions) Validate() error

type CompileOptions added in v0.3.4

type CompileOptions struct {
	*kcl.Option
	// contains filtered or unexported fields
}

CompileOptions is the input options of 'kpm run'.

func DefaultCompileOptions added in v0.3.4

func DefaultCompileOptions() *CompileOptions

DefaultCompileOptions returns a default CompileOptions.

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) 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) 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

type GitOptions struct {
	Url    string
	Branch string
	Commit string
	Tag    string
}

func (*GitOptions) Validate

func (opts *GitOptions) Validate() error

type InitOptions

type InitOptions struct {
	Name     string
	InitPath string
}

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 OciManifestOptions struct {
	Annotations map[string]string
}

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
}

Jump to

Keyboard shortcuts

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