Skip to content

Commit

Permalink
code style: wasm.WasmRuleBuilderFunc -> RuleBuilderFunc
Browse files Browse the repository at this point in the history
Signed-off-by: Guilherme Cassolato <[email protected]>
  • Loading branch information
guicassolato committed Oct 15, 2024
1 parent bdf7aa1 commit 5ed47f3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion controllers/ratelimit_workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func rateLimitClusterPatch(host string, port int) map[string]any {
}
}

func rateLimitWasmRuleBuilder(pathID string, effectivePolicy EffectiveRateLimitPolicy, state *sync.Map) wasm.WasmRuleBuilderFunc {
func rateLimitWasmRuleBuilder(pathID string, effectivePolicy EffectiveRateLimitPolicy, state *sync.Map) wasm.RuleBuilderFunc {
policiesInPath := kuadrantv1.PoliciesInPath(effectivePolicy.Path, isRateLimitPolicyAcceptedAndNotDeletedFunc(state))

Check warning on line 155 in controllers/ratelimit_workflow.go

View check run for this annotation

Codecov / codecov/patch

controllers/ratelimit_workflow.go#L154-L155

Added lines #L154 - L155 were not covered by tests

// assumes the path is always [gatewayclass, gateway, listener, httproute, httprouterule]
Expand Down
4 changes: 2 additions & 2 deletions pkg/wasm/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ func BuildWasmConfigForPolicies(policies []Policy) Config {
}
}

type WasmRuleBuilderFunc func(httpRouteMatch gatewayapiv1.HTTPRouteMatch, uniquePolicyRuleKey string, policyRule kuadrantv1.MergeableRule) (Rule, error)
type RuleBuilderFunc func(httpRouteMatch gatewayapiv1.HTTPRouteMatch, uniquePolicyRuleKey string, policyRule kuadrantv1.MergeableRule) (Rule, error)

func BuildWasmPoliciesForPath(pathID string, path []machinery.Targetable, policyRules map[string]kuadrantv1.MergeableRule, wasmRuleBuilder WasmRuleBuilderFunc) ([]kuadrantgatewayapi.HTTPRouteMatchConfig, error) {
func BuildWasmPoliciesForPath(pathID string, path []machinery.Targetable, policyRules map[string]kuadrantv1.MergeableRule, wasmRuleBuilder RuleBuilderFunc) ([]kuadrantgatewayapi.HTTPRouteMatchConfig, error) {

Check warning on line 46 in pkg/wasm/utils.go

View check run for this annotation

Codecov / codecov/patch

pkg/wasm/utils.go#L46

Added line #L46 was not covered by tests
// assumes the path is always [gatewayclass, gateway, listener, httproute, httprouterule]
listener, _ := path[2].(*machinery.Listener)
httpRoute, _ := path[3].(*machinery.HTTPRoute)
Expand Down

0 comments on commit 5ed47f3

Please sign in to comment.