configutil

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2025 License: MIT Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package configutil provides utilities for working with configuration files in the opampctl tool.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyCmdFlags added in v0.1.10

func ApplyCmdFlags(globalConfig *config.GlobalConfig, cmd *cobra.Command) (*config.GlobalConfig, error)

ApplyCmdFlags applies the command flags to the global configuration and returns the updated configuration.

func CreateGlobalConfigFlags added in v0.1.10

func CreateGlobalConfigFlags(flags *pflag.FlagSet)

CreateGlobalConfigFlags creates flags for the global configuration.

func GetCurrentCacheDir

func GetCurrentCacheDir(config *config.GlobalConfig) string

GetCurrentCacheDir retrieves the current cacheDir based on the current user from the global configuration.

func GetCurrentCluster

func GetCurrentCluster(config *config.GlobalConfig) *config.Cluster

GetCurrentCluster retrieves the current cluster based on the current context from the global configuration.

func GetCurrentContext

func GetCurrentContext(config *config.GlobalConfig) *config.Context

GetCurrentContext retrieves the current context from the global configuration.

func GetCurrentOpAMPCommanderEndpoint

func GetCurrentOpAMPCommanderEndpoint(config *config.GlobalConfig) string

GetCurrentOpAMPCommanderEndpoint retrieves the OpAMP Commander endpoint for the current cluster from the global configuration.

func GetCurrentUser

func GetCurrentUser(config *config.GlobalConfig) *config.User

GetCurrentUser retrieves the current user based on the current context from the global configuration.

func GetLogger added in v0.1.10

func GetLogger(config *config.GlobalConfig) *slog.Logger

GetLogger creates a new logger for the opampctl tool. It uses the default slog logger. In future, improve a logger: https://github.com/minuk-dev/opampcommander/issues/53

Types

This section is empty.

Jump to

Keyboard shortcuts

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