Skip to content

Commit

Permalink
Merge pull request #2 from thefabric-io/feat/unmarshaler
Browse files Browse the repository at this point in the history
feat: split marshaler and unmarshaler
  • Loading branch information
jasseem authored Nov 15, 2023
2 parents 55842ed + 5a82459 commit 43ddc42
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion eventsource.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func MarshalES(object any) ([]byte, error) {
}

func UnmarshalES(b []byte, object any) error {
if s, implements := object.(Marshaler); implements {
if s, implements := object.(Unmarshaler); implements {
return s.UnmarshalES(b, object)
}

Expand Down
3 changes: 3 additions & 0 deletions marshaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@ package eventsource

type Marshaler interface {
MarshalES() ([]byte, error)
}

type Unmarshaler interface {
UnmarshalES(b []byte, object any) error
}

0 comments on commit 43ddc42

Please sign in to comment.