serializer

package
v0.0.0-...-4a59535 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventSerializationResult

type EventSerializationResult struct {
	Data        []byte
	ContentType string
}

type EventSerializer

type EventSerializer interface {
	Serialize(event domain.IDomainEvent) (*EventSerializationResult, error)
	SerializeObject(event interface{}) (*EventSerializationResult, error)
	Deserialize(data []byte, eventType string, contentType string) (domain.IDomainEvent, error)
	DeserializeObject(data []byte, eventType string, contentType string) (interface{}, error)
	DeserializeType(data []byte, eventType reflect.Type, contentType string) (domain.IDomainEvent, error)
	ContentType() string
	Serializer() Serializer
}

type MessageSerializer

type MessageSerializer interface {
	Serialize(message types.IMessage) (*EventSerializationResult, error)
	SerializeObject(message interface{}) (*EventSerializationResult, error)
	SerializeEnvelop(messageEnvelop types.MessageEnvelope) (*EventSerializationResult, error)
	Deserialize(data []byte, messageType string, contentType string) (types.IMessage, error)
	DeserializeObject(data []byte, messageType string, contentType string) (interface{}, error)
	DeserializeType(data []byte, messageType reflect.Type, contentType string) (types.IMessage, error)
	ContentType() string
	Serializer() Serializer
}

type MetadataSerializer

type MetadataSerializer interface {
	Serialize(meta metadata.Metadata) ([]byte, error)
	Deserialize(bytes []byte) (metadata.Metadata, error)
}

type Serializer

type Serializer interface {
	Marshal(v interface{}) ([]byte, error)
	Unmarshal(data []byte, v interface{}) error
	UnmarshalFromJson(data string, v interface{}) error
	DecodeWithMapStructure(
		input interface{},
		output interface{},
	) error
	UnmarshalToMap(data []byte, v *map[string]interface{}) error
	UnmarshalToMapFromJson(data string, v *map[string]interface{}) error
	PrettyPrint(data interface{}) string
	ColoredPrettyPrint(data interface{}) string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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