properties

package
v0.71.1 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ComponentID

type ComponentID struct {
	Type string `parser:"@~(ForwardSlash | (Dot (?= 'config')))+"`
	Name string `parser:"(ForwardSlash @(~(Dot (?= 'config'))+)*)?"`
}

type EnvVarComponentID

type EnvVarComponentID struct {
	Type string `parser:"@~(Underscore (?= 'CONFIG'))+"`
	// _x2f_ -> '/'
	Name string `parser:"(Underscore 'x2f' Underscore @(~(?= Underscore (?= 'CONFIG'))+|''))?"`
}

type EnvVarProperty

type EnvVarProperty struct {
	ComponentType string            `parser:"'SPLUNK' Underscore 'DISCOVERY' Underscore @('RECEIVERS' | 'EXTENSIONS') Underscore"`
	Component     EnvVarComponentID `parser:"@@"`
	Key           string            `parser:"Underscore 'CONFIG' Underscore @(String|Underscore)+"`
	Val           string
}

func NewEnvVarProperty

func NewEnvVarProperty(property, val string) (*EnvVarProperty, error)

type Property

type Property struct {
	ComponentType string      `parser:"'splunk' Dot 'discovery' Dot @('receivers' | 'extensions') Dot"`
	Component     ComponentID `parser:"@@"`
	Key           string      `parser:"Dot 'config' Dot @(String|Dot|ForwardSlash)+"`
	Val           string
	// contains filtered or unexported fields
}

Property is the ast for a parsed property. TODO: support rules and resource_attributes instead of just embedded config

func NewProperty

func NewProperty(property, val string) (*Property, error)

func NewPropertyFromEnvVar

func NewPropertyFromEnvVar(envVar, val string) (*Property, bool, error)

func (*Property) ToEnvVar

func (p *Property) ToEnvVar() string

ToEnvVar will output the equivalent env var property for informational purposes.

func (*Property) ToStringMap

func (p *Property) ToStringMap() map[string]any

ToStringMap() will return a map[string]any equivalent to the property's root-level confmap.ToStringMap()

Jump to

Keyboard shortcuts

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