Documentation ¶
Index ¶
- Variables
- func ExpandOSPaths(paths []string) ([]string, error)
- func SanitizeArrayFlagValue(ls []string) []string
- type Config
- func (c *Config) CreateGASGetRequest() (*gnmi.GetRequest, error)
- func (c *Config) CreateGASSetRequest(input interface{}) (*gnmi.SetRequest, error)
- func (c *Config) CreateGetRequest() (*gnmi.GetRequest, error)
- func (c *Config) CreateSetRequest(targetName string) (*gnmi.SetRequest, error)
- func (c *Config) CreateSetRequestFromFile(targetName string) (*gnmi.SetRequest, error)
- func (c *Config) GetClustering() error
- func (c *Config) GetEventProcessors() (map[string]map[string]interface{}, error)
- func (c *Config) GetInputs() (map[string]map[string]interface{}, error)
- func (c *Config) GetLoader() (map[string]interface{}, error)
- func (c *Config) GetOutputs() (map[string]map[string]interface{}, error)
- func (c *Config) GetOutputsConfigs() [][]string
- func (c *Config) GetOutputsSuggestions() []outputSuggestion
- func (c *Config) GetSubscriptions(cmd *cobra.Command) (map[string]*collector.SubscriptionConfig, error)
- func (c *Config) GetSubscriptionsFromFile() []*collector.SubscriptionConfig
- func (c *Config) GetTargets() (map[string]*collector.TargetConfig, error)
- func (c *Config) Load() error
- func (c *Config) LogFlags() int
- func (c *Config) LogOutput() io.Writer
- func (c *Config) ReadSetRequestTemplate() error
- func (c *Config) SetLocalFlagsFromFile(cmd *cobra.Command)
- func (c *Config) SetLogger()
- func (c *Config) SetPersistantFlagsFromFile(cmd *cobra.Command)
- func (c *Config) SetTargetConfigDefaults(tc *collector.TargetConfig) error
- func (c *Config) TargetsList() []*collector.TargetConfig
- func (c *Config) ValidateSetInput() error
- type GlobalFlags
- type LocalFlags
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoTargetsFound = errors.New("no targets found")
View Source
var ValueTypes = []string{"json", "json_ietf", "string", "int", "uint", "bool", "decimal", "float", "bytes", "ascii"}
Functions ¶
func ExpandOSPaths ¶ added in v0.8.0
func SanitizeArrayFlagValue ¶
SanitizeArrayFlagValue trims trailing and leading brackets ([]), from each of ls elements only if both are present.
Types ¶
type Config ¶
type Config struct { GlobalFlags `mapstructure:",squash"` LocalFlags `mapstructure:",squash"` FileConfig *viper.Viper `mapstructure:"-" json:"-" yaml:"-" ` Targets map[string]*collector.TargetConfig `mapstructure:"targets,omitempty" json:"targets,omitempty" yaml:"targets,omitempty"` Subscriptions map[string]*collector.SubscriptionConfig `mapstructure:"subscriptions,omitempty" json:"subscriptions,omitempty" yaml:"subscriptions,omitempty"` Outputs map[string]map[string]interface{} `mapstructure:"outputs,omitempty" json:"outputs,omitempty" yaml:"outputs,omitempty"` Inputs map[string]map[string]interface{} `mapstructure:"inputs,omitempty" json:"inputs,omitempty" yaml:"inputs,omitempty"` Processors map[string]map[string]interface{} `mapstructure:"processors,omitempty" json:"processors,omitempty" yaml:"processors,omitempty"` Clustering *clustering `mapstructure:"clustering,omitempty" json:"clustering,omitempty" yaml:"clustering,omitempty"` // contains filtered or unexported fields }
func (*Config) CreateGASGetRequest ¶ added in v0.10.0
func (c *Config) CreateGASGetRequest() (*gnmi.GetRequest, error)
func (*Config) CreateGASSetRequest ¶ added in v0.10.0
func (c *Config) CreateGASSetRequest(input interface{}) (*gnmi.SetRequest, error)
func (*Config) CreateGetRequest ¶
func (c *Config) CreateGetRequest() (*gnmi.GetRequest, error)
func (*Config) CreateSetRequest ¶
func (c *Config) CreateSetRequest(targetName string) (*gnmi.SetRequest, error)
func (*Config) CreateSetRequestFromFile ¶ added in v0.12.0
func (c *Config) CreateSetRequestFromFile(targetName string) (*gnmi.SetRequest, error)
func (*Config) GetClustering ¶ added in v0.8.0
func (*Config) GetEventProcessors ¶
func (*Config) GetOutputs ¶
func (*Config) GetOutputsConfigs ¶
func (*Config) GetOutputsSuggestions ¶
func (c *Config) GetOutputsSuggestions() []outputSuggestion
func (*Config) GetSubscriptions ¶
func (*Config) GetSubscriptionsFromFile ¶
func (c *Config) GetSubscriptionsFromFile() []*collector.SubscriptionConfig
func (*Config) GetTargets ¶
func (c *Config) GetTargets() (map[string]*collector.TargetConfig, error)
func (*Config) ReadSetRequestTemplate ¶ added in v0.12.0
func (*Config) SetLocalFlagsFromFile ¶
func (*Config) SetPersistantFlagsFromFile ¶
func (*Config) SetTargetConfigDefaults ¶ added in v0.9.0
func (c *Config) SetTargetConfigDefaults(tc *collector.TargetConfig) error
func (*Config) TargetsList ¶
func (c *Config) TargetsList() []*collector.TargetConfig
func (*Config) ValidateSetInput ¶
type GlobalFlags ¶
type GlobalFlags struct { CfgFile string Address []string `mapstructure:"address,omitempty" json:"address,omitempty" yaml:"address,omitempty"` Username string `mapstructure:"username,omitempty" json:"username,omitempty" yaml:"username,omitempty"` Password string `mapstructure:"password,omitempty" json:"password,omitempty" yaml:"password,omitempty"` Port string `mapstructure:"port,omitempty" json:"port,omitempty" yaml:"port,omitempty"` Encoding string `mapstructure:"encoding,omitempty" json:"encoding,omitempty" yaml:"encoding,omitempty"` Insecure bool `mapstructure:"insecure,omitempty" json:"insecure,omitempty" yaml:"insecure,omitempty"` TLSCa string `mapstructure:"tls-ca,omitempty" json:"tls-ca,omitempty" yaml:"tls-ca,omitempty"` TLSCert string `mapstructure:"tls-cert,omitempty" json:"tls-cert,omitempty" yaml:"tls-cert,omitempty"` TLSKey string `mapstructure:"tls-key,omitempty" json:"tls-key,omitempty" yaml:"tls-key,omitempty"` TLSMinVersion string `mapstructure:"tls-min-version,omitempty" json:"tls-min-version,omitempty" yaml:"tls-min-version,omitempty"` TLSMaxVersion string `mapstructure:"tls-max-version,omitempty" json:"tls-max-version,omitempty" yaml:"tls-max-version,omitempty"` TLSVersion string `mapstructure:"tls-version,omitempty" json:"tls-version,omitempty" yaml:"tls-version,omitempty"` Timeout time.Duration `mapstructure:"timeout,omitempty" json:"timeout,omitempty" yaml:"timeout,omitempty"` Debug bool `mapstructure:"debug,omitempty" json:"debug,omitempty" yaml:"debug,omitempty"` SkipVerify bool `mapstructure:"skip-verify,omitempty" json:"skip-verify,omitempty" yaml:"skip-verify,omitempty"` NoPrefix bool `mapstructure:"no-prefix,omitempty" json:"no-prefix,omitempty" yaml:"no-prefix,omitempty"` ProxyFromEnv bool `mapstructure:"proxy-from-env,omitempty" json:"proxy-from-env,omitempty" yaml:"proxy-from-env,omitempty"` Format string `mapstructure:"format,omitempty" json:"format,omitempty" yaml:"format,omitempty"` LogFile string `mapstructure:"log-file,omitempty" json:"log-file,omitempty" yaml:"log-file,omitempty"` Log bool `mapstructure:"log,omitempty" json:"log,omitempty" yaml:"log,omitempty"` MaxMsgSize int `mapstructure:"max-msg-size,omitempty" json:"max-msg-size,omitempty" yaml:"max-msg-size,omitempty"` PrometheusAddress string `mapstructure:"prometheus-address,omitempty" json:"prometheus-address,omitempty" yaml:"prometheus-address,omitempty"` PrintRequest bool `mapstructure:"print-request,omitempty" json:"print-request,omitempty" yaml:"print-request,omitempty"` Retry time.Duration `mapstructure:"retry,omitempty" json:"retry,omitempty" yaml:"retry,omitempty"` TargetBufferSize uint `mapstructure:"target-buffer-size,omitempty" json:"target-buffer-size,omitempty" yaml:"target-buffer-size,omitempty"` ClusterName string `mapstructure:"cluster-name,omitempty" json:"cluster-name,omitempty" yaml:"cluster-name,omitempty"` InstanceName string `mapstructure:"instance-name,omitempty" json:"instance-name,omitempty" yaml:"instance-name,omitempty"` API string `mapstructure:"api,omitempty" json:"api,omitempty" yaml:"api,omitempty"` ProtoFile []string `mapstructure:"proto-file,omitempty" json:"proto-file,omitempty" yaml:"proto-file,omitempty"` ProtoDir []string `mapstructure:"proto-dir,omitempty" json:"proto-dir,omitempty" yaml:"proto-dir,omitempty"` TargetsFile string `mapstructure:"targets-file,omitempty" json:"targets-file,omitempty" yaml:"targets-file,omitempty"` Gzip bool `mapstructure:"gzip,omitempty" json:"gzip,omitempty" yaml:"gzip,omitempty"` }
type LocalFlags ¶
type LocalFlags struct { // Capabilities CapabilitiesVersion bool `mapstructure:"capabilities-version,omitempty" json:"capabilities-version,omitempty" yaml:"capabilities-version,omitempty"` // Get GetPath []string `mapstructure:"get-path,omitempty" json:"get-path,omitempty" yaml:"get-path,omitempty"` GetPrefix string `mapstructure:"get-prefix,omitempty" json:"get-prefix,omitempty" yaml:"get-prefix,omitempty"` GetModel []string `mapstructure:"get-model,omitempty" json:"get-model,omitempty" yaml:"get-model,omitempty"` GetType string `mapstructure:"get-type,omitempty" json:"get-type,omitempty" yaml:"get-type,omitempty"` GetTarget string `mapstructure:"get-target,omitempty" json:"get-target,omitempty" yaml:"get-target,omitempty"` // Set SetPrefix string `mapstructure:"set-prefix,omitempty" json:"set-prefix,omitempty" yaml:"set-prefix,omitempty"` SetDelete []string `mapstructure:"set-delete,omitempty" json:"set-delete,omitempty" yaml:"set-delete,omitempty"` SetReplace []string `mapstructure:"set-replace,omitempty" json:"set-replace,omitempty" yaml:"set-replace,omitempty"` SetUpdate []string `mapstructure:"set-update,omitempty" json:"set-update,omitempty" yaml:"set-update,omitempty"` SetReplacePath []string `mapstructure:"set-replace-path,omitempty" json:"set-replace-path,omitempty" yaml:"set-replace-path,omitempty"` SetUpdatePath []string `mapstructure:"set-update-path,omitempty" json:"set-update-path,omitempty" yaml:"set-update-path,omitempty"` SetReplaceFile []string `mapstructure:"set-replace-file,omitempty" json:"set-replace-file,omitempty" yaml:"set-replace-file,omitempty"` SetUpdateFile []string `mapstructure:"set-update-file,omitempty" json:"set-update-file,omitempty" yaml:"set-update-file,omitempty"` SetReplaceValue []string `mapstructure:"set-replace-value,omitempty" json:"set-replace-value,omitempty" yaml:"set-replace-value,omitempty"` SetUpdateValue []string `mapstructure:"set-update-value,omitempty" json:"set-update-value,omitempty" yaml:"set-update-value,omitempty"` SetDelimiter string `mapstructure:"set-delimiter,omitempty" json:"set-delimiter,omitempty" yaml:"set-delimiter,omitempty"` SetTarget string `mapstructure:"set-target,omitempty" json:"set-target,omitempty" yaml:"set-target,omitempty"` SetRequestFile string `mapstructure:"set-request-file,omitempty" json:"set-request-file,omitempty" yaml:"set-request-file,omitempty"` SetRequestVars string `mapstructure:"set-request-vars,omitempty" json:"set-request-vars,omitempty" yaml:"set-request-vars,omitempty"` // Sub SubscribePrefix string `mapstructure:"subscribe-prefix,omitempty" json:"subscribe-prefix,omitempty" yaml:"subscribe-prefix,omitempty"` SubscribePath []string `mapstructure:"subscribe-path,omitempty" json:"subscribe-path,omitempty" yaml:"subscribe-path,omitempty"` SubscribeQos uint32 `mapstructure:"subscribe-qos,omitempty" json:"subscribe-qos,omitempty" yaml:"subscribe-qos,omitempty"` SubscribeUpdatesOnly bool `` /* 127-byte string literal not displayed */ SubscribeMode string `mapstructure:"subscribe-mode,omitempty" json:"subscribe-mode,omitempty" yaml:"subscribe-mode,omitempty"` SubscribeStreamMode string `mapstructure:"subscribe-stream_mode,omitempty" json:"subscribe-stream-mode,omitempty" yaml:"subscribe-stream-mode,omitempty"` SubscribeSampleInterval time.Duration `` /* 136-byte string literal not displayed */ SubscribeSuppressRedundant bool `` /* 145-byte string literal not displayed */ SubscribeHeartbearInterval time.Duration `` /* 145-byte string literal not displayed */ SubscribeModel []string `mapstructure:"subscribe-model,omitempty" json:"subscribe-model,omitempty" yaml:"subscribe-model,omitempty"` SubscribeQuiet bool `mapstructure:"subscribe-quiet,omitempty" json:"subscribe-quiet,omitempty" yaml:"subscribe-quiet,omitempty"` SubscribeTarget string `mapstructure:"subscribe-target,omitempty" json:"subscribe-target,omitempty" yaml:"subscribe-target,omitempty"` SubscribeName []string `mapstructure:"subscribe-name,omitempty" json:"subscribe-name,omitempty" yaml:"subscribe-name,omitempty"` SubscribeOutput []string `mapstructure:"subscribe-output,omitempty" json:"subscribe-output,omitempty" yaml:"subscribe-output,omitempty"` SubscribeWatchConfig bool `` /* 127-byte string literal not displayed */ SubscribeBackoff time.Duration `mapstructure:"subscribe-backoff,omitempty" json:"subscribe-backoff,omitempty" yaml:"subscribe-backoff,omitempty"` SubscribeLockRetry time.Duration `mapstructure:"subscribe-lock-retry,omitempty" json:"subscribe-lock-retry,omitempty" yaml:"subscribe-lock-retry,omitempty"` // Path PathFile []string `mapstructure:"path-file,omitempty" json:"path-file,omitempty" yaml:"path-file,omitempty"` PathExclude []string `mapstructure:"path-exclude,omitempty" json:"path-exclude,omitempty" yaml:"path-exclude,omitempty"` PathDir []string `mapstructure:"path-dir,omitempty" json:"path-dir,omitempty" yaml:"path-dir,omitempty"` PathPathType string `mapstructure:"path-path-type,omitempty" json:"path-path-type,omitempty" yaml:"path-path-type,omitempty"` PathModule string `mapstructure:"path-module,omitempty" json:"path-module,omitempty" yaml:"path-module,omitempty"` PathWithPrefix bool `mapstructure:"path-with-prefix,omitempty" json:"path-with-prefix,omitempty" yaml:"path-with-prefix,omitempty"` PathTypes bool `mapstructure:"path-types,omitempty" json:"path-types,omitempty" yaml:"path-types,omitempty"` PathSearch bool `mapstructure:"path-search,omitempty" json:"path-search,omitempty" yaml:"path-search,omitempty"` // Prompt PromptFile []string `mapstructure:"prompt-file,omitempty" json:"prompt-file,omitempty" yaml:"prompt-file,omitempty"` PromptExclude []string `mapstructure:"prompt-exclude,omitempty" json:"prompt-exclude,omitempty" yaml:"prompt-exclude,omitempty"` PromptDir []string `mapstructure:"prompt-dir,omitempty" json:"prompt-dir,omitempty" yaml:"prompt-dir,omitempty"` PromptMaxSuggestions uint16 `` /* 127-byte string literal not displayed */ PromptPrefixColor string `mapstructure:"prompt-prefix-color,omitempty" json:"prompt-prefix-color,omitempty" yaml:"prompt-prefix-color,omitempty"` PromptSuggestionsBGColor string `` /* 142-byte string literal not displayed */ PromptDescriptionBGColor string `` /* 142-byte string literal not displayed */ PromptSuggestAllFlags bool `` /* 133-byte string literal not displayed */ PromptDescriptionWithPrefix bool `` /* 151-byte string literal not displayed */ PromptDescriptionWithTypes bool `` /* 148-byte string literal not displayed */ PromptSuggestWithOrigin bool `` /* 139-byte string literal not displayed */ // Listen ListenMaxConcurrentStreams uint32 `` /* 148-byte string literal not displayed */ // VersionUpgrade UpgradeUsePkg bool `mapstructure:"upgrade-use-pkg" json:"upgrade-use-pkg,omitempty" yaml:"upgrade-use-pkg,omitempty"` // GetSet GetSetPrefix string `mapstructure:"getset-prefix,omitempty" json:"getset-prefix,omitempty" yaml:"getset-prefix,omitempty"` GetSetGet string `mapstructure:"getset-get,omitempty" json:"getset-get,omitempty" yaml:"getset-get,omitempty"` GetSetModel []string GetSetTarget string `mapstructure:"getset-target,omitempty" json:"getset-target,omitempty" yaml:"getset-target,omitempty"` GetSetType string `mapstructure:"getset-type,omitempty" json:"getset-type,omitempty" yaml:"getset-type,omitempty"` GetSetCondition string `mapstructure:"getset-condition,omitempty" json:"getset-condition,omitempty" yaml:"getset-condition,omitempty"` GetSetUpdate string `mapstructure:"getset-update,omitempty" json:"getset-update,omitempty" yaml:"getset-update,omitempty"` GetSetReplace string `mapstructure:"getset-replace,omitempty" json:"getset-replace,omitempty" yaml:"getset-replace,omitempty"` GetSetDelete string `mapstructure:"getset-delete,omitempty" json:"getset-delete,omitempty" yaml:"getset-delete,omitempty"` GetSetValue string `mapstructure:"getset-value,omitempty" json:"getset-value,omitempty" yaml:"getset-value,omitempty"` }
Click to show internal directories.
Click to hide internal directories.