Documentation
¶
Index ¶
- Constants
- type Contexts
- type KeyFunctionPair
- type KeyVal
- type ParsedEvent
- func (event ParsedEvent) GetContextValue(contextName string, path ...interface{}) (interface{}, error)
- func (event ParsedEvent) GetSubsetJson(fields ...string) ([]byte, error)
- func (event ParsedEvent) GetSubsetMap(fields ...string) (map[string]interface{}, error)
- func (event ParsedEvent) GetUnstructEventValue(path ...interface{}) (interface{}, error)
- func (event ParsedEvent) GetValue(field string) (interface{}, error)
- func (event ParsedEvent) ToJson() ([]byte, error)
- func (event ParsedEvent) ToJsonWithGeo() ([]byte, error)
- func (event ParsedEvent) ToMap() (map[string]interface{}, error)
- func (event ParsedEvent) ToMapWithGeo() (map[string]interface{}, error)
- type SchemaParts
- type SelfDescribingData
- type UnstructEvent
- type ValueParser
Constants ¶
const (
EmptyFieldErr string = `Field is empty`
)
const SCHEMA_URI_REGEX string = `` /* 162-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Contexts ¶
type Contexts struct { Schema string Data []SelfDescribingData }
type KeyFunctionPair ¶
type KeyFunctionPair struct { Key string ParseFunction ValueParser }
type ParsedEvent ¶
type ParsedEvent []string
func ParseEvent ¶
func ParseEvent(event string) (ParsedEvent, error)
ParseEvent takes a Snowplow Enriched event tsv string as input, and returns a 'ParsedEvent' typed slice of strings. Methods may then be called on the resulting ParsedEvent type to transform the event, or a subset of the event to Map or Json.
func (ParsedEvent) GetContextValue ¶ added in v0.2.0
func (event ParsedEvent) GetContextValue(contextName string, path ...interface{}) (interface{}, error)
GetContextValue returns the value for a provided atomic field inside an event's contexts or derived_contexts
func (ParsedEvent) GetSubsetJson ¶
func (event ParsedEvent) GetSubsetJson(fields ...string) ([]byte, error)
GetSubsetJson returns a JSON object containing a subset of the event, containing only the atomic fields provided, without processing the rest of the event. For custom events and contexts, only "unstruct_event", "contexts", or "derived_contexts" may be provided, which will produce the entire data object for that field. For contexts, the resultant map will contain all occurrences of all contexts within the provided field.
func (ParsedEvent) GetSubsetMap ¶
func (event ParsedEvent) GetSubsetMap(fields ...string) (map[string]interface{}, error)
GetSubsetMap returns a map of a subset of the event, containing only the atomic fields provided, without processing the rest of the event. For custom events and contexts, only "unstruct_event", "contexts", or "derived_contexts" may be provided, which will produce the entire data object for that field. For contexts, the resultant map will contain all occurrences of all contexts within the provided field.
func (ParsedEvent) GetUnstructEventValue ¶ added in v0.2.0
func (event ParsedEvent) GetUnstructEventValue(path ...interface{}) (interface{}, error)
GetUnstructEventValue returns the value for a provided atomic field inside an event's unstruct_event field
func (ParsedEvent) GetValue ¶
func (event ParsedEvent) GetValue(field string) (interface{}, error)
GetValue returns the value for a provided atomic field, without processing the rest of the event. For unstruct_event, it returns a map of only the data for the unstruct event.
func (ParsedEvent) ToJson ¶
func (event ParsedEvent) ToJson() ([]byte, error)
ToJson transforms a valid Snowplow ParsedEvent to a JSON object.
func (ParsedEvent) ToJsonWithGeo ¶
func (event ParsedEvent) ToJsonWithGeo() ([]byte, error)
ToJsonWithGeo adds the geo_location field, and transforms a valid Snowplow ParsedEvent to a JSON object.
func (ParsedEvent) ToMap ¶
func (event ParsedEvent) ToMap() (map[string]interface{}, error)
ToMap transforms a valid Snowplow ParsedEvent to a Go map.
func (ParsedEvent) ToMapWithGeo ¶
func (event ParsedEvent) ToMapWithGeo() (map[string]interface{}, error)
ToMapWithGeo adds the geo_location field, and transforms a valid Snowplow ParsedEvent to a Go map.
type SchemaParts ¶
type SelfDescribingData ¶
type UnstructEvent ¶
type UnstructEvent struct { Schema string Data SelfDescribingData }