codec

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EventType is a the type for Event.
	EventType eh.EventType = "CodecEvent"
)

Variables

This section is empty.

Functions

func EventCodecAcceptanceTest

func EventCodecAcceptanceTest(t *testing.T, c eh.EventCodec, expectedBytes []byte)

EventCodecAcceptanceTest is the acceptance test that all implementations of Codec should pass. It should manually be called from a test case in each implementation:

func TestEventCodec(t *testing.T) {
    c := EventCodec{}
    expectedBytes = []byte("")
    eventbus.AcceptanceTest(t, c, expectedBytes)
}

Types

type EventData

type EventData struct {
	Bool       bool
	String     string
	Number     float64
	Slice      []string
	Map        map[string]interface{}
	Time       time.Time
	TimeRef    *time.Time
	NullTime   *time.Time
	Struct     Nested
	StructRef  *Nested
	NullStruct *Nested
}

EventData is a mocked event data, useful in testing.

type Nested

type Nested struct {
	Bool   bool
	String string
	Number float64
}

Nested is nested event data

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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