Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDBSession ¶
NewDBSession returns a mongoDB session
Types ¶
type Event ¶
type Event struct { ID string `json:"eventId" bson:"_id"` Stream int32 `json:"stream"` Time ZeroableTime `json:"eventTime"` Type string `json:"eventType"` TypeVersion string `json:"eventTypeVersion"` CEVersion string `json:"cloudEventVersion"` Source string `json:"eventSource"` Subject string `json:"eventSubject"` Acknowledged ZeroableTime `json:"eventAcknowledged,omitempty"` Metadata map[string]string `json:"extensions,omitempty"` ContentType string `json:"contentType,omitempty"` Data []byte `json:"data,omitempty"` }
Event is the main event structure for all events throughout the system TODO(tcfw) move to protobuf?
func (*Event) SetDataFromString ¶
SetDataFromString converts a string to bytes and stores in data
func (*Event) SetDataFromStruct ¶
SetDataFromStruct converts a struct to JSON as raw bytes to be stored
func (*Event) ToProtobuf ¶
ToProtobuf converts structed event to protobuf event
type ZeroableTime ¶
ZeroableTime converts to "null" string for zero times when converting to JSON
func (ZeroableTime) MarshalJSON ¶
func (t ZeroableTime) MarshalJSON() ([]byte, error)
MarshalJSON converts struct to JSON type
Directories ¶
Path | Synopsis |
---|---|
Package evntsrc_event is a generated protocol buffer package.
|
Package evntsrc_event is a generated protocol buffer package. |
github.com/tcfw/evntsrc
Package evntsrc is a generated protocol buffer package.
|
Package evntsrc is a generated protocol buffer package. |
github.com/tcfw/evntsrc/internal/event/protos
Package protos is a generated protocol buffer package.
|
Package protos is a generated protocol buffer package. |
Click to show internal directories.
Click to hide internal directories.