cli

package
v0.8.7-196-g44c8237a Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2024 License: BSD-3-Clause Imports: 13 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.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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