utils

package
v0.0.0-...-fe3bd91 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Logger *zap.Logger
View Source
var Verbose *zap.Logger

Functions

func CreateAndWriteConfigFile

func CreateAndWriteConfigFile() error

func CreateFilesIfNotExists

func CreateFilesIfNotExists(filenames []string) error

func DefaultConfig

func DefaultConfig() string

func EditProvider

func EditProvider(providerName string) error

func Error

func Error(errString string, err error, verbose bool) error

func GetEnabledProvider

func GetEnabledProvider(itemName, pluginKeyName, pluginType string) (providermanager.ProviderManager, error)

GetEnabledProvider checks the configuration and returns the enabled ProviderManager

func InitAPILogger

func InitAPILogger()

func InitCLILogger

func InitCLILogger()

func InitConfig

func InitConfig() error

func LogHTTPResponse

func LogHTTPResponse(verbose bool, resp *http.Response, body []byte)

func LogRequest

func LogRequest(verbose bool, method, path, payload string)

func ReadConfigPath

func ReadConfigPath() error

Types

type Config

type Config struct {
	Plugin struct {
		Postman struct {
			KeyName string `json:"keyName"`
			Type    string `json:"type"`
		} `json:"postman"`
		GCP struct {
			Type string `json:"type"`
		} `json:"gcp"`
	} `json:"plugin"`
	Provider struct {
		OP struct {
			Vault   string `json:"vault"`
			Enabled bool   `json:"enabled"`
		} `json:"op"`
		BW struct {
			Enabled bool `json:"enabled"`
		} `json:"bw"`
	} `json:"provider"`
	CLI struct {
		Logging struct {
			Level       string   `json:"level"`
			Encoding    string   `json:"encoding"`
			OutputPaths []string `json:"outputPaths"`
		} `json:"logging"`
	} `json:"cli"`
}
var (
	C Config
)

Jump to

Keyboard shortcuts

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