runfn

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDestinationDir

func GetDestinationDir(outDir string) (string, error)

GetDestinationDir returns the destination directory, if outDir is not defined it creates a temp dir.

func NewFnRunCommand

func NewFnRunCommand(f *flags.GlobalFlags) *cobra.Command

func ValidateFunctionImageURL

func ValidateFunctionImageURL(name string) error

ValidateFunctionImageURL validates the function name. According to Docker implementation https://github.com/docker/distribution/blob/master/reference/reference.go. A valid name definition is:

name                            := [domain '/'] path-component ['/' path-component]*
domain                          := domain-component ['.' domain-component]* [':' port-number]
domain-component                := /([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])/
port-number                     := /[0-9]+/
path-component                  := alpha-numeric [separator alpha-numeric]*
alpha-numeric                   := /[a-z0-9]+/
separator                       := /[_.]|__|[-]*/

https://github.com/GoogleContainerTools/kpt/blob/b197de30601072d7b8668dd41150f398a7f415f5/pkg/api/kptfile/v1/validation.go#L120-L150

func WriteOutput

func WriteOutput(outDir string, content string) error

WriteOutput Write the resource to the output directory. If the output directory is not specified, the resource is written to stdout.

Types

type Flags

type Flags struct {
	ExportDir          string
	TransformDir       string
	Image              string
	Env                []string
	RunFns             runfn.RunFns
	TransformedContent bytes.Buffer
}

type Options

type Options struct {
	Flags
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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