Documentation ¶
Index ¶
- Constants
- func ErrorResponseMissingFieldEventID() (response *api.Error)
- func ErrorResponseMissingFieldEventTime() (response *api.Error)
- func ErrorResponseMissingFieldEventType() (response *api.Error)
- func ErrorResponseMissingFieldEventTypeVersion() (response *api.Error)
- func ErrorResponseMissingFieldSourceID() (response *api.Error)
- func ErrorResponseMissingFieldSpecVersion() (response *api.Error)
- func ErrorResponseWrongEventID() (response *api.Error)
- func ErrorResponseWrongEventTime() (response *api.Error)
- func ErrorResponseWrongEventType() (response *api.Error)
- func ErrorResponseWrongEventTypeVersion() (response *api.Error)
- func ErrorResponseWrongSourceID() (response *api.Error)
- func ErrorResponseWrongSpecVersion() (response *api.Error)
- func ValidatePublish(r *EventRequestV2, opts *api.EventOptions) *api.Error
- type AnyValue
- type CloudEventV3
- type EventRequestV2
- type Extensions
Constants ¶
const ( // FieldData value FieldData = "data" // FieldEventID value FieldEventID = "id" // FieldEventTime value FieldEventTime = "time" // FieldEventType value FieldEventType = "type" // FieldSpecVersion value FieldSpecVersion = "specversion" // FieldEventTypeVersion value FieldEventTypeVersion = "eventtypeversion" // FieldSourceID value FieldSourceID = "source" // AllowedEventIDChars regex AllowedEventIDChars = `^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$` // AllowedEventTypeVersionChars regex AllowedEventTypeVersionChars = `^[a-zA-Z0-9]+$` //SpecVersionV3 Value SpecVersionV3 = "0.3" )
const (
// ErrorMessageMissingSourceID represents the error message for `ErrorTypeMissingFieldOrHeader`
ErrorMessageMissingSourceID = "missing 'source' field in the json payload"
)
Variables ¶
This section is empty.
Functions ¶
func ErrorResponseMissingFieldEventID ¶
ErrorResponseMissingFieldEventID returns an API error instance for the missing field event type error.
func ErrorResponseMissingFieldEventTime ¶
ErrorResponseMissingFieldEventTime returns an API error instance for the missing field event time error.
func ErrorResponseMissingFieldEventType ¶
ErrorResponseMissingFieldEventType returns an API error instance for the missing field event type error.
func ErrorResponseMissingFieldEventTypeVersion ¶
ErrorResponseMissingFieldEventTypeVersion returns an API error instance for the missing field event type version error.
func ErrorResponseMissingFieldSourceID ¶
ErrorResponseMissingFieldSourceID returns an API error instance for the missing field source ID error.
func ErrorResponseMissingFieldSpecVersion ¶
ErrorResponseMissingFieldSpecVersion returns an API error instance for the missing field spec version error.
func ErrorResponseWrongEventID ¶
ErrorResponseWrongEventID returns an API error instance for the wrong event ID error.
func ErrorResponseWrongEventTime ¶
ErrorResponseWrongEventTime returns an API error instance for the wrong event time error.
func ErrorResponseWrongEventType ¶
ErrorResponseWrongEventType returns an API error instance for the wrong event type error.
func ErrorResponseWrongEventTypeVersion ¶
ErrorResponseWrongEventTypeVersion returns an API error instance for the wrong event type version error.
func ErrorResponseWrongSourceID ¶
ErrorResponseWrongSourceID returns an API error instance for the wrong source ID error.
func ErrorResponseWrongSpecVersion ¶
ErrorResponseWrongSpecVersion returns an API error instance for the wrong spec version error.
func ValidatePublish ¶
func ValidatePublish(r *EventRequestV2, opts *api.EventOptions) *api.Error
ValidatePublish validates a publish POST request
Types ¶
type CloudEventV3 ¶
type CloudEventV3 struct { EventRequestV2 Extensions Extensions `json:"extensions,omitempty"` }
CloudEventV3 represents the event to be persisted to NATS
type EventRequestV2 ¶
type EventRequestV2 struct { ID string `json:"id"` Source string `json:"source"` SpecVersion string `json:"specversion"` Type string `json:"type"` DataContentEncoding string `json:"datacontentencoding,omitempty"` TypeVersion string `json:"eventtypeversion"` Time string `json:"time"` Data AnyValue `json:"data"` }
EventRequestV2 represents a publish event CE v.3.0 request