factory

package
v0.1.0-beta.4 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Copyright © 2021 Loft Orbital

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendPreRun

func AppendPreRun(cmd *cobra.Command, prerun func(cmd *cobra.Command, args []string))

AppendPreRun appends a prerun function to cmd.

func BuildAware

func BuildAware(cmd *cobra.Command)

BuildAware marks a command as aware of build options. It adds the required flags and PreRunE function to the command.

func BuildContextAware

func BuildContextAware(cmd *cobra.Command)

BuildContextAware marks a command as aware of a build Context. It adds an args validation and the required PreRunE function.

func GetBuildContext

func GetBuildContext(cmd *cobra.Command) *buildctx.Context

GetBuildContext returns the build Context of a command. It panics if it's not set You must use BuildContextAware to make sure your command is Context aware.

func GetMetaOptions

func GetMetaOptions(cmd *cobra.Command) utils.CommonMetaOptions

GetMetaOptions returns the CommonMetaOptions of a command. It panics if it's not set You must use MetaOptionsAware to make sure your command is properly configured.

func MetaOptionsAware

func MetaOptionsAware(cmd *cobra.Command)

MetaOptionsAware marks a command as aware of a meta options. It adds proper flags and the required PreRun function.

Types

type BuildOpt

type BuildOpt struct {
	// Expressions are the expressions to extract manifest from.
	Expressions []string
	// Tags are a list of key value used as CUE tags.
	Tags []string
}

func GetBuildOpt

func GetBuildOpt(cmd *cobra.Command) *BuildOpt

GetBuildOpt returns the BuildOpt of a command. It panics if it hasn't been parsed previously. You must use BuildAware to make sure your command is build aware.

Jump to

Keyboard shortcuts

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