store

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: 9 Imported by: 0

Documentation

Overview

Package store reads total article views from DynamoDB article table (reader) and publishes to the websocket

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClient

func GetClient() (*dynamodb.DynamoDB, error)

GetClient creates a dynamodb client to connect to acsess the datastore

func IsDomain

func IsDomain(ref string) bool

IsDomain checks whether referrer value is same as domain origin

func UpdateReferrerTable

func UpdateReferrerTable(data process.AnalyticsData) error

UpdateReferrerTable only updates the table if referrer is external and not null

Types

type ArticleViews

type ArticleViews struct {
	UniqueViews int `json:"uniqueViews"`
}

ArticleViews represents stats read from table

func GetArticleViews

func GetArticleViews(articleID string) (ArticleViews, error)

GetArticleViews queries the article table and returns the value of total views for an article

Jump to

Keyboard shortcuts

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