opt

package
v0.3.0 Latest Latest
Warning

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

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

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

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

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
}

Jump to

Keyboard shortcuts

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