helpers

package
v0.1.9-patch-02 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2020 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AliasPayload = `` /* 169-byte string literal not displayed */
View Source
var BQBatchPayload = `` /* 1004-byte string literal not displayed */
View Source
var BatchPayload = `` /* 1106-byte string literal not displayed */
View Source
var DTBatchPayload = `` /* 3199-byte string literal not displayed */
View Source
var DTSchema = map[string]map[string]string{
	"ginkgo": {
		"id":                          "string",
		"event":                       "string",
		"label":                       "string",
		"value":                       "int",
		"sent_at":                     "datetime",
		"uuid_ts":                     "datetime",
		"category":                    "string",
		"timestamp":                   "datetime",
		"context_ip":                  "string",
		"event_text":                  "string",
		"received_at":                 "datetime",
		"anonymous_id":                "string",
		"context_locale":              "string",
		"context_app_name":            "string",
		"context_app_build":           "string",
		"context_device_id":           "string",
		"context_user_agent":          "string",
		"original_timestamp":          "datetime",
		"context_app_version":         "string",
		"context_device_name":         "string",
		"context_device_model":        "string",
		"context_screen_width":        "int",
		"context_app_namespace":       "string",
		"context_screen_height":       "int",
		"context_screen_density":      "int",
		"context_network_carrier":     "string",
		"context_traits_anonymousId":  "string",
		"context_device_manufacturer": "string",
	},
	"tracks": {
		"id":                          "string",
		"event":                       "string",
		"sent_at":                     "datetime",
		"uuid_ts":                     "datetime",
		"timestamp":                   "datetime",
		"context_ip":                  "string",
		"event_text":                  "string",
		"received_at":                 "datetime",
		"anonymous_id":                "string",
		"context_locale":              "string",
		"context_app_name":            "string",
		"context_app_build":           "string",
		"context_device_id":           "string",
		"context_user_agent":          "string",
		"original_timestamp":          "datetime",
		"context_app_version":         "string",
		"context_device_name":         "string",
		"context_device_model":        "string",
		"context_screen_width":        "int",
		"context_app_namespace":       "string",
		"context_screen_height":       "int",
		"context_screen_density":      "int",
		"context_network_carrier":     "string",
		"context_traits_anonymousId":  "string",
		"context_device_manufacturer": "string",
	},
}
View Source
var DiffStringFormatBatchPayload = `` /* 1146-byte string literal not displayed */
View Source
var GroupPayload = `` /* 230-byte string literal not displayed */
View Source
var IdentifyPayload = `` /* 227-byte string literal not displayed */
View Source
var LoadedJson = `` /* 1150-byte string literal not displayed */
View Source
var PagePayload = `` /* 211-byte string literal not displayed */
View Source
var ScreenPayload = `` /* 170-byte string literal not displayed */
View Source
var TrackPayload = `` /* 164-byte string literal not displayed */

Functions

func AddKeyToJSON

func AddKeyToJSON(json string, key string, value interface{}) string

AddKeyToJSON adds a key and its value to the

func DeleteRowsInTable

func DeleteRowsInTable(dbHandle *sql.DB, table string)

func DownloadObject

func DownloadObject(location string, bucket string, file *os.File)

func FetchEventSchemaCount

func FetchEventSchemaCount(dbHandle *sql.DB) int

FetchEventSchemaCount returns count of event_uploads table TODO: Currently assuming that the config backend db is accessible from here. Change this to hit an endpoint to fetch the event schema count.

func GetConnectionString

func GetConnectionString() string

func GetDestinationIDsFromLoadFileTable

func GetDestinationIDsFromLoadFileTable(dbHandle *sql.DB, warehouseLoadFilesTable string, sourceID string) []string

func GetEventLoadFileData

func GetEventLoadFileData(dbHandle *sql.DB, warehouseLoadFilesTable string, eventName string, bucket string) string

func GetJobStatus

func GetJobStatus(dbHandle *sql.DB, prefix string, limit int, jobState string) []*jobsdb.JobStatusT

GetJobStatus returns job statuses (with a limit) across all tables with specified prefix

func GetJobStatusCount

func GetJobStatusCount(dbHandle *sql.DB, jobState string, prefix string) int

GetJobStatusCount returns count of job status across all tables with specified prefix

func GetJobsCount

func GetJobsCount(dbHandle *sql.DB, prefix string) int

GetJobsCount returns count of jobs across all tables with specified prefix

func GetLatestJobs

func GetLatestJobs(dbHandle *sql.DB, prefix string, limit int) []*jobsdb.JobT

GetLatestJobs returns jobs (with a limit) across all tables with specified prefix

func GetLoadFileTableName

func GetLoadFileTableName(dbHandle *sql.DB, warehouseLoadFilesTable string) []string

GetLoadFileTableName quereis table column form the warehouseLoadFilesTable provided

func GetTableNamesWithPrefix

func GetTableNamesWithPrefix(dbHandle *sql.DB, prefix string) []string

GetTableNamesWithPrefix returns all table names with specified prefix

func GetWarehouseSchema

func GetWarehouseSchema(dbHandle *sql.DB, warehouseSchemaTable string, sourceID string, destinationID string) map[string]map[string]string

func IsThisInThatSliceString

func IsThisInThatSliceString(smallSlice []string, bigSlice []string) bool

func RemoveKeyFromJSON

func RemoveKeyFromJSON(json string, keys ...string) string

RemoveKeyFromJSON returns the json with keys removed from the input json

func SameStringSlice

func SameStringSlice(x, y []string) bool

SameStringSlice checks if two slices have same strings in any order

func SendAliasRequest

func SendAliasRequest(userNameForBasicAuth, jsonPayload string) int

SendAliasRequest sends request to /v1/alias

func SendBatchRequest

func SendBatchRequest(userNameForBasicAuth, jsonPayload string) int

SendBatchRequest sends request to /v1/batch

func SendEventRequest

func SendEventRequest(options EventOptsT) int

SendEventRequest sends sample event.json with EventOptionsT overrides to gateway server

func SendGroupRequest

func SendGroupRequest(userNameForBasicAuth, jsonPayload string) int

SendGroupRequest sends request to /v1/group

func SendHealthRequest

func SendHealthRequest() []byte

SendHealthRequest sends health request

func SendIdentifyRequest

func SendIdentifyRequest(userNameForBasicAuth, jsonPayload string) int

SendIdentifyRequest sends request to /v1/identify

func SendLoadRequests

func SendLoadRequests()

SendLoadRequests Send bunch of requests to server

func SendPageRequest

func SendPageRequest(userNameForBasicAuth, jsonPayload string) int

SendPageRequest sends request to /v1/page

func SendRequest

func SendRequest(endPoint, userNameForBasicAuth, jsonPayload string) int

SendRequest sends jsonPayload to gateway server with userNameForBasicAuth in basic auth

func SendScreenRequest

func SendScreenRequest(userNameForBasicAuth, jsonPayload string) int

SendScreenRequest sends request to /v1/screen

func SendTrackRequest

func SendTrackRequest(userNameForBasicAuth, jsonPayload string) int

SendTrackRequest sends request to /v1/track

func SendVersionRequest

func SendVersionRequest() []byte

SendVersionRequest sends version request

Types

type EventOptsT

type EventOptsT struct {
	Integrations map[string]bool
	WriteKey     string
	ID           string
	MessageID    string
	GaVal        int
}

EventOptsT is the type specifying override options over sample event.json

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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