Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GonxMapper ¶
type GonxMapper[T MapInitialisedRow] struct { // contains filtered or unexported fields }
func NewGonxMapper ¶
func NewGonxMapper[T MapInitialisedRow](formats ...string) *GonxMapper[T]
func (*GonxMapper[T]) Identifier ¶
func (c *GonxMapper[T]) Identifier() string
type GrokMapper ¶ added in v0.2.0
type GrokMapper[T MapInitialisedRow] struct { // contains filtered or unexported fields }
func NewGrokMapper ¶ added in v0.2.0
func NewGrokMapper[T MapInitialisedRow](layout string, patterns map[string]string) (*GrokMapper[T], error)
NewGrokMapper creates a new GrokMapper which contains a grok parser for each layout. patterns is a map of pattern names to grok patterns.
func (*GrokMapper[T]) GetRegex ¶ added in v0.2.0
func (c *GrokMapper[T]) GetRegex() (_ string, err error)
func (*GrokMapper[T]) Identifier ¶ added in v0.2.0
func (c *GrokMapper[T]) Identifier() string
type HeaderHandler ¶ added in v0.4.0
type HeaderHandler interface {
OnHeader(header []string)
}
HeaderHandler is an interface which provides a method for handling the header row it should be implemented by any mapper which wishes to be notified of the header row
type MapInitialisedRow ¶ added in v0.2.0
MapInitialisedRow is an interface which provides a means to initialise a row struct from a string map this is used in combination with the GonxMapper/GrokMapper
type Mapper ¶ added in v0.2.0
type Mapper[R types.RowStruct] interface { Identifier() string // Map converts raw rows to the desired format (type 'R') Map(context.Context, any, ...MapOption[R]) (R, error) }
Mapper is a generic interface which provides a method for mapping raw source data into row structs R is the type of the row struct which the mapperFunc outputs
type RegexMapper ¶ added in v0.2.0
type RegexMapper[T MapInitialisedRow] struct { // contains filtered or unexported fields }
func NewRegexMapper ¶ added in v0.2.0
func NewRegexMapper[T MapInitialisedRow](pattern string) (*RegexMapper[T], error)
NewRegexMapper creates a new RegexMapper with the provided pattern.
func (*RegexMapper[T]) Identifier ¶ added in v0.2.0
func (c *RegexMapper[T]) Identifier() string