common

package
v0.36.1 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

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 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 UnsupportedNotDeepEquals added in v0.36.0

func UnsupportedNotDeepEquals(a any, b any, name string) diag.Diagnostics

func UnsupportedNotEquals added in v0.36.0

func UnsupportedNotEquals(a any, b any, name string) diag.Diagnostics

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 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 🇻🇳