Documentation
¶
Index ¶
- Constants
- Variables
- func CompleteBuilderImageList(cmd *cobra.Command, args []string, complete string) (builderImages []string, directive cobra.ShellCompDirective)
- func CompleteBuilderList(cmd *cobra.Command, args []string, complete string) (matches []string, d cobra.ShellCompDirective)
- func CompleteFunctionList(cmd *cobra.Command, args []string, toComplete string) (strings []string, directive cobra.ShellCompDirective)
- func CompleteOutputFormatList(cmd *cobra.Command, args []string, toComplete string) (strings []string, directive cobra.ShellCompDirective)
- func CompleteRegistryList(cmd *cobra.Command, args []string, toComplete string) (strings []string, directive cobra.ShellCompDirective)
- func CompleteRuntimeList(cmd *cobra.Command, args []string, toComplete string, client *fn.Client) (matches []string, directive cobra.ShellCompDirective)
- func CompleteTemplateList(cmd *cobra.Command, args []string, toComplete string, client *fn.Client) (matches []string, directive cobra.ShellCompDirective)
- func KnownBuilders() builders.Known
- func NewBuildCmd(newClient ClientFactory) *cobra.Command
- func NewClient(cfg ClientConfig, options ...fn.Option) (*fn.Client, func())
- func NewCompletionCmd() *cobra.Command
- func NewConfigCmd(loadSaver functionLoaderSaver, newClient ClientFactory) *cobra.Command
- func NewConfigEnvsAddCmd(loadSaver functionLoaderSaver) *cobra.Command
- func NewConfigEnvsCmd(loadSaver functionLoaderSaver) *cobra.Command
- func NewConfigEnvsRemoveCmd() *cobra.Command
- func NewConfigGitCmd(newClient ClientFactory) *cobra.Command
- func NewConfigGitRemoveCmd(newClient ClientFactory) *cobra.Command
- func NewConfigGitSetCmd(newClient ClientFactory) *cobra.Command
- func NewConfigLabelsCmd(loaderSaver functionLoaderSaver) *cobra.Command
- func NewConfigVolumesAddCmd() *cobra.Command
- func NewConfigVolumesCmd() *cobra.Command
- func NewConfigVolumesRemoveCmd() *cobra.Command
- func NewCreateCmd(newClient ClientFactory) *cobra.Command
- func NewDeleteCmd(newClient ClientFactory) *cobra.Command
- func NewDeployCmd(newClient ClientFactory) *cobra.Command
- func NewDescribeCmd(newClient ClientFactory) *cobra.Command
- func NewEnvironmentCmd(newClient ClientFactory, version *Version) *cobra.Command
- func NewInvokeCmd(newClient ClientFactory) *cobra.Command
- func NewLanguagesCmd(newClient ClientFactory) *cobra.Command
- func NewListCmd(newClient ClientFactory) *cobra.Command
- func NewRegistryValidator(path string) survey.Validator
- func NewRepositoryAddCmd(newClient ClientFactory) *cobra.Command
- func NewRepositoryCmd(newClient ClientFactory) *cobra.Command
- func NewRepositoryListCmd(newClient ClientFactory) *cobra.Command
- func NewRepositoryRemoveCmd(newClient ClientFactory) *cobra.Command
- func NewRepositoryRenameCmd(newClient ClientFactory) *cobra.Command
- func NewRootCmd(cfg RootCommandConfig) *cobra.Command
- func NewRunCmd(newClient ClientFactory) *cobra.Command
- func NewSubscribeCmd() *cobra.Command
- func NewTektonClusterTasksCmd() *cobra.Command
- func NewTemplatesCmd(newClient ClientFactory) *cobra.Command
- func NewVersionCmd(version Version) *cobra.Command
- func RuntimeTemplateOptions(client *fn.Client) (string, error)
- func ValidateBuilder(name string) (err error)
- type ClientConfig
- type ClientFactory
- type Environment
- type ErrInvalidRuntime
- type ErrInvalidTemplate
- type ErrNoRuntime
- type Format
- type Formatter
- type RootCommandConfig
- type Version
Constants ¶
const ( Human Format = "human" // Headers, indentation, justification etc. Plain = "plain" // Suitable for cli automation via sed/awk etc. JSON = "json" // Technically a ⊆ yaml, but no one likes yaml. XML = "xml" YAML = "yaml" URL = "url" )
const DefaultNamespace = "default"
DefaultNamespace is the global static default namespace, and is equivalent to the Kubernetes default namespace.
const DefaultVersion = "v0.0.0+source"
DefaultVersion when building source directly (bypassing the Makefile)
Variables ¶
var ErrTemplateRepoDoesNotExist = errors.New("template repo does not exist")
ErrTemplateRepoDoesNotExist is a sentinel error if a template repository responds with 404 status code
Functions ¶
func CompleteBuilderList ¶
func CompleteFunctionList ¶
func CompleteRegistryList ¶
func CompleteRuntimeList ¶
func CompleteTemplateList ¶
func KnownBuilders ¶
KnownBuilders are a typed string slice of builder short names which this CLI understands. Includes a customized String() representation intended for use in flags and help text.
func NewBuildCmd ¶
func NewBuildCmd(newClient ClientFactory) *cobra.Command
func NewClient ¶
func NewClient(cfg ClientConfig, options ...fn.Option) (*fn.Client, func())
NewClient constructs an fn.Client with the majority of the concrete implementations set. Provide additional Options to this constructor to override or augment as needed, or override the ClientFactory passed to commands entirely to mock for testing. Note the returned cleanup function. 'Namespace' is optional. If not provided (see DefaultNamespace commentary), the currently configured is used. 'Verbose' indicates the system should write out a higher amount of logging.
func NewCompletionCmd ¶
func NewConfigCmd ¶
func NewConfigCmd(loadSaver functionLoaderSaver, newClient ClientFactory) *cobra.Command
func NewConfigEnvsAddCmd ¶
func NewConfigEnvsCmd ¶
func NewConfigEnvsRemoveCmd ¶
func NewConfigGitCmd ¶ added in v0.37.0
func NewConfigGitCmd(newClient ClientFactory) *cobra.Command
func NewConfigGitRemoveCmd ¶ added in v0.37.0
func NewConfigGitRemoveCmd(newClient ClientFactory) *cobra.Command
func NewConfigGitSetCmd ¶ added in v0.37.0
func NewConfigGitSetCmd(newClient ClientFactory) *cobra.Command
func NewConfigLabelsCmd ¶
func NewConfigVolumesAddCmd ¶
func NewConfigVolumesCmd ¶
func NewCreateCmd ¶
func NewCreateCmd(newClient ClientFactory) *cobra.Command
NewCreateCmd creates a create command using the given client creator.
func NewDeleteCmd ¶
func NewDeleteCmd(newClient ClientFactory) *cobra.Command
func NewDeployCmd ¶
func NewDeployCmd(newClient ClientFactory) *cobra.Command
func NewDescribeCmd ¶ added in v0.36.0
func NewDescribeCmd(newClient ClientFactory) *cobra.Command
func NewEnvironmentCmd ¶ added in v0.37.1
func NewEnvironmentCmd(newClient ClientFactory, version *Version) *cobra.Command
func NewInvokeCmd ¶
func NewInvokeCmd(newClient ClientFactory) *cobra.Command
func NewLanguagesCmd ¶
func NewLanguagesCmd(newClient ClientFactory) *cobra.Command
func NewListCmd ¶
func NewListCmd(newClient ClientFactory) *cobra.Command
func NewRegistryValidator ¶
func NewRegistryValidator(path string) survey.Validator
func NewRepositoryAddCmd ¶
func NewRepositoryAddCmd(newClient ClientFactory) *cobra.Command
func NewRepositoryCmd ¶
func NewRepositoryCmd(newClient ClientFactory) *cobra.Command
func NewRepositoryListCmd ¶
func NewRepositoryListCmd(newClient ClientFactory) *cobra.Command
func NewRepositoryRemoveCmd ¶
func NewRepositoryRemoveCmd(newClient ClientFactory) *cobra.Command
func NewRepositoryRenameCmd ¶
func NewRepositoryRenameCmd(newClient ClientFactory) *cobra.Command
func NewRootCmd ¶
func NewRootCmd(cfg RootCommandConfig) *cobra.Command
NewRootCmd creates the root of the command tree defines the command name, description, globally available flags, etc. It has no action of its own, such that running the resultant binary with no arguments prints the help/usage text.
func NewRunCmd ¶
func NewRunCmd(newClient ClientFactory) *cobra.Command
func NewSubscribeCmd ¶ added in v0.40.0
func NewTektonClusterTasksCmd ¶ added in v0.42.0
func NewTemplatesCmd ¶
func NewTemplatesCmd(newClient ClientFactory) *cobra.Command
func NewVersionCmd ¶
func RuntimeTemplateOptions ¶
RuntimeTemplateOptions is a human-friendly table of valid Language Runtime to Template combinations. Exported for use in docs.
func ValidateBuilder ¶
ValidateBuilder ensures that the given builder is one that the CLI knows how to instantiate, returning a builkder.ErrUnknownBuilder otherwise.
Types ¶
type ClientConfig ¶
type ClientConfig struct { // Verbose logging. By default, logging output is kept to the bare minimum. // Use this flag to configure verbose logging throughout. Verbose bool // Allow insecure server connections when using SSL InsecureSkipVerify bool }
ClientConfig settings for use with NewClient These are the minimum settings necessary to create the default client instance which has most subsystems initialized.
type ClientFactory ¶
type ClientFactory func(ClientConfig, ...fn.Option) (*fn.Client, func())
ClientFactory defines a constructor which assists in the creation of a Client for use by commands. See the NewClient constructor which is the fully populated ClientFactory used by commands by default. See NewClientFactory which constructs a minimal ClientFactory for use during testing.
func NewTestClient ¶ added in v0.36.0
func NewTestClient(options ...fn.Option) ClientFactory
NewTestClient returns a client factory which will ignore options used, instead using those provided when creating the factory. This allows for tests to create an entirely default client but with N mocks.
type Environment ¶ added in v0.37.1
type Environment struct { Version string GitRevision string SpecVersion string SocatImage string TarImage string Languages []string DefaultImageBuilders map[string]map[string]string Templates map[string][]string Environment []string Cluster string Defaults config.Global Function *functions.Function `json:",omitempty" yaml:",omitempty"` Instance *functions.Instance `json:",omitempty" yaml:",omitempty"` }
type ErrInvalidRuntime ¶
type ErrInvalidRuntime error
ErrInvalidRuntime indicates that the passed language runtime was invalid.
type ErrInvalidTemplate ¶
type ErrInvalidTemplate error
ErrInvalidTemplate indicates that the passed template was invalid.
type ErrNoRuntime ¶
type ErrNoRuntime error
ErrNoRuntime indicates that the language runtime flag was not passed.
type Formatter ¶
type Formatter interface { Human(io.Writer) error Plain(io.Writer) error JSON(io.Writer) error XML(io.Writer) error YAML(io.Writer) error URL(io.Writer) error }
formatter is any structure which has methods for serialization.
type RootCommandConfig ¶
type RootCommandConfig struct { Name string // usually `func` or `kn func` Version NewClient ClientFactory }
type Version ¶
type Version struct { // Version tag of the git commit, or 'tip' if no tag. Vers string // Kver is the version of knative in which func was most recently // If the build is not tagged as being released with a specific Knative // build, this is the most recent version of knative along with a suffix // consisting of the number of commits which have been added since it was // included in Knative. Kver string // Hash of the currently active git commit on build. Hash string // Verbose printing enabled for the string representation. Verbose bool }
Version information populated on build.
func (Version) StringVerbose ¶
StringVerbose returns the version along with extended version metadata.
Source Files
¶
- build.go
- client.go
- completion.go
- completion_util.go
- config.go
- config_envs.go
- config_git.go
- config_git_remove.go
- config_git_set.go
- config_labels.go
- config_volumes.go
- create.go
- delete.go
- deploy.go
- describe.go
- environment.go
- format.go
- invoke.go
- languages.go
- list.go
- repository.go
- root.go
- run.go
- subscribe.go
- templates.go
- tkn_tasks.go
- version.go