Documentation ¶
Index ¶
Constants ¶
const ( EventNameKey = "eventName" EventRawDataKey = "rawEvent" )
const (
EventStreamRegistryModified = "stream_registry_modified"
)
Admin event and operation types.
const (
OperationStreamRegistration = "streamRegistration"
)
Variables ¶
var AdminEventSpec = []byte(`
{
"namespace": "geist",
"streamIdSuffix": "adminevents",
"description": "A built-in GEIST-internal admin notification stream. For example, when a new or updated spec is written to Registry db, Registry sends an event to pubsub, which are listened to by all GEIST deployments. This in turn makes Registries, not yet synchronized, load the new specs from db.",
"version": 1,
"source": {
"type": "pubsub",
"config": {
"topics": [
{
"env": "all",
"names": [
"geist-admin-events"
]
}
],
"subscription": {
"type": "unique"
}
}
},
"transform": {
"extractFields": [
{
"fields": [
{
"id": "eventName",
"jsonPath": "name"
},
{
"id": "rawEvent",
"type": "string"
}
]
}
]
},
"sink": {
"type": "admin"
}
}`)
var AdminEventSpecInMem = []byte(`
{
"namespace": "geist",
"streamIdSuffix": "adminevents-inmem",
"description": "When running Registry in-mem, there's no point in having cross-pod admin events, so this spec is a bare-bones naked one'",
"version": 1,
"source": {
"type": "geistapi"
},
"transform": {
"extractFields": [
{
"fields": [
{
"id": "eventName",
"jsonPath": "name"
},
{
"id": "rawEvent",
"type": "string"
}
]
}
]
},
"sink": {
"type": "admin"
}
}`)
var SpecRegistrationSpec = []byte(`
{
"namespace": "geist",
"streamIdSuffix": "specs",
"description": "A stream ingestion of GEIST Specs, with source set as GEIST REST API, no Transformation, and into a Firestore Sink (GEIST Registry).",
"version": 1,
"source": {
"type": "geistapi"
},
"transform": {
"extractFields": [
{
"fields": [
{
"id": "namespace",
"jsonPath": "namespace"
},
{
"id": "idSuffix",
"jsonPath": "streamIdSuffix"
},
{
"id": "description",
"jsonPath": "description"
},
{
"id": "version",
"jsonPath": "version",
"type": "integer"
},
{
"id": "disabled",
"jsonPath": "disabled",
"type": "bool"
},
{
"id": "rawEvent",
"type": "string"
}
]
}
]
},
"sink": {
"type": "firestore",
"config": {
"kinds": [
{
"name": "EtlSpec",
"entityNameFromIds": {
"ids": [
"namespace",
"idSuffix"
],
"delimiter": "-"
},
"properties": [
{
"id": "version",
"name": "version",
"index": true
},
{
"id": "description",
"name": "description",
"index": false
},
{
"id": "disabled",
"name": "disabled",
"index": true
},
{
"id": "rawEvent",
"name": "specData",
"index": false
}
]
}
]
}
}
}`)
SpecRegistrationSpec is the internal, built-in GEIST spec required for handling of GEIST specs themselves. It defines how specs can be received from the chosen Source, and where and how to store them. This spec cannot store itself into that repository for bootstrap reasons. We can have a number of these supported spec registration flows here, and it's up to the GEIST app service init to choose the appropriate one. We can easily change the spec reg flow to have GEIST spec deployments be done by sending specs to pubsub instead. Just switch spec.source.type to "pubsub" and add pubsub topic config.
var SpecRegistrationSpecInMem = []byte(`
{
"namespace": "geist",
"streamIdSuffix": "specs",
"description": "A stream ingestion of GEIST Specs, with source set as GEIST API, no Transformation, and no sink (specs stored in-memory).",
"version": 1,
"source": {
"type": "geistapi"
},
"transform": {
"extractFields": [
{
"fields": [
{
"id": "rawEvent",
"type": "string"
}
]
}
]
},
"sink": {
"type": "void",
"config": {
"properties": [
{
"key": "mode",
"value": "inMemRegistrySink"
}
]
}
}
}`)
SpecRegistrationSpecInMem is the in-mem alternative to SpecRegistrationSpec (see that one for more detailed doc)
Functions ¶
This section is empty.
Types ¶
type AdminEvent ¶
type AdminEvent struct { Name string `json:"name"` DateOccurred time.Time `json:"dateOccurred"` Version string `json:"version"` EventId string `json:"eventId"` Location Location `json:"location"` Data []AdminEventData `json:"data"` }
func NewAdminEvent ¶
func NewAdminEvent(name string, operation string, streamId string) AdminEvent
type AdminEventData ¶
type ChanEvent ¶
type ChanEvent struct { Event any // TODO: change to []byte ResultChannel chan ResultChanEvent }
type EventChannel ¶
type EventChannel chan ChanEvent
type RegStorageMode ¶
type RegStorageMode string
const ( RegStorageUndefined RegStorageMode = "" RegStorageNative RegStorageMode = "native" RegStorageInMemory RegStorageMode = "inmemory" RegStorageCustom RegStorageMode = "custom" )
type ResultChanEvent ¶
type ResultChannel ¶
type ResultChannel <-chan ResultChanEvent