Skip to content

Commit ced3bc8

Browse files
committed
remove superfluous interface from old impl
1 parent 26e2916 commit ced3bc8

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

boundary.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
)
1616

1717
type Config struct {
18-
RuleEngine rules.Evaluator
18+
RuleEngine rules.Engine
1919
Auditor audit.Auditor
2020
TLSConfig *tls.Config
2121
Logger *slog.Logger

proxy/proxy.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020

2121
// Server handles HTTP and HTTPS requests with rule-based filtering
2222
type Server struct {
23-
ruleEngine rules.Evaluator
23+
ruleEngine rules.Engine
2424
auditor audit.Auditor
2525
logger *slog.Logger
2626
tlsConfig *tls.Config
@@ -33,7 +33,7 @@ type Server struct {
3333
// Config holds configuration for the proxy server
3434
type Config struct {
3535
HTTPPort int
36-
RuleEngine rules.Evaluator
36+
RuleEngine rules.Engine
3737
Auditor audit.Auditor
3838
Logger *slog.Logger
3939
TLSConfig *tls.Config

rules/rules.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ import (
88
"strings"
99
)
1010

11-
type Evaluator interface {
12-
Evaluate(method, url string) Result
13-
}
14-
1511
// Rule represents an allow rule with optional HTTP method restrictions
1612
type Rule struct {
1713

@@ -403,8 +399,8 @@ type Engine struct {
403399
}
404400

405401
// NewRuleEngine creates a new rule engine
406-
func NewRuleEngine(rules []Rule, logger *slog.Logger) *Engine {
407-
return &Engine{
402+
func NewRuleEngine(rules []Rule, logger *slog.Logger) Engine {
403+
return Engine{
408404
rules: rules,
409405
logger: logger,
410406
}

0 commit comments

Comments
 (0)