Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dependencies ¶
type Factory ¶
func NewFactory ¶
func NewFactory(mockOn ...component.MockOption) Factory
type Rewriter ¶
type Rewriter interface {
component.Component
config.Watcher
// Labels applies rewrite rules to the given labels and returns the modified labels.
// Note: this method modifies the input labels in place.
// If a rule's action is ActionDropFeed, it returns nil to indicate the item should be dropped.
Labels(ctx context.Context, labels model.Labels) (model.Labels, error)
}
type Rule ¶
type Rule struct {
// SourceLabel specifies which label's value to use as source text.
// Default is model.LabelContent.
SourceLabel string
// SkipTooShortThreshold is the threshold of the source text length.
// If the source text is shorter than this threshold, it will be skipped.
SkipTooShortThreshold *int
// Transform used to transform the source text.
// If not set, transform to original source text.
Transform *Transform
// Match used to match the text after transform.
// If not set, match all.
Match string
// Action determines what to do if matchs.
Action Action
// Label is the label to create or update.
Label string
// contains filtered or unexported fields
}
func (*Rule) From ¶
func (r *Rule) From(c *config.RewriteRule)
Click to show internal directories.
Click to hide internal directories.