-
Notifications
You must be signed in to change notification settings - Fork 317
/
types.go
56 lines (46 loc) · 1.75 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//go:generate mockgen -destination=../../mocks/utils/types/mock_types.go -package mock_types github.com/rudderlabs/rudder-server/utils/types UserSuppression,ReportingI
package types
import (
"context"
"database/sql"
"net/http"
"time"
)
// SingularEventT single event structrue
type SingularEventT map[string]interface{}
type SingularEventWithReceivedAt struct {
SingularEvent SingularEventT
ReceivedAt time.Time
}
// GatewayBatchRequestT batch request structure
type GatewayBatchRequestT struct {
Batch []SingularEventT `json:"batch"`
}
// UserSuppression is interface to access Suppress user feature
type UserSuppression interface {
IsSuppressedUser(workspaceID, userID, sourceID string) bool
}
// EventSchemasI is interface to access EventSchemas feature
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)
}
// ConfigEnvI is interface to inject env variables into config
type ConfigEnvI interface {
ReplaceConfigWithEnvVariables(workspaceConfig []byte) (updatedConfig []byte)
}
// ReportingI is interface to report metrics
type ReportingI interface {
WaitForSetup(ctx context.Context, clientName string) error
AddClient(ctx context.Context, c Config)
Report(metrics []*PUReportedMetric, txn *sql.Tx)
IsPIIReportingDisabled(string) bool
}
// ConfigT simple map config structure
type ConfigT map[string]interface{}