v2

package
v0.0.0-...-a52e8f6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 30, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
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"
)
View Source
const (
	// ErrorMessageMissingSourceID represents the error message for `ErrorTypeMissingFieldOrHeader`
	ErrorMessageMissingSourceID = "missing 'source' field in the json payload"
)

Variables

This section is empty.

Functions

func ErrorResponseMissingFieldEventID

func ErrorResponseMissingFieldEventID() (response *api.Error)

ErrorResponseMissingFieldEventID returns an API error instance for the missing field event type error.

func ErrorResponseMissingFieldEventTime

func ErrorResponseMissingFieldEventTime() (response *api.Error)

ErrorResponseMissingFieldEventTime returns an API error instance for the missing field event time error.

func ErrorResponseMissingFieldEventType

func ErrorResponseMissingFieldEventType() (response *api.Error)

ErrorResponseMissingFieldEventType returns an API error instance for the missing field event type error.

func ErrorResponseMissingFieldEventTypeVersion

func ErrorResponseMissingFieldEventTypeVersion() (response *api.Error)

ErrorResponseMissingFieldEventTypeVersion returns an API error instance for the missing field event type version error.

func ErrorResponseMissingFieldSourceID

func ErrorResponseMissingFieldSourceID() (response *api.Error)

ErrorResponseMissingFieldSourceID returns an API error instance for the missing field source ID error.

func ErrorResponseMissingFieldSpecVersion

func ErrorResponseMissingFieldSpecVersion() (response *api.Error)

ErrorResponseMissingFieldSpecVersion returns an API error instance for the missing field spec version error.

func ErrorResponseWrongEventID

func ErrorResponseWrongEventID() (response *api.Error)

ErrorResponseWrongEventID returns an API error instance for the wrong event ID error.

func ErrorResponseWrongEventTime

func ErrorResponseWrongEventTime() (response *api.Error)

ErrorResponseWrongEventTime returns an API error instance for the wrong event time error.

func ErrorResponseWrongEventType

func ErrorResponseWrongEventType() (response *api.Error)

ErrorResponseWrongEventType returns an API error instance for the wrong event type error.

func ErrorResponseWrongEventTypeVersion

func ErrorResponseWrongEventTypeVersion() (response *api.Error)

ErrorResponseWrongEventTypeVersion returns an API error instance for the wrong event type version error.

func ErrorResponseWrongSourceID

func ErrorResponseWrongSourceID() (response *api.Error)

ErrorResponseWrongSourceID returns an API error instance for the wrong source ID error.

func ErrorResponseWrongSpecVersion

func ErrorResponseWrongSpecVersion() (response *api.Error)

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 AnyValue

type AnyValue interface{}

AnyValue implements the service definition of AnyValue

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

type Extensions

type Extensions = map[string]interface{}

Extensions type

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL