config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package config contains common configuration values that are used by the various commands and subcommands in the CLI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HTTPClientForProxy added in v0.0.76

func HTTPClientForProxy(proxyConfig ProxyConfig) (*awshttp.BuildableClient, error)

HTTPClientForProxy creates an AWS buildable HTTP client configured for HTTP(S) or SOCKS5 proxies. If both proxy types are set, SOCKS5 takes precedence.

func InitializeLogging

func InitializeLogging(cmd *cobra.Command, rootFlags *RootFlags) svc1log.Logger

InitializeLogging initializes the logging configuration for the CLI. It sets the log level based on the verbose and quiet flags provided by the user. If the quiet flag is set, the logger is set to discard all logs. If the verbose flag is set, the log level is set to debug. Otherwise, the log level is set to info. The logger is then returned for use by caller. We are using Palantir's Witchcraft logging library to structure our logging output.

func SetProxyConfig added in v0.0.76

func SetProxyConfig(ctx context.Context, proxyConfig ProxyConfig) context.Context

SetProxyConfig stores proxy settings on the command context for paths that create their own AWS config later in execution.

Types

type AWSLoadOption added in v0.0.76

type AWSLoadOption = func(*awsconfig.LoadOptions) error

func AWSLoadOptionsForProxy added in v0.0.76

func AWSLoadOptionsForProxy(proxyConfig ProxyConfig) ([]AWSLoadOption, error)

AWSLoadOptionsForProxy returns AWS SDK config load options for proxy settings.

func AWSLoadOptionsFromContext added in v0.0.76

func AWSLoadOptionsFromContext(ctx context.Context) ([]AWSLoadOption, error)

AWSLoadOptionsFromContext returns AWS SDK config load options from context.

type ProxyConfig added in v0.0.76

type ProxyConfig struct {
	HTTPProxy  string
	SOCKSProxy string
}

ProxyConfig captures global proxy settings for AWS SDK HTTP traffic.

func ProxyConfigFromContext added in v0.0.76

func ProxyConfigFromContext(ctx context.Context) ProxyConfig

ProxyConfigFromContext returns proxy settings from context, if present.

type RootFlags

type RootFlags struct {
	Quiet      bool
	Verbose    bool
	Regions    []string
	HTTPProxy  string
	SOCKSProxy string
}

Jump to

Keyboard shortcuts

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