cmd

package
v0.0.0-...-91b0819 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2021 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func GetPassword

func GetPassword(secret internal.Secret, system string) (string, error)

GetPassword - decrypt password

func GetSecretKey

func GetSecretKey() ([]byte, error)

GetSecretKey - create secret key once

func PwDecrypt

func PwDecrypt(encrypted, byteSecret []byte) (string, error)

PwDecrypt - decrypt system password

func PwEncrypt

func PwEncrypt(bytePw, byteSecret []byte) ([]byte, error)

PwEncrypt - encrypt system password

Types

type Config

type Config struct {
	Secret     []byte
	Systems    []SystemInfo // system info from toml file
	Metrics    []tomlMetric // metric info from toml file
	IntMetrics []metricInfo // adapted internal metrics

	Timeout uint
	// contains filtered or unexported fields
}

Config - information for the whole process

func (*Config) AddSecret

func (config *Config) AddSecret(systems string, pw []byte) ([]byte, error)

AddSecret - create encrypted secret for system(s)

func (*Config) FindSystem

func (config *Config) FindSystem(cmpSystem string) SystemInfo

FindSystem - check if cmpSystem already exists in configfile

func (*Config) GetSecretMap

func (config *Config) GetSecretMap() (internal.Secret, error)

GetSecretMap - unmarshal secret bytes

func (*Config) SetPw

func (config *Config) SetPw(cmd *cobra.Command) error

SetPw - save password(s) of system(s) database user to the config file

type FieldInfo

type FieldInfo struct {
	FieldLabels []string
	FieldValues []string
}

FieldInfo - specific field metric info

type StructureInfo

type StructureInfo struct {
	ExportStructure string
	StructureFields []string
}

StructureInfo - specific structure metric info

type SystemInfo

type SystemInfo struct {
	Name   string
	Usage  string
	Tags   []string
	User   string
	Lang   string
	Client string
	Server string
	Sysnr  string

	Mshost string
	Msserv string
	Group  string

	Saprouter string
}

SystemInfo - system information

type TableInfo

type TableInfo struct {
	Table     string
	RowCount  map[string][]interface{}
	RowFilter map[string][]interface{}
}

TableInfo - specific table metric info

Jump to

Keyboard shortcuts

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