common

package
v0.39.1 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Equals = iota
	NotEquals
	DeepEquals
	NotDeepEquals
)

Variables

This section is empty.

Functions

func DefaultWeaveWorksServerCfg added in v0.36.0

func DefaultWeaveWorksServerCfg() server.Config

func LabelForParts added in v0.36.0

func LabelForParts(parts ...interface{}) string

LabelForParts generates a consistent component label for a set of parts delimited with an underscore.

func LabelWithIndex added in v0.36.0

func LabelWithIndex(index int, parts ...interface{}) string

LabelWithIndex generates a consistent component label for a set of parts delimited with an underscore and suffixed with the provided index. If the index is 0, the label is generated without the index.

func NewBlockWithOverride added in v0.35.0

func NewBlockWithOverride(name []string, label string, args component.Arguments) *builder.Block

NewBlockWithOverride generates a new *builder.Block using a hook to override specific types.

func NewBlockWithOverrideFn added in v0.36.0

func NewBlockWithOverrideFn(name []string, label string, args component.Arguments, fn builder.ValueOverrideHook) *builder.Block

NewBlockWithOverrideFn generates a new *builder.Block using a hook fn to override specific types.

func NewDiscoveryExports added in v0.37.3

func NewDiscoveryExports(expr string) discovery.Exports

NewDiscoveryExports will return a new discovery.Exports with a specific key for converter component exports. The argument will be tokenized as a component export string rather than the standard discovery.Target RiverTokenize.

func NewDiscoveryTargets added in v0.37.3

func NewDiscoveryTargets(expr string) []discovery.Target

NewDiscoveryTargets will return a new [[]discovery.Target] with a specific key for converter component exports. The argument will be tokenized as a component export string rather than the standard discovery.Target RiverTokenize.

func PrettyPrint added in v0.35.0

func PrettyPrint(in []byte) ([]byte, diag.Diagnostics)

PrettyPrint parses river config and returns it in a standardize format. If PrettyPrint fails, the input is returned unmodified.

func SanitizeIdentifierPanics added in v0.36.1

func SanitizeIdentifierPanics(in string) string

func ToHttpClientConfig added in v0.37.3

func ToHttpClientConfig(httpClientConfig *prom_config.HTTPClientConfig) *config.HTTPClientConfig

func ToTLSConfig added in v0.37.3

func ToTLSConfig(tlsConfig *prom_config.TLSConfig) *config.TLSConfig

func ValidateHttpClientConfig added in v0.37.3

func ValidateHttpClientConfig(httpClientConfig *prom_config.HTTPClientConfig) diag.Diagnostics

ValidateHttpClientConfig returns diag.Diagnostics for currently unsupported Flow features available in Prometheus.

func ValidateNodes added in v0.36.0

func ValidateNodes(f *builder.File) diag.Diagnostics

ValidateNodes will look at the final nodes and ensure that there are no duplicate labels.

func ValidateSupported added in v0.37.3

func ValidateSupported(validationType int, value1 any, value2 any, name string, message string) diag.Diagnostics

ValidateSupported will return a diagnostic error if the validationType specified results in a match for value1 and value2.

For example, if using validationType Equals and value1 is equal to value2, then a diagnostic error will be returned.

func ValidateWeaveWorksServerCfg added in v0.36.0

func ValidateWeaveWorksServerCfg(cfg server.Config) diag.Diagnostics

func WeaveWorksServerToFlowServer added in v0.36.0

func WeaveWorksServerToFlowServer(config server.Config) *fnet.ServerConfig

Types

type ConvertAppendable

type ConvertAppendable struct {
	storage.Appendable

	Expr string // The specific string to return during tokenization.
}

ConvertAppendable implements both the builder.Tokenizer and storage.Appendable interfaces. This allows us to set component.Arguments that leverage storage.Appendable with an implementation that can be tokenized as a specific string.

func (ConvertAppendable) RiverCapsule

func (f ConvertAppendable) RiverCapsule()

func (ConvertAppendable) RiverTokenize

func (f ConvertAppendable) RiverTokenize() []builder.Token

type ConvertLogsReceiver added in v0.36.0

type ConvertLogsReceiver struct {
	loki.LogsReceiver

	Expr string
}

ConvertLogsReceiver allows us to override how the loki.LogsReceiver is tokenized. See ConvertAppendable as another example with more details in comments.

func (ConvertLogsReceiver) RiverCapsule added in v0.36.0

func (f ConvertLogsReceiver) RiverCapsule()

func (ConvertLogsReceiver) RiverTokenize added in v0.36.0

func (f ConvertLogsReceiver) RiverTokenize() []builder.Token

type ConvertTargets added in v0.35.0

type ConvertTargets struct {
	Targets []discovery.Target
}

ConvertTargets implements builder.Tokenizer. This allows us to set component.Arguments with an implementation that can be tokenized with custom behaviour for converting.

func (ConvertTargets) RiverCapsule added in v0.35.0

func (f ConvertTargets) RiverCapsule()

func (ConvertTargets) RiverTokenize added in v0.35.0

func (f ConvertTargets) RiverTokenize() []builder.Token

type CustomTokenizer added in v0.36.0

type CustomTokenizer struct {
	Expr string
}

func (CustomTokenizer) RiverTokenize added in v0.36.0

func (f CustomTokenizer) RiverTokenize() []builder.Token

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳