types

package
v0.0.0-...-0ade494 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2022 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CORE_REPORTING_CLIENT      = "core"
	WAREHOUSE_REPORTING_CLIENT = "warehouse"

	SUPPORTED_TRANSFORMER_API_VERSION = 2

	DEFAULT_REPORTING_ENABLED = true
	DEFAULT_REPLAY_ENABLED    = false
)

Variables

View Source
var (
	DiffStatus = "diff"

	// Module names
	GATEWAY                = "gateway"
	DESTINATION_FILTER     = "destination_filter"
	TRACKINGPLAN_VALIDATOR = "tracking_plan_validator"
	USER_TRANSFORMER       = "user_transformer"
	EVENT_FILTER           = "event_filter"
	DEST_TRANSFORMER       = "dest_transformer"
	ROUTER                 = "router"
	BATCH_ROUTER           = "batch_router"
	WAREHOUSE              = "warehouse"
)

Functions

func AssertSameKeys

func AssertSameKeys(m1 map[string]*ConnectionDetails, m2 map[string]*StatusDetail)

Types

type Client

type Client struct {
	Config
	DbHandle *sql.DB
}

type Config

type Config struct {
	ClientName string
	ConnInfo   string
}

type ConfigEnvI

type ConfigEnvI interface {
	ReplaceConfigWithEnvVariables(workspaceConfig []byte) (updatedConfig []byte)
}

ConfigEnvI is interface to inject env variables into config

type ConfigT

type ConfigT map[string]interface{}

ConfigT simple map config structure

type ConnectionDetails

type ConnectionDetails struct {
	SourceID                string `json:"sourceId"`
	DestinationID           string `json:"destinationId"`
	SourceBatchID           string `json:"sourceBatchId"`
	SourceTaskID            string `json:"sourceTaskId"`
	SourceTaskRunID         string `json:"sourceTaskRunId"`
	SourceJobID             string `json:"sourceJobId"`
	SourceJobRunID          string `json:"sourceJobRunId"`
	SourceDefinitionId      string `json:"sourceDefinitionId"`
	DestinationDefinitionId string `string:"destinationDefinitionId"`
	SourceCategory          string `json:"sourceCategory"`
}

func CreateConnectionDetail

func CreateConnectionDetail(sid, did, sbid, stid, strid, sjid, sjrid, sdid, ddid, sc string) *ConnectionDetails

type EventSchemasI

type EventSchemasI interface {
	RecordEventSchema(writeKey, eventBatch string) bool
	GetEventModels(w http.ResponseWriter, r *http.Request)
	GetEventVersions(w http.ResponseWriter, r *http.Request)
	GetSchemaVersionMetadata(w http.ResponseWriter, r *http.Request)
	GetSchemaVersionMissingKeys(w http.ResponseWriter, r *http.Request)
	GetKeyCounts(w http.ResponseWriter, r *http.Request)
	GetEventModelMetadata(w http.ResponseWriter, r *http.Request)
	GetJsonSchemas(w http.ResponseWriter, r *http.Request)
}

EventSchemasI is interface to access EventSchemas feature

type GatewayBatchRequestT

type GatewayBatchRequestT struct {
	Batch []SingularEventT `json:"batch"`
}

GatewayBatchRequestT batch request structure

type InstanceDetails

type InstanceDetails struct {
	WorkspaceID string `json:"workspaceId"`
	Namespace   string `json:"namespace"`
	InstanceID  string `json:"instanceId"`
}

type Metric

type Metric struct {
	InstanceDetails
	ConnectionDetails
	PUDetails
	ReportMetadata
	StatusDetails []*StatusDetail `json:"reports"`
}

type PUDetails

type PUDetails struct {
	InPU       string `json:"inReportedBy"`
	PU         string `json:"reportedBy"`
	TerminalPU bool   `json:"terminalState"`
	InitialPU  bool   `json:"initialState"`
}

func CreatePUDetails

func CreatePUDetails(inPU, pu string, terminalPU, initialPU bool) *PUDetails

type PUReportedMetric

type PUReportedMetric struct {
	ConnectionDetails
	PUDetails
	StatusDetail *StatusDetail
}

type ReportByStatus

type ReportByStatus struct {
	InstanceDetails
	ConnectionDetails
	PUDetails
	ReportMetadata
	StatusDetail *StatusDetail
}

type ReportMetadata

type ReportMetadata struct {
	ReportedAt int64 `json:"reportedAt"`
}

type ReportingI

type ReportingI interface {
	WaitForSetup(ctx context.Context, clientName string)
	AddClient(ctx context.Context, c Config)
	Report(metrics []*PUReportedMetric, txn *sql.Tx)
}

ReportingI is interface to report metrics

type SingularEventT

type SingularEventT map[string]interface{}

SingularEventT single event structrue

type SingularEventWithReceivedAt

type SingularEventWithReceivedAt struct {
	SingularEvent SingularEventT
	ReceivedAt    time.Time
}

type StatusDetail

type StatusDetail struct {
	Status         string          `json:"state"`
	Count          int64           `json:"count"`
	StatusCode     int             `json:"statusCode"`
	SampleResponse string          `json:"sampleResponse"`
	SampleEvent    json.RawMessage `json:"sampleEvent"`
	EventName      string          `json:"eventName"`
	EventType      string          `json:"eventType"`
}

func CreateStatusDetail

func CreateStatusDetail(status string, count int64, code int, resp string, event json.RawMessage, eventName, eventType string) *StatusDetail

type SuppressUserI

type SuppressUserI interface {
	IsSuppressedUser(userID, sourceID, writeKey string) bool
}

SuppressUserI is interface to access Suppress user feature

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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