configutil

package
v0.1.23 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2025 License: MIT Imports: 6 Imported by: 0

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