Skip to content

Commit

Permalink
Use more intuitive names for route set filters.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmalloc committed Oct 14, 2024
1 parent 872cff0 commit b667304
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 311 deletions.
51 changes: 0 additions & 51 deletions config/_configbuilder/aggregate.go

This file was deleted.

87 changes: 0 additions & 87 deletions config/_configbuilder/application.go

This file was deleted.

43 changes: 0 additions & 43 deletions config/_configbuilder/integration.go

This file was deleted.

43 changes: 0 additions & 43 deletions config/_configbuilder/process.go

This file was deleted.

56 changes: 0 additions & 56 deletions config/_configbuilder/projection.go

This file was deleted.

17 changes: 0 additions & 17 deletions config/_configbuilder/route.go

This file was deleted.

27 changes: 13 additions & 14 deletions config/routeset.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ func (s *RouteSet) merge(set RouteSet) {
// RouteSetFilter applies a filter to the routes within a [RouteSet].
type RouteSetFilter func(*routeSetFilters)

// WithRouteTypeFilter is a [RouteSetFilter] that limits results to routes with
// FilterByRouteType is a [RouteSetFilter] that limits results to routes with
// one of the given [RouteType] values.
func WithRouteTypeFilter(types ...RouteType) RouteSetFilter {
func FilterByRouteType(types ...RouteType) RouteSetFilter {
return func(f *routeSetFilters) {
f.routePredicates = append(
f.routePredicates,
Expand All @@ -138,9 +138,9 @@ func WithRouteTypeFilter(types ...RouteType) RouteSetFilter {
}
}

// WithRouteDirectionFilter is a [RouteSetFilter] that limits results to routes
// FilterByRouteDirection is a [RouteSetFilter] that limits results to routes
// with a [RouteDirection] that matches one of the given directions bit-masks.
func WithRouteDirectionFilter(directions ...RouteDirection) RouteSetFilter {
func FilterByRouteDirection(directions ...RouteDirection) RouteSetFilter {
return func(f *routeSetFilters) {
f.routePredicates = append(
f.routePredicates,
Expand All @@ -156,9 +156,9 @@ func WithRouteDirectionFilter(directions ...RouteDirection) RouteSetFilter {
}
}

// WithMessageKindFilter is a [RouteSetFilter] that limits results to routes
// with a [message.Kind] that matches one of the given kinds.
func WithMessageKindFilter(kinds ...message.Kind) RouteSetFilter {
// FilterByMessageKind is a [RouteSetFilter] that limits results to routes with
// a [message.Kind] that matches one of the given kinds.
func FilterByMessageKind(kinds ...message.Kind) RouteSetFilter {
return func(f *routeSetFilters) {
f.routePredicates = append(
f.routePredicates,
Expand All @@ -169,9 +169,9 @@ func WithMessageKindFilter(kinds ...message.Kind) RouteSetFilter {
}
}

// WithMessageTypeFilter is a [RouteSetFilter] that limits results to routes
// FilterByMessageType is a [RouteSetFilter] that limits results to routes
// with a [message.Type] that matches one of the given types.
func WithMessageTypeFilter(kinds ...message.Kind) RouteSetFilter {
func FilterByMessageType(kinds ...message.Kind) RouteSetFilter {
return func(f *routeSetFilters) {
f.routePredicates = append(
f.routePredicates,
Expand All @@ -182,11 +182,10 @@ func WithMessageTypeFilter(kinds ...message.Kind) RouteSetFilter {
}
}

// WithMessageDirectionFilter is a [RouteSetFilter] that limits results to
// routes for message types that have a [RouteDirection] that matches one of the
// given directions bit-masks, when considering all routes for that message
// type.
func WithMessageDirectionFilter(directions ...RouteDirection) RouteSetFilter {
// FilterByMessageDirection is a [RouteSetFilter] that limits results to routes
// for message types that have a [RouteDirection] that matches one of the given
// directions bit-masks, when considering all routes for that message type.
func FilterByMessageDirection(directions ...RouteDirection) RouteSetFilter {
return func(f *routeSetFilters) {
f.messagePredicates = append(
f.messagePredicates,
Expand Down

0 comments on commit b667304

Please sign in to comment.