process

package
v0.0.0-...-e984984 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package process tags received events

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Sort

func Sort(data Event) (string, string, error)

Sort processes and tags received events for publishing to SNS Identifies page url, tags it, marshals it and returns the tag and json formatted data (eventTag, data)

Types

type AnalyticsData

type AnalyticsData struct {
	ArticleID    string
	ArticleTitle string
	PreviousPage string
	CurrentPage  string
	ConnectionID string
	Refreshed    bool
	Referrer     string
}

AnalyticsData is transformed data from IncomingData

func ValidateData

func ValidateData(data IncomingData, id string) (AnalyticsData, error)

ValidateData validates and stores incoming data and a connection ID

type Article

type Article struct {
	ArticleID    string
	ArticleTitle string
	Page
}

Article represents post view data

type Event

type Event interface {
	// contains filtered or unexported methods
}

Event contains functions for each received event

func FilterData

func FilterData(data AnalyticsData) Event

FilterData takes AnalyticsData struct, filters and maps the members into an Article or Page struct and returns an Event interface

type IncomingData

type IncomingData struct {
	ArticleID    string `json:"articleId,omitempty"`
	ArticleTitle string `json:"articleTitle,omitempty"`
	PreviousPage string `json:"previousPage"`
	CurrentPage  string `json:"currentPage"`
	Refreshed    bool   `json:"refreshed"`
	Referrer     string `json:"referrer"`
}

IncomingData represents page view event received

type Page

type Page struct {
	PreviousPage string
	CurrentPage  string
	ConnectionID string
	Refreshed    bool
	Referrer     string
}

Page represent structure of incoming page view data

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL