cli

package
v0.6.4-102-ga3462b7 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Overview

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors. Licensed under the BSD-3-Clause License (the "License"). You may not use this file except in compliance with the License.

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors. Licensed under the BSD-3-Clause License (the "License"). You may not use this file except in compliance with the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterTargets added in v0.5.1

func FilterTargets(targets []target.Target, arch, plat, targ string) []target.Target

FilterTargets returns a subset of `targets` based in input strings `arch`, `plat` and/or `targ`

func SelectTarget added in v0.5.1

func SelectTarget(targets []target.Target) (target.Target, error)

SelectTarget is a utility method used in a CLI context to prompt the user for a specific application's target.

Types

type CliOption

type CliOption func(*CliOptions) error

func WithDefaultConfigManager

func WithDefaultConfigManager(cmd *cobra.Command) CliOption

WithDefaultConfigManager instantiates a configuration manager based on default options.

func WithDefaultHTTPClient

func WithDefaultHTTPClient() CliOption

WithDefaultHTTPClient initializes a HTTP client using host-provided configuration.

func WithDefaultIOStreams

func WithDefaultIOStreams() CliOption

WithDefaultIOStreams instantiates ta new IO streams using environmental variables and host-provided configuration.

func WithDefaultLogger

func WithDefaultLogger() CliOption

WithDefaultLogger sets up the built in logger based on provided conifg found from the ConfigManager.

func WithDefaultPluginManager

func WithDefaultPluginManager() CliOption

WithDefaultPluginManager returns an initialized plugin manager using the host-provided configuration plugin path.

func WithHTTPClient

func WithHTTPClient(httpClient *http.Client) CliOption

WithHTTPClient sets a previously instantiated http.Client to be used within the command.

type CliOptions

type CliOptions struct {
	IOStreams      *iostreams.IOStreams
	Logger         *logrus.Logger
	ConfigManager  *config.ConfigManager[config.KraftKit]
	PackageManager packmanager.PackageManager
	PluginManager  *plugins.PluginManager
	HTTPClient     *http.Client
}

Jump to

Keyboard shortcuts

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