opt

package
v0.8.6 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 10 Imported by: 7

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
	NoSumCheck   bool
}

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

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
	Version  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'. Deprecated: This function will be deprecated, use 'SanitizePathWithSuffix' instead.

func (*OciOptions) SanitizePathWithSuffix added in v0.8.2

func (oci *OciOptions) SanitizePathWithSuffix(pathPrefix string) string

SanitizePathSuffix will take 'Registry/Repo/Tag' as a path suffix and sanitize it.

func (*OciOptions) Validate

func (opts *OciOptions) Validate() error

type Option added in v0.7.0

type Option func(*CompileOptions)

func WithEntries added in v0.4.5

func WithEntries(entries []string) Option

WithEntries will add entries to the compiler.

func WithKclOption added in v0.4.5

func WithKclOption(opt kcl.Option) Option

WithKclOption will add a kcl option to the compiler.

func WithLogWriter added in v0.7.0

func WithLogWriter(writer io.Writer) Option

WithLogWriter will set the log writer of the compiler.

func WithNoSumCheck added in v0.4.5

func WithNoSumCheck(is bool) Option

WithNoSumCheck will set the 'no_sum_check' flag.

func WithVendor added in v0.4.5

func WithVendor(isVendor bool) Option

WithEntry will add an entry to the compiler.

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