Documentation
¶
Index ¶
- Variables
- func CheckCondition(code *gojq.Code, e *EventMsg) (bool, error)
- func DecodeConfig(src, dst interface{}) error
- func Register(name string, initFn Initializer)
- func ResponsesFlat(msgs ...proto.Message) (map[string]interface{}, error)
- type BaseProcessor
- func (p *BaseProcessor) Apply(...*EventMsg) []*EventMsg
- func (p *BaseProcessor) Init(interface{}, ...Option) error
- func (p *BaseProcessor) WithActions(act map[string]map[string]interface{})
- func (p *BaseProcessor) WithLogger(l *log.Logger)
- func (p *BaseProcessor) WithProcessors(procs map[string]map[string]any)
- func (p *BaseProcessor) WithTargets(map[string]*types.TargetConfig)
- type EventMsg
- type EventProcessor
- type Initializer
- type MarshalOptions
- type Option
Constants ¶
This section is empty.
Variables ¶
View Source
var EventProcessorTypes = []string{
"event-add-tag",
"event-allow",
"event-combine",
"event-convert",
"event-data-convert",
"event-date-string",
"event-delete",
"event-drop",
"event-duration-convert",
"event-extract-tags",
"event-group-by",
"event-ieeefloat32",
"event-jq",
"event-merge",
"event-override-ts",
"event-rate-limit",
"event-starlark",
"event-strings",
"event-time-epoch",
"event-to-tag",
"event-trigger",
"event-value-tag",
"event-value-tag-v2",
"event-write",
}
View Source
var EventProcessors = map[string]Initializer{}
Functions ¶
func DecodeConfig ¶
func DecodeConfig(src, dst interface{}) error
func Register ¶
func Register(name string, initFn Initializer)
Types ¶
type BaseProcessor ¶ added in v0.42.1
type BaseProcessor struct {
// contains filtered or unexported fields
}
func (*BaseProcessor) Apply ¶ added in v0.42.1
func (p *BaseProcessor) Apply(...*EventMsg) []*EventMsg
func (*BaseProcessor) Init ¶ added in v0.42.1
func (p *BaseProcessor) Init(interface{}, ...Option) error
func (*BaseProcessor) WithActions ¶ added in v0.42.1
func (p *BaseProcessor) WithActions(act map[string]map[string]interface{})
func (*BaseProcessor) WithLogger ¶ added in v0.42.1
func (p *BaseProcessor) WithLogger(l *log.Logger)
func (*BaseProcessor) WithProcessors ¶ added in v0.42.1
func (p *BaseProcessor) WithProcessors(procs map[string]map[string]any)
func (*BaseProcessor) WithTargets ¶ added in v0.42.1
func (p *BaseProcessor) WithTargets(map[string]*types.TargetConfig)
type EventMsg ¶
type EventMsg struct {
Name string `json:"name,omitempty"`
Timestamp int64 `json:"timestamp,omitempty"`
Tags map[string]string `json:"tags,omitempty"`
Values map[string]interface{} `json:"values,omitempty"`
Deletes []string `json:"deletes,omitempty"`
}
EventMsg represents a gNMI update message, The name is derived from the subscription in case the update was received in a subscribeResponse the tags are derived from the keys in gNMI path as well as some metadata from the subscription.
func EventFromMap ¶
func GetResponseToEventMsgs ¶
func GetResponseToEventMsgs(rsp *gnmi.GetResponse, meta map[string]string, eps ...EventProcessor) ([]*EventMsg, error)
func ResponseToEventMsgs ¶
func ResponseToEventMsgs(name string, rsp *gnmi.SubscribeResponse, meta map[string]string, eps ...EventProcessor) ([]*EventMsg, error)
ResponseToEventMsgs //
type EventProcessor ¶
type EventProcessor interface {
Init(interface{}, ...Option) error
Apply(...*EventMsg) []*EventMsg
WithTargets(map[string]*types.TargetConfig)
WithLogger(l *log.Logger)
WithActions(act map[string]map[string]interface{})
WithProcessors(procs map[string]map[string]any)
}
func MakeEventProcessors ¶
type Initializer ¶
type Initializer func() EventProcessor
type MarshalOptions ¶
type MarshalOptions struct {
Multiline bool
Indent string
Format string
OverrideTS bool
ValuesOnly bool
CalculateLatency bool
}
func (*MarshalOptions) FormatJSON ¶
FormatJSON formats a proto.Message and returns a []byte and an error
func (*MarshalOptions) Marshal ¶
func (o *MarshalOptions) Marshal(msg proto.Message, meta map[string]string, eps ...EventProcessor) ([]byte, error)
Marshal //
func (*MarshalOptions) OverrideTimestamp ¶
func (o *MarshalOptions) OverrideTimestamp(msg proto.Message) proto.Message
type Option ¶
type Option func(EventProcessor)
func WithActions ¶
func WithLogger ¶
func WithProcessors ¶
func WithTargets ¶
func WithTargets(tcs map[string]*types.TargetConfig) Option
Click to show internal directories.
Click to hide internal directories.