opt

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
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

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

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

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

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

type OciOptions struct {
	Reg     string
	Repo    string
	Tag     string
	PkgName 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 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
}

Jump to

Keyboard shortcuts

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