Documentation ¶
Overview ¶
Package event_schema Handling HTTP requests to expose the schemas
Index ¶
- Constants
- func GetInstance() types.EventSchemasI
- func Init()
- func Init2()
- type CounterItem
- type CounterTypeT
- type EventIdentifier
- type EventModelMapT
- type EventModelT
- type EventPayloadT
- type EventSchemaManagerT
- func (manager *EventSchemaManagerT) GetEventModelMetadata(w http.ResponseWriter, r *http.Request)
- func (manager *EventSchemaManagerT) GetEventModels(w http.ResponseWriter, r *http.Request)
- func (manager *EventSchemaManagerT) GetEventVersions(w http.ResponseWriter, r *http.Request)
- func (manager *EventSchemaManagerT) GetJsonSchemas(w http.ResponseWriter, r *http.Request)
- func (manager *EventSchemaManagerT) GetKeyCounts(w http.ResponseWriter, r *http.Request)
- func (manager *EventSchemaManagerT) GetSchemaVersionMetadata(w http.ResponseWriter, r *http.Request)
- func (manager *EventSchemaManagerT) GetSchemaVersionMissingKeys(w http.ResponseWriter, r *http.Request)
- func (*EventSchemaManagerT) NewSchemaVersion(versionID string, schema map[string]string, schemaHash, eventModelID string) *SchemaVersionT
- func (*EventSchemaManagerT) RecordEventSchema(writeKey, eventBatch string) bool
- func (manager *EventSchemaManagerT) Setup()
- type EventT
- type EventType
- type FrequencyCounter
- type GatewayEventBatchT
- type JSPropertyT
- type JSPropertyTypeT
- type JsonSchemaT
- type MetaDataT
- type OffloadedModelT
- type OffloadedSchemaVersionT
- type PrivateDataT
- type ReservoirSample
- type SchemaVersionMapT
- type SchemaVersionT
- type WriteKey
Constants ¶
const ( EVENT_MODELS_TABLE = "event_models" SCHEMA_VERSIONS_TABLE = "schema_versions" )
Variables ¶
This section is empty.
Functions ¶
func GetInstance ¶
func GetInstance() types.EventSchemasI
GetInstance returns an instance of EventSchemaManagerT
Types ¶
type CounterItem ¶
type CounterTypeT ¶
type CounterTypeT string
const ( LossyCount CounterTypeT = "LossyCount" StickySampler CounterTypeT = "StickySampler" )
type EventIdentifier ¶
type EventIdentifier string
type EventModelMapT ¶
type EventModelMapT map[WriteKey]map[EventType]map[EventIdentifier]*EventModelT
EventModelMapT : <writeKey, eventType, eventIdentifier> to EventModel Mapping
type EventModelT ¶
type EventModelT struct { ID int UUID string `json:"EventID"` WriteKey string `json:"WriteKey"` EventType string `json:"EventType"` EventIdentifier string `json:"EventIdentifier"` CreatedAt time.Time Schema json.RawMessage Metadata json.RawMessage `json:"-"` PrivateData json.RawMessage `json:"-"` LastSeen time.Time TotalCount int64 Archived bool // contains filtered or unexported fields }
EventModelT is a struct that represents EVENT_MODELS_TABLE
type EventPayloadT ¶
EventPayloadT : Generic type for gateway event payload
type EventSchemaManagerT ¶
type EventSchemaManagerT struct {
// contains filtered or unexported fields
}
EventSchemaManagerT handles all event-schemas related features
func (*EventSchemaManagerT) GetEventModelMetadata ¶
func (manager *EventSchemaManagerT) GetEventModelMetadata(w http.ResponseWriter, r *http.Request)
func (*EventSchemaManagerT) GetEventModels ¶
func (manager *EventSchemaManagerT) GetEventModels(w http.ResponseWriter, r *http.Request)
func (*EventSchemaManagerT) GetEventVersions ¶
func (manager *EventSchemaManagerT) GetEventVersions(w http.ResponseWriter, r *http.Request)
func (*EventSchemaManagerT) GetJsonSchemas ¶
func (manager *EventSchemaManagerT) GetJsonSchemas(w http.ResponseWriter, r *http.Request)
func (*EventSchemaManagerT) GetKeyCounts ¶
func (manager *EventSchemaManagerT) GetKeyCounts(w http.ResponseWriter, r *http.Request)
TODO: Complete this
func (*EventSchemaManagerT) GetSchemaVersionMetadata ¶
func (manager *EventSchemaManagerT) GetSchemaVersionMetadata(w http.ResponseWriter, r *http.Request)
func (*EventSchemaManagerT) GetSchemaVersionMissingKeys ¶
func (manager *EventSchemaManagerT) GetSchemaVersionMissingKeys(w http.ResponseWriter, r *http.Request)
func (*EventSchemaManagerT) NewSchemaVersion ¶
func (*EventSchemaManagerT) NewSchemaVersion(versionID string, schema map[string]string, schemaHash, eventModelID string) *SchemaVersionT
NewSchemaVersion should be used when a schemaVersion is not found in its cache and requires, a schemaVersionID for the newSchema and the eventModelID to which it belongs along with schema and schemaHash
func (*EventSchemaManagerT) RecordEventSchema ¶
func (*EventSchemaManagerT) RecordEventSchema(writeKey, eventBatch string) bool
RecordEventSchema : Records event schema for every event in the batch
func (*EventSchemaManagerT) Setup ¶
func (manager *EventSchemaManagerT) Setup()
type FrequencyCounter ¶
type FrequencyCounter struct { Name string CounterType CounterTypeT Counter countish.LossyCounter }
func NewFrequencyCounter ¶
func NewFrequencyCounter(name string) *FrequencyCounter
func NewPeristedFrequencyCounter ¶
func NewPeristedFrequencyCounter(persistedFc *FrequencyCounter) *FrequencyCounter
func (*FrequencyCounter) ItemsAboveThreshold ¶
func (fc *FrequencyCounter) ItemsAboveThreshold() []countish.Entry
func (*FrequencyCounter) Observe ¶
func (fc *FrequencyCounter) Observe(key *string)
type GatewayEventBatchT ¶
type GatewayEventBatchT struct {
// contains filtered or unexported fields
}
GatewayEventBatchT : Type sent from gateway
type JSPropertyT ¶
type JSPropertyT struct {
Property map[string]interface{} `json:"properties"`
}
type JSPropertyTypeT ¶
type JSPropertyTypeT struct {
Type []string `json:"type"`
}
type JsonSchemaT ¶
type MetaDataT ¶
type MetaDataT struct { SampledEvents []interface{} TotalCount int64 Counters map[string][]*CounterItem `json:"FrequentValues"` }
type OffloadedModelT ¶
type OffloadedSchemaVersionT ¶
type PrivateDataT ¶
type PrivateDataT struct {
FrequencyCounters []*FrequencyCounter
}
type ReservoirSample ¶
type ReservoirSample struct {
// contains filtered or unexported fields
}
func NewReservoirSampler ¶
func NewReservoirSampler(reservoirSize, currSize int, totalCount int64) (rs *ReservoirSample)
type SchemaVersionMapT ¶
type SchemaVersionMapT map[string]map[string]*SchemaVersionT
SchemaVersionMapT : <event_model_id, schema_hash> to SchemaVersion Mapping
type SchemaVersionT ¶
type SchemaVersionT struct { ID int64 UUID string `json:"VersionID"` SchemaHash string `json:"-"` EventModelID string Schema json.RawMessage Metadata json.RawMessage `json:"-"` PrivateData json.RawMessage `json:"-"` FirstSeen time.Time LastSeen time.Time TotalCount int64 Archived bool // contains filtered or unexported fields }
SchemaVersionT is a struct that represents SCHEMA_VERSIONS_TABLE