gob

package
v0.0.0-...-5b8d9f6 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Serializer

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

Serializer de/serializes events which have been bound to the serializer.

func New

func New(events ...es.Event) (*Serializer, error)

New constructs a new gob serializer and populates it with the specified events. Bind may be subsequently called to add more events.

func (*Serializer) Bind

func (s *Serializer) Bind(events ...es.Event) error

Bind registers the specified events with the serializer. Bind may be called multiple times.

func (*Serializer) MarshalAll

func (s *Serializer) MarshalAll(events ...es.Event) (es.History, error)

MarshalAll is a utility that marshals all the events provided into a History object

func (*Serializer) MarshalEvent

func (s *Serializer) MarshalEvent(v es.Event) (es.Record, error)

MarshalEvent marshals the event into a Record which can be stored.

func (*Serializer) UnmarshalEvent

func (s *Serializer) UnmarshalEvent(record es.Record) (es.Event, error)

UnmarshalEvent converts the persistent type, Record, into an Event instance

Jump to

Keyboard shortcuts

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