api

package
v0.0.0-...-3dde56c Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SECRET_KEY string = GoDotEnvVariable("SECRET_KEY")

Functions

func AnalyticsBetweenDates

func AnalyticsBetweenDates(c *gin.Context)

Deprecated

func CORSMiddleware

func CORSMiddleware() gin.HandlerFunc

Middlewares

func CurrentSessions

func CurrentSessions(c *gin.Context)

CurrentSessions: Description: Return a list of the live sessions of a website Endpoint: /DJANGO/get_sessions/ Input:

host= website host
apikey= owner apikey
seconds= seconds behind to consider a visitor as a live session

Output:

results= Sessions filtered

func DBConnection

func DBConnection()

func GoDotEnvVariable

func GoDotEnvVariable(key string) string

use godot package to load/read the .env file and return the value of the key

func HeartBeats

func HeartBeats(c *gin.Context)

func RegisterApikey

func RegisterApikey(c *gin.Context)

NewApiKey

Description: Generate a new and unique apikey in database
Endpoint:
Input:
	secret_key: Authentication secret key
	end_date: End date of website track style "YYYY-mm-dd"
Output:
	JSON with results

func TemplateParser

func TemplateParser(template_name string, context map[string]string) string

CLIENT BROWSER ENDPOINTS

func Update_asked_location_websites

func Update_asked_location_websites(c *gin.Context)

Deprecated

func VisitorResults

func VisitorResults(c *gin.Context)

func VisitorScript

func VisitorScript(c *gin.Context)

Types

type AnalyticResult

type AnalyticResult struct {
	//Server stats
	Key           string
	Session_id    string
	Session_start string
	Session_end   string

	// Client stats
	Host         string
	Path         string
	Date         string
	Referrer     string
	ReferrerPath string
	Time         string
	Performance  float64
	Latitude     float64
	Longitude    float64
	IsPhone      bool
	Country      string
	City         string
	Region       string
	CountryCode  string
	Ip           string
	Browser      string
	OS           string
}

type ApiKey

type ApiKey struct {
	Key           string
	Websites      []string
	AskLocationTo []string
	EndDate       string
}

Jump to

Keyboard shortcuts

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