Skip to content

Commit

Permalink
MINOR: add acls, http-request, http-response, http-after-response, tc…
Browse files Browse the repository at this point in the history
…p-request to defaults

Now that we have only named defaults, we can add all those to defaults
  • Loading branch information
hdurand0710 committed Jun 12, 2024
1 parent 14be787 commit 00dddab
Show file tree
Hide file tree
Showing 7 changed files with 4,211 additions and 1,074 deletions.
2 changes: 1 addition & 1 deletion parsers/tcp/tcp-request.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (

type Requests struct {
Name string
Mode string // frontent, backend, listen
Mode string // frontent, backend, listen, defaults
data []types.TCPType
preComments []string // comments that appear before the actual line
}
Expand Down
9 changes: 7 additions & 2 deletions section-parsers.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ func (p *configParser) getDefaultParser() *Parsers {
addParser(parser, &sequence, &parsers.Balance{})
addParser(parser, &sequence, &parsers.MaxConn{})
addParser(parser, &sequence, &simple.Number{Name: "backlog"})
addParser(parser, &sequence, &parsers.ACL{})
addParser(parser, &sequence, &parsers.Log{})
addParser(parser, &sequence, &parsers.OptionHTTPLog{})
addParser(parser, &sequence, &parsers.EmailAlert{})
Expand Down Expand Up @@ -200,6 +201,10 @@ func (p *configParser) getDefaultParser() *Parsers {
addParser(parser, &sequence, &parsers.Persist{})
addParser(parser, &sequence, &simple.Number{Name: "rate-limit sessions"})
addParser(parser, &sequence, &simple.Number{Name: "hash-balance-factor"})
addParser(parser, &sequence, &http.Requests{Mode: "defaults"})
addParser(parser, &sequence, &tcp.Requests{Mode: "defaults"})
addParser(parser, &sequence, &http.Responses{Mode: "defaults"})
addParser(parser, &sequence, &http.AfterResponses{})
// the ConfigSnippet must be at the end to parsers load order to ensure
// the overloading of any option has been declared previously
addParser(parser, &sequence, &parsers.ConfigSnippet{})
Expand Down Expand Up @@ -493,7 +498,7 @@ func (p *configParser) getFrontendParser() *Parsers {
addParser(parser, &sequence, &parsers.CompressionTypeReq{})
addParser(parser, &sequence, &parsers.CompressionTypeRes{})
addParser(parser, &sequence, &parsers.CompressionOffload{})
addParser(parser, &sequence, &tcp.Requests{})
addParser(parser, &sequence, &tcp.Requests{Mode: "frontend"})
addParser(parser, &sequence, &stats.Stats{Mode: "frontend"})
addParser(parser, &sequence, &http.Requests{Mode: "frontend"})
addParser(parser, &sequence, &http.Redirect{})
Expand Down Expand Up @@ -750,7 +755,7 @@ func (p *configParser) getListenParser() *Parsers {
addParser(parser, &sequence, &parsers.CompressionTypeRes{})
addParser(parser, &sequence, &parsers.CompressionOffload{})
addParser(parser, &sequence, &parsers.CompressionDirection{})
addParser(parser, &sequence, &tcp.Requests{})
addParser(parser, &sequence, &tcp.Requests{Mode: "listen"})
addParser(parser, &sequence, &stats.Stats{Mode: "listen"})
addParser(parser, &sequence, &parsers.HTTPReuse{})
addParser(parser, &sequence, &http.Requests{Mode: "listen"})
Expand Down
Loading

0 comments on commit 00dddab

Please sign in to comment.