Skip to content
This repository has been archived by the owner on Sep 29, 2024. It is now read-only.

Commit

Permalink
Add support for enginekit stubs to marshaler fixture.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmalloc committed Sep 26, 2024
1 parent dbea250 commit 1a03702
Show file tree
Hide file tree
Showing 5 changed files with 127 additions and 40 deletions.
2 changes: 1 addition & 1 deletion codec/internal/fixtures/conflicting/protobuf.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion codec/internal/fixtures/protobuf.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

142 changes: 114 additions & 28 deletions fixtures/marshaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"reflect"

"github.com/dogmatiq/dogma/fixtures"
"github.com/dogmatiq/enginekit/enginetest/stubs"
"github.com/dogmatiq/marshalkit"
"github.com/dogmatiq/marshalkit/codec"
"github.com/dogmatiq/marshalkit/codec/cbor"
Expand All @@ -17,34 +18,119 @@ var Marshaler marshalkit.Marshaler
func init() {
m, err := codec.NewMarshaler(
[]reflect.Type{
reflect.TypeOf(&fixtures.AggregateRoot{}),
reflect.TypeOf(&fixtures.ProcessRoot{}),
reflect.TypeOf(fixtures.MessageA{}),
reflect.TypeOf(fixtures.MessageB{}),
reflect.TypeOf(fixtures.MessageC{}),
reflect.TypeOf(fixtures.MessageD{}),
reflect.TypeOf(fixtures.MessageE{}),
reflect.TypeOf(fixtures.MessageF{}),
reflect.TypeOf(fixtures.MessageG{}),
reflect.TypeOf(fixtures.MessageH{}),
reflect.TypeOf(fixtures.MessageI{}),
reflect.TypeOf(fixtures.MessageJ{}),
reflect.TypeOf(fixtures.MessageK{}),
reflect.TypeOf(fixtures.MessageL{}),
reflect.TypeOf(fixtures.MessageM{}),
reflect.TypeOf(fixtures.MessageN{}),
reflect.TypeOf(fixtures.MessageO{}),
reflect.TypeOf(fixtures.MessageP{}),
reflect.TypeOf(fixtures.MessageQ{}),
reflect.TypeOf(fixtures.MessageR{}),
reflect.TypeOf(fixtures.MessageS{}),
reflect.TypeOf(fixtures.MessageT{}),
reflect.TypeOf(fixtures.MessageU{}),
reflect.TypeOf(fixtures.MessageV{}),
reflect.TypeOf(fixtures.MessageW{}),
reflect.TypeOf(fixtures.MessageX{}),
reflect.TypeOf(fixtures.MessageY{}),
reflect.TypeOf(fixtures.MessageZ{}),
reflect.TypeFor[*fixtures.AggregateRoot](),
reflect.TypeFor[*fixtures.ProcessRoot](),

reflect.TypeFor[fixtures.MessageA](),
reflect.TypeFor[fixtures.MessageB](),
reflect.TypeFor[fixtures.MessageC](),
reflect.TypeFor[fixtures.MessageD](),
reflect.TypeFor[fixtures.MessageE](),
reflect.TypeFor[fixtures.MessageF](),
reflect.TypeFor[fixtures.MessageG](),
reflect.TypeFor[fixtures.MessageH](),
reflect.TypeFor[fixtures.MessageI](),
reflect.TypeFor[fixtures.MessageJ](),
reflect.TypeFor[fixtures.MessageK](),
reflect.TypeFor[fixtures.MessageL](),
reflect.TypeFor[fixtures.MessageM](),
reflect.TypeFor[fixtures.MessageN](),
reflect.TypeFor[fixtures.MessageO](),
reflect.TypeFor[fixtures.MessageP](),
reflect.TypeFor[fixtures.MessageQ](),
reflect.TypeFor[fixtures.MessageR](),
reflect.TypeFor[fixtures.MessageS](),
reflect.TypeFor[fixtures.MessageT](),
reflect.TypeFor[fixtures.MessageU](),
reflect.TypeFor[fixtures.MessageV](),
reflect.TypeFor[fixtures.MessageW](),
reflect.TypeFor[fixtures.MessageX](),
reflect.TypeFor[fixtures.MessageY](),
reflect.TypeFor[fixtures.MessageZ](),

reflect.TypeFor[*stubs.AggregateRootStub](),
reflect.TypeFor[*stubs.ProcessRootStub](),

reflect.TypeFor[stubs.CommandStub[stubs.TypeA]](),
reflect.TypeFor[stubs.CommandStub[stubs.TypeB]](),
reflect.TypeFor[stubs.CommandStub[stubs.TypeC]](),
reflect.TypeFor[stubs.CommandStub[stubs.TypeD]](),
reflect.TypeFor[stubs.CommandStub[stubs.TypeE]](),
reflect.TypeFor[stubs.CommandStub[stubs.TypeF]](),
reflect.TypeFor[stubs.CommandStub[stubs.TypeG]](),
reflect.TypeFor[stubs.CommandStub[stubs.TypeH]](),
reflect.TypeFor[stubs.CommandStub[stubs.TypeI]](),
reflect.TypeFor[stubs.CommandStub[stubs.TypeJ]](),
reflect.TypeFor[stubs.CommandStub[stubs.TypeK]](),
reflect.TypeFor[stubs.CommandStub[stubs.TypeL]](),
reflect.TypeFor[stubs.CommandStub[stubs.TypeM]](),
reflect.TypeFor[stubs.CommandStub[stubs.TypeN]](),
reflect.TypeFor[stubs.CommandStub[stubs.TypeO]](),
reflect.TypeFor[stubs.CommandStub[stubs.TypeP]](),
reflect.TypeFor[stubs.CommandStub[stubs.TypeQ]](),
reflect.TypeFor[stubs.CommandStub[stubs.TypeR]](),
reflect.TypeFor[stubs.CommandStub[stubs.TypeS]](),
reflect.TypeFor[stubs.CommandStub[stubs.TypeT]](),
reflect.TypeFor[stubs.CommandStub[stubs.TypeU]](),
reflect.TypeFor[stubs.CommandStub[stubs.TypeV]](),
reflect.TypeFor[stubs.CommandStub[stubs.TypeW]](),
reflect.TypeFor[stubs.CommandStub[stubs.TypeX]](),
reflect.TypeFor[stubs.CommandStub[stubs.TypeY]](),
reflect.TypeFor[stubs.CommandStub[stubs.TypeZ]](),

reflect.TypeFor[stubs.EventStub[stubs.TypeA]](),
reflect.TypeFor[stubs.EventStub[stubs.TypeB]](),
reflect.TypeFor[stubs.EventStub[stubs.TypeC]](),
reflect.TypeFor[stubs.EventStub[stubs.TypeD]](),
reflect.TypeFor[stubs.EventStub[stubs.TypeE]](),
reflect.TypeFor[stubs.EventStub[stubs.TypeF]](),
reflect.TypeFor[stubs.EventStub[stubs.TypeG]](),
reflect.TypeFor[stubs.EventStub[stubs.TypeH]](),
reflect.TypeFor[stubs.EventStub[stubs.TypeI]](),
reflect.TypeFor[stubs.EventStub[stubs.TypeJ]](),
reflect.TypeFor[stubs.EventStub[stubs.TypeK]](),
reflect.TypeFor[stubs.EventStub[stubs.TypeL]](),
reflect.TypeFor[stubs.EventStub[stubs.TypeM]](),
reflect.TypeFor[stubs.EventStub[stubs.TypeN]](),
reflect.TypeFor[stubs.EventStub[stubs.TypeO]](),
reflect.TypeFor[stubs.EventStub[stubs.TypeP]](),
reflect.TypeFor[stubs.EventStub[stubs.TypeQ]](),
reflect.TypeFor[stubs.EventStub[stubs.TypeR]](),
reflect.TypeFor[stubs.EventStub[stubs.TypeS]](),
reflect.TypeFor[stubs.EventStub[stubs.TypeT]](),
reflect.TypeFor[stubs.EventStub[stubs.TypeU]](),
reflect.TypeFor[stubs.EventStub[stubs.TypeV]](),
reflect.TypeFor[stubs.EventStub[stubs.TypeW]](),
reflect.TypeFor[stubs.EventStub[stubs.TypeX]](),
reflect.TypeFor[stubs.EventStub[stubs.TypeY]](),
reflect.TypeFor[stubs.EventStub[stubs.TypeZ]](),

reflect.TypeFor[stubs.TimeoutStub[stubs.TypeA]](),
reflect.TypeFor[stubs.TimeoutStub[stubs.TypeB]](),
reflect.TypeFor[stubs.TimeoutStub[stubs.TypeC]](),
reflect.TypeFor[stubs.TimeoutStub[stubs.TypeD]](),
reflect.TypeFor[stubs.TimeoutStub[stubs.TypeE]](),
reflect.TypeFor[stubs.TimeoutStub[stubs.TypeF]](),
reflect.TypeFor[stubs.TimeoutStub[stubs.TypeG]](),
reflect.TypeFor[stubs.TimeoutStub[stubs.TypeH]](),
reflect.TypeFor[stubs.TimeoutStub[stubs.TypeI]](),
reflect.TypeFor[stubs.TimeoutStub[stubs.TypeJ]](),
reflect.TypeFor[stubs.TimeoutStub[stubs.TypeK]](),
reflect.TypeFor[stubs.TimeoutStub[stubs.TypeL]](),
reflect.TypeFor[stubs.TimeoutStub[stubs.TypeM]](),
reflect.TypeFor[stubs.TimeoutStub[stubs.TypeN]](),
reflect.TypeFor[stubs.TimeoutStub[stubs.TypeO]](),
reflect.TypeFor[stubs.TimeoutStub[stubs.TypeP]](),
reflect.TypeFor[stubs.TimeoutStub[stubs.TypeQ]](),
reflect.TypeFor[stubs.TimeoutStub[stubs.TypeR]](),
reflect.TypeFor[stubs.TimeoutStub[stubs.TypeS]](),
reflect.TypeFor[stubs.TimeoutStub[stubs.TypeT]](),
reflect.TypeFor[stubs.TimeoutStub[stubs.TypeU]](),
reflect.TypeFor[stubs.TimeoutStub[stubs.TypeV]](),
reflect.TypeFor[stubs.TimeoutStub[stubs.TypeW]](),
reflect.TypeFor[stubs.TimeoutStub[stubs.TypeX]](),
reflect.TypeFor[stubs.TimeoutStub[stubs.TypeY]](),
reflect.TypeFor[stubs.TimeoutStub[stubs.TypeZ]](),
},
[]codec.Codec{
&json.Codec{},
Expand Down
9 changes: 5 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
module github.com/dogmatiq/marshalkit

go 1.22
go 1.23

toolchain go1.22.5
toolchain go1.23.1

require (
github.com/dogmatiq/configkit v0.13.8
github.com/dogmatiq/dogma v0.14.2
github.com/dogmatiq/enginekit v0.11.0
github.com/dogmatiq/interopspec v0.5.4
github.com/fxamacker/cbor/v2 v2.7.0
github.com/jmalloc/gomegax v0.0.0-20200507221434-64fca4c0e03a
Expand All @@ -27,7 +28,7 @@ require (
golang.org/x/sys v0.24.0 // indirect
golang.org/x/text v0.17.0 // indirect
golang.org/x/tools v0.24.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect
google.golang.org/grpc v1.65.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect
google.golang.org/grpc v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ github.com/dogmatiq/configkit v0.13.8 h1:8VNNusYCi3AnwwQ8ZhZJLUCRJlJ5uz/yWTzXkBD
github.com/dogmatiq/configkit v0.13.8/go.mod h1:DKFr/17QHC0RBnzigNs0PSHf+uEPeYitDrQgy7kbcxY=
github.com/dogmatiq/dogma v0.14.2 h1:SrwuNGMbZ4W9jdxe9a9e7n1Fspo/dhsLLhMSVMdIQro=
github.com/dogmatiq/dogma v0.14.2/go.mod h1:9lyVA+6V2+E/exV0IrBOrkUiyFwIATEhv+b0vnB2umQ=
github.com/dogmatiq/enginekit v0.10.3 h1:56gLlryKud0qOjsLK80syH+V7mNT16UasVzoNxCofsw=
github.com/dogmatiq/enginekit v0.10.3/go.mod h1:fBxEGdHPT4C9M1qnYO4wGTzmtXe/EUaefIm5eJSjG7Y=
github.com/dogmatiq/enginekit v0.11.0 h1:CRI1ueX1KtVbkcrHF4nbE7EYxdeRFKfYZn98IrorkaY=
github.com/dogmatiq/enginekit v0.11.0/go.mod h1:gDEDVDPAYstWK262NzHWKknox5MncDguQu+XW769jY4=
github.com/dogmatiq/iago v0.4.0 h1:57nZqVT34IZxtCZEW/RFif7DNUEjMXgevfr/Mmd0N8I=
github.com/dogmatiq/iago v0.4.0/go.mod h1:fishMWBtzYcjgis6d873VTv9kFm/wHYLOzOyO9ECBDc=
github.com/dogmatiq/interopspec v0.5.4 h1:klyGPy16zUKJartJIJOBZ4JrQ4LxFiY3wgzFTTiNlDk=
Expand Down Expand Up @@ -72,10 +72,10 @@ golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24=
golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 h1:Zy9XzmMEflZ/MAaA7vNcoebnRAld7FsPW1EeBB7V0m8=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0=
google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc=
google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 h1:e7S5W7MGGLaSu8j3YjdezkZ+m1/Nm0uRVRMEMGk26Xs=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU=
google.golang.org/grpc v1.67.0 h1:IdH9y6PF5MPSdAntIcpjQ+tXO41pcQsfZV2RxtQgVcw=
google.golang.org/grpc v1.67.0/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
Expand Down

0 comments on commit 1a03702

Please sign in to comment.