Skip to content

Commit 4599262

Browse files
committed
Fix typo and grammar issues
1 parent bbc33a2 commit 4599262

20 files changed

+35
-35
lines changed

aggregate/aggregate.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ import (
1313
var ErrInvalidID = errors.New("goengine: an aggregate.ID must be a valid UUID")
1414

1515
type (
16-
// ID an UUID for a aggregate.Root instance
16+
// ID a UUID for a aggregate.Root instance
1717
ID string
1818

19-
// Root is a interface that a AggregateRoot must implement
19+
// Root is an interface that a AggregateRoot must implement
2020
Root interface {
2121
eventSourced
2222
eventProducer
@@ -27,7 +27,7 @@ type (
2727
AggregateID() ID
2828
}
2929

30-
// EventApplier is a interface so that a Changed event can be applied
30+
// EventApplier is an interface so that a Changed event can be applied
3131
EventApplier interface {
3232
// Apply updates the state of the aggregateRoot based on the recorded event
3333
// This method should only be called by the library
@@ -49,7 +49,7 @@ func GenerateID() ID {
4949
return ID(uuid.New().String())
5050
}
5151

52-
// IDFromString creates a ID from a string
52+
// IDFromString creates an ID from a string
5353
func IDFromString(str string) (ID, error) {
5454
id, err := uuid.Parse(str)
5555
if err != nil {

aggregate/aggregate_type.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ import (
77
"github.com/hellofresh/goengine/v2"
88
)
99

10-
// ErrInitiatorMustReturnRoot occurs when a aggregate.Initiator did not return a pointer
10+
// ErrInitiatorMustReturnRoot occurs when an aggregate.Initiator did not return a pointer
1111
var ErrInitiatorMustReturnRoot = errors.New("goengine: the aggregate.Initiator must return a pointer to the aggregate.Root")
1212

1313
type (
1414
// Initiator creates a new empty instance of a aggregate.Root
1515
// this instance may then be used to reconstitute the state of the aggregate root
1616
Initiator func() Root
1717

18-
// Type an aggregate type represent the type of a aggregate
18+
// Type an aggregate type represent the type of aggregate
1919
Type struct {
2020
name string
2121
initiator Initiator
@@ -50,7 +50,7 @@ func (t *Type) String() string {
5050
return t.name
5151
}
5252

53-
// IsImplementedBy returns whether the given aggregate root is a instance of this aggregateType
53+
// IsImplementedBy returns whether the given aggregate root is an instance of this aggregateType
5454
func (t *Type) IsImplementedBy(root interface{}) bool {
5555
if root == nil {
5656
return false
@@ -69,7 +69,7 @@ func (t *Type) IsImplementedBy(root interface{}) bool {
6969
return t.reflectionType == rootType
7070
}
7171

72-
// CreateInstance returns an new empty/zero instance of the aggregate root that the type represents
72+
// CreateInstance returns a new empty/zero instance of the aggregate root that the type represents
7373
func (t *Type) CreateInstance() Root {
7474
return t.initiator()
7575
}

aggregate/changed.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ var (
1919
ErrInvalidChangePayload = errors.New("goengine: a changed event must have a payload that is not nil")
2020
)
2121

22-
// Changed is a message indicating that a aggregate was changed
22+
// Changed is a message indicating that an aggregate was changed
2323
type Changed struct {
2424
uuid goengine.UUID
2525
aggregateID ID

aggregate/repository.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ func (r *Repository) GetAggregateRoot(ctx context.Context, aggregateID ID) (Root
100100
return root, nil
101101
}
102102

103-
// enrichEventMetadata add's aggregate_id and aggregate_type as metadata to domainEvent
103+
// enrichEventMetadata adds aggregate_id and aggregate_type as metadata to domainEvent
104104
func (r *Repository) enrichMetadata(aggregateEvent *Changed, aggregateID ID) *Changed {
105105
domainEvent := aggregateEvent.WithMetadata(IDKey, aggregateID)
106106
domainEvent = domainEvent.WithMetadata(TypeKey, r.aggregateType.String())

driver/generic/query_executor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"github.com/hellofresh/goengine/v2/metadata"
88
)
99

10-
// QueryExecutor is used to run a query against a inmemory event store
10+
// QueryExecutor is used to run a query against an inmemory event store
1111
type QueryExecutor struct {
1212
store goengine.EventStore
1313
streamName goengine.StreamName

driver/inmemory/eventstore.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ var (
2121
_ goengine.EventStore = &EventStore{}
2222
)
2323

24-
// EventStore a in memory event store implementation
24+
// EventStore an in memory event store implementation
2525
type EventStore struct {
2626
sync.RWMutex
2727

@@ -37,7 +37,7 @@ func NewEventStore(logger goengine.Logger) *EventStore {
3737
}
3838
}
3939

40-
// Create creates a event stream
40+
// Create creates an event stream
4141
func (i *EventStore) Create(ctx context.Context, streamName goengine.StreamName) error {
4242
if _, found := i.streams[streamName]; found {
4343
return ErrStreamExistsAlready

driver/inmemory/matcher.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ func (m *MetadataMatcher) Matches(metadata metadata.Metadata) bool {
101101

102102
// Matches returns true if the value satisfies the constraint
103103
func (c *metadataConstraint) Matches(val interface{}) (bool, error) {
104-
// Ensure the value's are of the same type
104+
// Ensure the values are of the same type
105105
if valType := reflect.TypeOf(val); valType != c.valueType {
106106
// The types do not match let's see if they can be converted
107107
if !valType.ConvertibleTo(c.valueType) {

driver/inmemory/payload_registry.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ var (
1616
_ goengine.MessagePayloadResolver = &PayloadRegistry{}
1717
)
1818

19-
// PayloadRegistry is a registry containing the mapping of an payload type to a event name
19+
// PayloadRegistry is a registry containing the mapping of a payload type to an event name
2020
type PayloadRegistry struct {
2121
typeMap map[string]string
2222
}

driver/sql/listener.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ package sql
22

33
import "context"
44

5-
// Listener listens to an event stream and triggers a notification when a event was appended
5+
// Listener listens to an event stream and triggers a notification when an event was appended
66
type Listener interface {
7-
// Listen starts listening to the event stream and call the trigger when a event was appended
7+
// Listen starts listening to the event stream and call the trigger when an event was appended
88
Listen(ctx context.Context, trigger ProjectionTrigger) error
99
}

driver/sql/postgres/advisory_lock_aggregate_projection_storage.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func NewAdvisoryLockAggregateProjectionStorage(
7878
`UPDATE %[1]s SET failed = TRUE WHERE aggregate_id = $1`,
7979
projectionTableQuoted,
8080
),
81-
// queryAcquireLock uses a `WITH` in order to insert if the projection is unknown other wise the row won't be locked
81+
// queryAcquireLock uses a `WITH` in order to insert if the projection is unknown otherwise the row won't be locked
8282
// The reason for using `INSERT SELECT` instead of `INSERT VALUES ON CONFLICT DO NOTHING` is that `ON CONFLICT` will
8383
// increase the `no SERIAL` value.
8484
queryAcquireLock: fmt.Sprintf(
@@ -120,7 +120,7 @@ func (a *AdvisoryLockAggregateProjectionStorage) PersistFailure(conn driverSQL.E
120120
}
121121

122122
// Acquire returns a driverSQL.ProjectorTransaction and the position of the projection within the event stream when a
123-
// lock is acquired for the specified aggregate_id. Otherwise an error is returned indicating why the lock could not be acquired.
123+
// lock is acquired for the specified aggregate_id. Otherwise, an error is returned indicating why the lock could not be acquired.
124124
func (a *AdvisoryLockAggregateProjectionStorage) Acquire(
125125
ctx context.Context,
126126
conn *sql.Conn,
@@ -153,7 +153,7 @@ func (a *AdvisoryLockAggregateProjectionStorage) Acquire(
153153

154154
if locked || failed {
155155
// The projection was locked by another process that died and for this reason not unlocked
156-
// In this case a application needs to decide what to do to avoid invalid projection states
156+
// In this case an application needs to decide what to do to avoid invalid projection states
157157
if err := a.releaseProjectionConnectionLock(conn, aggregateID); err != nil {
158158
a.logger.Error("failed to release lock for a projection with a locked row", func(e goengine.LoggerEntry) {
159159
logFields(e)

0 commit comments

Comments
 (0)