Documentation ¶
Index ¶
Constants ¶
View Source
const ( ApplicationJson DataContentType = "application/json" V102 SpecVersion = "1.0.2" )
Variables ¶
This section is empty.
Functions ¶
func ValidatePayload ¶
func ValidatePayload(p KafkaEnvelope) error
Types ¶
type DataContentType ¶
type DataContentType string
func (DataContentType) IsValid ¶
func (dct DataContentType) IsValid() error
type Envelope ¶
type Envelope[D any] struct { SpecVersion SpecVersion `json:"specversion"` Type string `json:"type"` Source URI `json:"source"` Id string `json:"id"` Time time.Time `json:"time"` DataContentType DataContentType `json:"datacontenttype"` Data D `json:"data"` }
TODO: Specify accepted data payload data type is generic, we accept any valid JSON for now
type KafkaEnvelope ¶
type KafkaEnvelope struct { Envelope[connectionhub.WsMessage] }
type SpecVersion ¶
type SpecVersion string
func (SpecVersion) IsValid ¶
func (sv SpecVersion) IsValid() error
Click to show internal directories.
Click to hide internal directories.