Documentation ¶
Index ¶
- Constants
- func NewEventsEndpoint(p *EventParser) endpoint.Endpoint
- func NewEventsEndpointDecode() kithttp.DecodeRequestFunc
- func NewEventsEndpointEncode() kithttp.EncodeResponseFunc
- func ProvideMetrics() fx.Option
- type EventParser
- type EventSenderFunc
- type Measures
- type ParserConfig
- type ParserIn
- type Response
Constants ¶
const ( ParsingQueueDepth = "parsing_queue_depth" DroppedEventsCounter = "dropped_events_count" )
Variables ¶
This section is empty.
Functions ¶
func NewEventsEndpoint ¶
func NewEventsEndpoint(p *EventParser) endpoint.Endpoint
NewEventsEndpoint returns the endpoint for /events handler.
func NewEventsEndpointDecode ¶
func NewEventsEndpointDecode() kithttp.DecodeRequestFunc
NewEventsEndpointDecode returns DecodeRequestFunc wrapper from the /events endpoint.
func NewEventsEndpointEncode ¶
func NewEventsEndpointEncode() kithttp.EncodeResponseFunc
NewEventsEndpointEncode returns EncodeResponseFunc wrapper from the /events endpoint.
func ProvideMetrics ¶
ProvideMetrics is the metrics provider for eventParser
Types ¶
type EventParser ¶
type EventParser struct {
// contains filtered or unexported fields
}
func NewEventParser ¶
func NewEventParser(sender EventSenderFunc, logger *log.Logger, o ParserConfig, measures Measures) (*EventParser, error)
NewEventParser validates and constructs an EventParser from provided the configs.
func Provide ¶
func Provide(in ParserIn, opt ParserConfig) (*EventParser, error)
Provide is an uber/fx style provider for this package's components
type EventSenderFunc ¶
type EventSenderFunc func(deviceID string, event *wrp.Message)
EventSenderFunc is the function type used pass events to manager.
type Measures ¶
type Measures struct { fx.In EventParsingQueue metrics.Gauge `name:"parsing_queue_depth"` DroppedEventsParsingCount metrics.Counter `name:"dropped_events_count"` }
Measures describes the defined metrics that will be used by eventparser
func NewMeasures ¶
NewMeasures returns desired metrics
type ParserConfig ¶
type ParserConfig struct { QueueSize int MaxWorkers int RegexRules []rules.RuleConfig }
ParserConfig is the config provided to create a new EventParser.