config

package
v0.39.1 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: Apache-2.0 Imports: 46 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrConfig = errors.New("config error")
View Source
var ErrInvalidConfig = errors.New("invalid configuration")
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

func ExpandOSPaths(paths []string) ([]string, error)

func ParseAddressField added in v0.38.0

func ParseAddressField(addr []string) []string

func SanitizeArrayFlagValue

func SanitizeArrayFlagValue(ls []string) []string

SanitizeArrayFlagValue trims trailing and leading brackets ([]), from each of ls elements only if both are present.

Types

type APIServer

type APIServer struct {
	Address       string           `mapstructure:"address,omitempty" json:"address,omitempty"`
	Timeout       time.Duration    `mapstructure:"timeout,omitempty" json:"timeout,omitempty"`
	TLS           *types.TLSConfig `mapstructure:"tls,omitempty" json:"tls,omitempty"`
	EnableMetrics bool             `mapstructure:"enable-metrics,omitempty" json:"enable-metrics,omitempty"`
	Debug         bool             `mapstructure:"debug,omitempty" json:"debug,omitempty"`
}

type Config

type Config struct {
	GlobalFlags `mapstructure:",squash"`
	LocalFlags  `mapstructure:",squash"`
	FileConfig  *viper.Viper `mapstructure:"-" json:"-" yaml:"-" `

	Targets       map[string]*types.TargetConfig       `mapstructure:"targets,omitempty" json:"targets,omitempty" yaml:"targets,omitempty"`
	Subscriptions map[string]*types.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"`
	GnmiServer    *gnmiServer                          `mapstructure:"gnmi-server,omitempty" json:"gnmi-server,omitempty" yaml:"gnmi-server,omitempty"`
	APIServer     *APIServer                           `mapstructure:"api-server,omitempty" json:"api-server,omitempty" yaml:"api-server,omitempty"`
	Loader        map[string]interface{}               `mapstructure:"loader,omitempty" json:"loader,omitempty" yaml:"loader,omitempty"`
	Actions       map[string]map[string]interface{}    `mapstructure:"actions,omitempty" json:"actions,omitempty" yaml:"actions,omitempty"`
	TunnelServer  *tunnelServer                        `mapstructure:"tunnel-server,omitempty" json:"tunnel-server,omitempty" yaml:"tunnel-server,omitempty"`
	// contains filtered or unexported fields
}

func New

func New() *Config

func (*Config) CreateDiffGetRequest

func (c *Config) CreateDiffGetRequest() (*gnmi.GetRequest, error)

func (*Config) CreateDiffSubscribeRequest

func (c *Config) CreateDiffSubscribeRequest(cmd *cobra.Command) (*gnmi.SubscribeRequest, error)

func (*Config) CreateGASGetRequest

func (c *Config) CreateGASGetRequest() (*gnmi.GetRequest, error)

func (*Config) CreateGASSetRequest

func (c *Config) CreateGASSetRequest(input interface{}) (*gnmi.SetRequest, error)

func (*Config) CreateGetRequest

func (c *Config) CreateGetRequest(tc *types.TargetConfig) (*gnmi.GetRequest, error)

func (*Config) CreateSetRequest

func (c *Config) CreateSetRequest(targetName string) ([]*gnmi.SetRequest, error)

func (*Config) CreateSetRequestFromFile

func (c *Config) CreateSetRequestFromFile(targetName string) ([]*gnmi.SetRequest, error)

func (*Config) CreateSetRequestFromProtoFile added in v0.36.0

func (c *Config) CreateSetRequestFromProtoFile() ([]*gnmi.SetRequest, error)

func (*Config) CreateSubscribeRequest

func (c *Config) CreateSubscribeRequest(sc *types.SubscriptionConfig, tc *types.TargetConfig) (*gnmi.SubscribeRequest, error)

func (*Config) GetAPIServer

func (c *Config) GetAPIServer() error

func (*Config) GetActions

func (c *Config) GetActions() (map[string]map[string]interface{}, error)

func (*Config) GetClustering

func (c *Config) GetClustering() error

func (*Config) GetDiffTargets

func (c *Config) GetDiffTargets() (*types.TargetConfig, map[string]*types.TargetConfig, error)

func (*Config) GetEventProcessors

func (c *Config) GetEventProcessors() (map[string]map[string]interface{}, error)

func (*Config) GetGNMIServer

func (c *Config) GetGNMIServer() error

func (*Config) GetInputs

func (c *Config) GetInputs() (map[string]map[string]interface{}, error)

func (*Config) GetLoader

func (c *Config) GetLoader() error

func (*Config) GetOutputs

func (c *Config) GetOutputs() (map[string]map[string]interface{}, error)

func (*Config) GetOutputsConfigs

func (c *Config) GetOutputsConfigs() [][]string

func (*Config) GetOutputsSuggestions

func (c *Config) GetOutputsSuggestions() []outputSuggestion

func (*Config) GetPluginsConfig added in v0.35.0

func (c *Config) GetPluginsConfig() (*PluginsConfig, error)

func (*Config) GetSubscriptions

func (c *Config) GetSubscriptions(cmd *cobra.Command) (map[string]*types.SubscriptionConfig, error)

func (*Config) GetSubscriptionsFromFile

func (c *Config) GetSubscriptionsFromFile() []*types.SubscriptionConfig

func (*Config) GetTargets

func (c *Config) GetTargets() (map[string]*types.TargetConfig, error)

func (*Config) GetTunnelServer

func (c *Config) GetTunnelServer() error

func (*Config) Load

func (c *Config) Load(ctx context.Context) error

func (*Config) ReadSetRequestTemplate

func (c *Config) ReadSetRequestTemplate() error

func (*Config) SetGlobalsFromEnv added in v0.38.0

func (c *Config) SetGlobalsFromEnv(cmd *cobra.Command)

func (*Config) SetLocalFlagsFromFile

func (c *Config) SetLocalFlagsFromFile(cmd *cobra.Command)

func (*Config) SetLogger

func (c *Config) SetLogger() (io.Writer, int, error)

func (*Config) SetPersistentFlagsFromFile

func (c *Config) SetPersistentFlagsFromFile(cmd *cobra.Command)

func (*Config) SetTargetConfigDefaults

func (c *Config) SetTargetConfigDefaults(tc *types.TargetConfig) error

func (*Config) TargetsList

func (c *Config) TargetsList() []*types.TargetConfig

func (*Config) ValidateSetInput

func (c *Config) ValidateSetInput() error

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"`
	TLSServerName string        `mapstructure:"tls-server-name,omitempty" json:"tls-server-name,omitempty" yaml:"tls-server-name,omitempty"`
	LogTLSSecret  bool          `mapstructure:"log-tls-secret,omitempty" json:"log-tls-secret,omitempty" yaml:"log-tls-secret,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"`
	LogMaxSize    int           `mapstructure:"log-max-size,omitempty" json:"log-max-size,omitempty" yaml:"log-max-size,omitempty"`
	LogMaxBackups int           `mapstructure:"log-max-backups,omitempty" json:"log-max-backups,omitempty" yaml:"log-max-backups,omitempty"`
	LogCompress   bool          `mapstructure:"log-compress,omitempty" json:"log-compress,omitempty" yaml:"log-compress,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"`
	File             []string      `mapstructure:"file,omitempty" json:"file,omitempty" yaml:"file,omitempty"`
	Dir              []string      `mapstructure:"dir,omitempty" json:"dir,omitempty" yaml:"dir,omitempty"`
	Exclude          []string      `mapstructure:"exclude,omitempty" json:"exclude,omitempty" yaml:"exclude,omitempty"`
	Token            string        `mapstructure:"token,omitempty" json:"token,omitempty" yaml:"token,omitempty"`
	UseTunnelServer  bool          `mapstructure:"use-tunnel-server,omitempty" json:"use-tunnel-server,omitempty" yaml:"use-tunnel-server,omitempty"`
	AuthScheme       string        `mapstructure:"auth-scheme,omitempty" json:"auth-scheme,omitempty" yaml:"auth-scheme,omitempty"`
	CalculateLatency bool          `mapstructure:"calculate-latency,omitempty" json:"calculate-latency,omitempty" yaml:"calculate-latency,omitempty"`

	Metadata             map[string]string `mapstructure:"metadata,omitempty" json:"metadata,omitempty" yaml:"metadata,omitempty"`
	PluginProcessorsPath string            `` /* 127-byte string literal not displayed */
}

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"`
	GetValuesOnly bool     `mapstructure:"get-values-only,omitempty" json:"get-values-only,omitempty" yaml:"get-values-only,omitempty"`
	GetProcessor  []string `mapstructure:"get-processor,omitempty" json:"get-processor,omitempty" yaml:"get-processor,omitempty"`
	GetDepth      uint32   `mapstructure:"get-depth,omitempty" yaml:"get-depth,omitempty" json:"get-depth,omitempty"`
	GetDryRun     bool     `mapstructure:"get-dry-run,omitempty" json:"get-dry-run,omitempty" yaml:"get-dry-run,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"`
	SetUnionReplace           []string      `mapstructure:"set-union-replace,omitempty" json:"set-union-replace,omitempty" yaml:"set-union-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"`
	SetUnionReplacePath       []string      `` /* 127-byte string literal not displayed */
	SetUnionReplaceValue      []string      `` /* 130-byte string literal not displayed */
	SetUnionReplaceFile       []string      `` /* 127-byte string literal not displayed */
	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"`
	SetRequestProtoFile       []string      `` /* 127-byte string literal not displayed */
	SetDryRun                 bool          `mapstructure:"set-dry-run,omitempty" json:"set-dry-run,omitempty" yaml:"set-dry-run,omitempty"`
	SetNoTrim                 bool          `mapstructure:"set-no-trim,omitempty" json:"set-no-trim,omitempty" yaml:"set-no-trim,omitempty"`
	SetReplaceCli             []string      `mapstructure:"set-replace-cli,omitempty" yaml:"set-replace-cli,omitempty" json:"set-replace-cli,omitempty"`
	SetReplaceCliFile         string        `mapstructure:"set-replace-cli-file,omitempty" yaml:"set-replace-cli-file,omitempty" json:"set-replace-cli-file,omitempty"`
	SetUpdateCli              []string      `mapstructure:"set-update-cli,omitempty" yaml:"set-update-cli,omitempty" json:"set-update-cli,omitempty"`
	SetUpdateCliFile          string        `mapstructure:"set-update-cli-file,omitempty" yaml:"set-update-cli-file,omitempty" json:"set-update-cli-file,omitempty"`
	SetCommitId               string        `mapstructure:"set-commit-id,omitempty" yaml:"set-commit-id,omitempty" json:"set-commit-id,omitempty"`
	SetCommitRequest          bool          `mapstructure:"set-commit-request,omitempty" yaml:"set-commit-request,omitempty" json:"set-commit-request,omitempty"`
	SetCommitRollbackDuration time.Duration `` /* 145-byte string literal not displayed */
	SetCommitCancel           bool          `mapstructure:"set-commit-cancel,omitempty" yaml:"set-commit-cancel,omitempty" json:"set-commit-cancel,omitempty"`
	SetCommitConfirm          bool          `mapstructure:"set-commit-confirm,omitempty" yaml:"set-commit-confirm,omitempty" json:"set-commit-confirm,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 */
	SubscribeHeartbeatInterval 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"`
	SubscribeSetTarget         bool          `mapstructure:"subscribe-set-target,omitempty" json:"subscribe-set-target,omitempty" yaml:"subscribe-set-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"`
	SubscribeHistorySnapshot   string        `` /* 139-byte string literal not displayed */
	SubscribeHistoryStart      string        `` /* 130-byte string literal not displayed */
	SubscribeHistoryEnd        string        `mapstructure:"subscribe-history-end,omitempty" json:"subscribe-history-end,omitempty" yaml:"subscribe-history-end,omitempty"`
	SubscribeDepth             uint32        `mapstructure:"subscribe-depth,omitempty" yaml:"subscribe-depth,omitempty" json:"subscribe-depth,omitempty"`
	// Path
	PathPathType   string `mapstructure:"path-path-type,omitempty" json:"path-path-type,omitempty" yaml:"path-path-type,omitempty"`
	PathWithDescr  bool   `mapstructure:"path-descr,omitempty" json:"path-descr,omitempty" yaml:"path-descr,omitempty"`
	PathWithPrefix bool   `mapstructure:"path-with-prefix,omitempty" json:"path-with-prefix,omitempty" yaml:"path-with-prefix,omitempty"`
	PathWithTypes  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"`
	PathState      bool   `mapstructure:"path-state,omitempty" json:"path-state,omitempty" yaml:"path-state,omitempty"`
	PathConfig     bool   `mapstructure:"path-config,omitempty" json:"path-config,omitempty" yaml:"path-config,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 */
	ListenPrometheusAddress    string `` /* 136-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 `mapstructure:"get-set-model,omitempty" yaml:"get-set-model,omitempty" json:"get-set-model,omitempty"`
	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"`
	// Generate
	GenerateOutput     string `mapstructure:"generate-output,omitempty" json:"generate-output,omitempty" yaml:"generate-output,omitempty"`
	GenerateJSON       bool   `mapstructure:"generate-json,omitempty" json:"generate-json,omitempty" yaml:"generate-json,omitempty"`
	GenerateConfigOnly bool   `mapstructure:"generate-config-only,omitempty" json:"generate-config-only,omitempty" yaml:"generate-config-only,omitempty"`
	GeneratePath       string `mapstructure:"generate-path,omitempty" json:"generate-path,omitempty" yaml:"generate-path,omitempty"`
	GenerateCamelCase  bool   `mapstructure:"generate-camel-case,omitempty" json:"generate-camel-case,omitempty" yaml:"generate-camel-case,omitempty"`
	GenerateSnakeCase  bool   `mapstructure:"generate-snake-case,omitempty" json:"generate-snake-case,omitempty" yaml:"generate-snake-case,omitempty"`
	// Generate Set Request
	GenerateSetRequestUpdatePath  []string `mapstructure:"generate-update-path,omitempty" json:"generate-update-path,omitempty" yaml:"generate-update-path,omitempty"`
	GenerateSetRequestReplacePath []string `mapstructure:"generate-replace-path,omitempty" json:"generate-replace-path,omitempty" yaml:"generate-replace-path,omitempty"`
	// Generate path
	GeneratePathWithDescr     bool   `mapstructure:"generate-descr,omitempty" json:"generate-descr,omitempty" yaml:"generate-descr,omitempty"`
	GeneratePathWithPrefix    bool   `mapstructure:"generate-with-prefix,omitempty" json:"generate-with-prefix,omitempty" yaml:"generate-with-prefix,omitempty"`
	GeneratePathWithTypes     bool   `mapstructure:"generate-types,omitempty" json:"generate-types,omitempty" yaml:"generate-types,omitempty"`
	GeneratePathSearch        bool   `mapstructure:"generate-search,omitempty" json:"generate-search,omitempty" yaml:"generate-search,omitempty"`
	GeneratePathPathType      string `` /* 130-byte string literal not displayed */
	GeneratePathState         bool   `mapstructure:"generate-path-state,omitempty" json:"generate-path-state,omitempty" yaml:"generate-path-state,omitempty"`
	GeneratePathConfig        bool   `mapstructure:"generate-path-config,omitempty" json:"generate-path-config,omitempty" yaml:"generate-path-config,omitempty"`
	GeneratePathWithNonLeaves bool   `` /* 148-byte string literal not displayed */
	//
	DiffPath                []string `mapstructure:"diff-path,omitempty" json:"diff-path,omitempty" yaml:"diff-path,omitempty"`
	DiffPrefix              string   `mapstructure:"diff-prefix,omitempty" json:"diff-prefix,omitempty" yaml:"diff-prefix,omitempty"`
	DiffModel               []string `mapstructure:"diff-model,omitempty" json:"diff-model,omitempty" yaml:"diff-model,omitempty"`
	DiffType                string   `mapstructure:"diff-type,omitempty" json:"diff-type,omitempty" yaml:"diff-type,omitempty"`
	DiffTarget              string   `mapstructure:"diff-target,omitempty" json:"diff-target,omitempty" yaml:"diff-target,omitempty"`
	DiffSub                 bool     `mapstructure:"diff-sub,omitempty" json:"diff-sub,omitempty" yaml:"diff-sub,omitempty"`
	DiffRef                 string   `mapstructure:"diff-ref,omitempty" json:"diff-ref,omitempty" yaml:"diff-ref,omitempty"`
	DiffCompare             []string `mapstructure:"diff-compare,omitempty" json:"diff-compare,omitempty" yaml:"diff-compare,omitempty"`
	DiffQos                 uint32   `mapstructure:"diff-qos,omitempty" json:"diff-qos,omitempty" yaml:"diff-qos,omitempty"`
	DiffSetRequestRef       string   `mapstructure:"diff-setrequest-ref,omitempty" json:"diff-setrequest-ref,omitempty" yaml:"diff-setrequest-ref,omitempty"`
	DiffSetRequestNew       string   `mapstructure:"diff-setrequest-new,omitempty" json:"diff-setrequest-new,omitempty" yaml:"diff-setrequest-new,omitempty"`
	DiffSetRequestFull      bool     `mapstructure:"diff-setrequest-full,omitempty" json:"diff-setrequest-full,omitempty" yaml:"diff-setrequest-full,omitempty"`
	DiffSetToNotifsSet      string   `` /* 127-byte string literal not displayed */
	DiffSetToNotifsResponse string   `` /* 142-byte string literal not displayed */
	DiffSetToNotifsFull     bool     `` /* 130-byte string literal not displayed */
	//
	TunnelServerSubscribe bool `` /* 130-byte string literal not displayed */
	// Processor
	ProcessorInput          string   `mapstructure:"processor-input,omitempty" yaml:"processor-input,omitempty" json:"processor-input,omitempty"`
	ProcessorInputDelimiter string   `` /* 136-byte string literal not displayed */
	ProcessorName           []string `mapstructure:"processor-name,omitempty" yaml:"processor-name,omitempty" json:"processor-name,omitempty"`
	ProcessorOutput         string   `mapstructure:"processor-output,omitempty" yaml:"processor-output,omitempty" json:"processor-output,omitempty"`
}

type PluginsConfig added in v0.35.0

type PluginsConfig struct {
	Path         string        `mapstructure:"path,omitempty" json:"path,omitempty"`
	Glob         string        `mapstructure:"glob,omitempty" json:"glob,omitempty"`
	StartTimeout time.Duration `mapstructure:"start-timeout,omitempty" json:"start-timeout,omitempty"`
	Debug        bool          `mapstructure:"debug,omitempty" json:"debug,omitempty"`
}

type SetRequestFile

type SetRequestFile struct {
	Updates          []*UpdateItem `json:"updates,omitempty" yaml:"updates,omitempty"`
	Replaces         []*UpdateItem `json:"replaces,omitempty" yaml:"replaces,omitempty"`
	UnionReplaces    []*UpdateItem `json:"union-replaces,omitempty" yaml:"union-replaces,omitempty"`
	Deletes          []string      `json:"deletes,omitempty" yaml:"deletes,omitempty"`
	CommitID         string        `yaml:"commit-id,omitempty" json:"commit-id,omitempty"`
	CommitAction     commitAction  `yaml:"commit-action,omitempty" json:"commit-action,omitempty"`
	RollbackDuration time.Duration `yaml:"rollback-duration,omitempty" json:"rollback-duration,omitempty"`
}

type UpdateItem

type UpdateItem struct {
	Path     string      `json:"path,omitempty" yaml:"path,omitempty"`
	Value    interface{} `json:"value,omitempty" yaml:"value,omitempty"`
	Encoding string      `json:"encoding,omitempty" yaml:"encoding,omitempty"`
}

Jump to

Keyboard shortcuts

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