cetransformer

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareErrors added in v0.4.0

func CompareErrors(t *testing.T, message string, actualError, wantedError error) bool

CompareErrors true if events are "equal"

func CompareEvents added in v0.4.0

func CompareEvents(t *testing.T, message string, actualEvent, wantedEvent cloudevents.Event) bool

CompareEvents true if events are "equal"

func CompareResponses added in v0.4.0

func CompareResponses(t *testing.T, message string, actualResponse, wantedResponse http.Response) bool

CompareResponses true if events are "equal"

func EventToMap added in v0.4.0

func EventToMap(event *cloudevents.Event) map[string]interface{}

EventToMap Transform a cloudevent to input data

func NewEventWithJSONStringData added in v0.4.0

func NewEventWithJSONStringData(jsonData string, st ...string) cloudevents.Event

NewEventWithJSONStringData jsonDataString, source,type,id

func NewEventWithMapData added in v0.4.0

func NewEventWithMapData(payload map[string]interface{}, st ...string) cloudevents.Event

NewEventWithMapData payload, source,type,id

func NewGETRequest added in v0.4.0

func NewGETRequest(url string) *http.Request

NewGETRequest bla

func NewReq added in v0.4.0

func NewReq(method string, header http.Header, url, body string) *http.Request

NewReq bla

func TransformBytesToEvent added in v0.4.0

func TransformBytesToEvent(eventMarshalled []byte, context cloudevents.EventContext) (*cloudevents.Event, error)

TransformBytesToEvent bla

func Unmarshal added in v0.4.0

func Unmarshal(source []byte, event *cloudevents.Event) error

Unmarshal an json string to a cloudevent with data in a map

Types

type CeClientMock added in v0.4.0

type CeClientMock struct {
	T                       *testing.T
	WantSend                bool
	WantSendEvent           cloudevents.Event
	ShouldThrowErrorOnStart error
	ShouldThrowErrorOnSend  error
}

CeClientMock mock ce client

func (*CeClientMock) Request added in v0.4.0

Request bla

func (*CeClientMock) Send added in v0.4.0

Send bla

func (*CeClientMock) StartReceiver added in v0.4.0

func (mm *CeClientMock) StartReceiver(ctx context.Context, fn interface{}) error

StartReceiver bla

type CloudEventTransformer

type CloudEventTransformer struct {
	// contains filtered or unexported fields
}

CloudEventTransformer bla

func NewCloudEventTransformer added in v0.4.0

func NewCloudEventTransformer(ceTemplate, resultSource, resultType string, debug bool) (*CloudEventTransformer, error)

NewCloudEventTransformer new instance of CloudEventTransformer ceTemplate,source, type, debug

func (*CloudEventTransformer) CreateEvent added in v0.4.0

func (ct *CloudEventTransformer) CreateEvent(input interface{}) (*cloudevents.Event, error)

CreateEvent bla

func (*CloudEventTransformer) PredicateEvent added in v0.3.0

func (ct *CloudEventTransformer) PredicateEvent(sourceEvent *cloudevents.Event) (bool, error)

PredicateEvent bla

func (*CloudEventTransformer) TransformEvent

func (ct *CloudEventTransformer) TransformEvent(sourceEvent *cloudevents.Event) (*cloudevents.Event, error)

TransformEvent bla

Jump to

Keyboard shortcuts

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