Documentation ¶
Overview ¶
Package parsers is generated by Handlergenerator tooling Make sure to insert real Description here
Index ¶
- Variables
- func NewParseCSVHandler() handlers.Handler
- type ParseCSV
- func (a *ParseCSV) GetConfiguration() *property.Configuration
- func (a *ParseCSV) GetErrorChannel() chan error
- func (a *ParseCSV) GetHandlerName() string
- func (a ParseCSV) Handle(ctx context.Context, input payload.Payload, topics ...string) error
- func (a *ParseCSV) SetMetricProvider(p metric.Provider, prefix string) error
- func (a *ParseCSV) Subscriptionless() bool
- func (a *ParseCSV) ValidateConfiguration() (bool, []string)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DefaultDelimiter is the delimiter used if nothing is set DefaultDelimiter = "," // DefaultHeaderLength is the headerlength to use if nothing else is set DefaultHeaderLength = 1 // DefaultSkipRows is the default rows to skip if nothing is set DefaultSkipRows = 0 //ErrNotCsv is triggered when the input file is not proper csv ErrNotCsv error = errors.New("this is not a proper csv file") //ErrHeaderMismatch is triggered when header is longer than CSV records ErrHeaderMismatch error = errors.New("the header is not the same size as the records") )
Functions ¶
func NewParseCSVHandler ¶
NewParseCSVHandler generates a new ParseCSV Handler
Types ¶
type ParseCSV ¶
type ParseCSV struct { // Cfg is values needed to properly run the Handle func Cfg *property.Configuration `json:"configs" yaml:"configs"` Name string `json:"handler_name" yaml:"handler_name"` // MetricPayloadOut is how many payloads the processor has outputted MetricPayloadOut string // MetricPayloadIn is how many payloads the processor has inputted MetricPayloadIn string // contains filtered or unexported fields }
ParseCSV is used to parse CSV files, expects whole payloads
func (*ParseCSV) GetConfiguration ¶
func (a *ParseCSV) GetConfiguration() *property.Configuration
GetConfiguration will return the CFG for the Handler
func (*ParseCSV) GetErrorChannel ¶
GetErrorChannel will return a channel that the Handler can output eventual errors onto
func (*ParseCSV) GetHandlerName ¶
GetHandlerName is used to retrun a unqiue string name
func (*ParseCSV) SetMetricProvider ¶
SetMetricProvider is used to change what metrics provider is used by the handler
func (*ParseCSV) Subscriptionless ¶
Subscriptionless will return true/false if the Handler is genereating payloads itself
func (*ParseCSV) ValidateConfiguration ¶
ValidateConfiguration is used to see that all needed configurations are assigned before starting
Click to show internal directories.
Click to hide internal directories.