Skip to content

Commit

Permalink
address comments.
Browse files Browse the repository at this point in the history
Signed-off-by: doujiang24 <[email protected]>
  • Loading branch information
doujiang24 committed Feb 5, 2024
1 parent d918f44 commit f0c241f
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ type filterFactoryAndParser struct {
// nullParser is a no-op implementation of the StreamFilterConfigParser interface.
type nullParser struct{}

// Parse do nothing, returns the input any as is.
// Parse does nothing, returns the input `any` as is.
func (p *nullParser) Parse(any *anypb.Any, callbacks api.ConfigCallbackHandler) (interface{}, error) {
return any, nil
}

// Merge only use the childConfig, ignore the parentConfig.
// Merge only uses the childConfig, ignore the parentConfig.
func (p *nullParser) Merge(parentConfig interface{}, childConfig interface{}) interface{} {
return childConfig
}

var NullParser api.StreamFilterConfigParser = &nullParser{}

// RegisterHttpFilterFactoryAndConfigParser register http filter factory and config parser for the specified plugin.
// RegisterHttpFilterFactoryAndConfigParser registers the http filter factory and config parser for the specified plugin.
// The factory and parser should not be nil.
// Use the NullParser if the plugin does not care about config.
func RegisterHttpFilterFactoryAndConfigParser(name string, factory api.StreamFilterFactory, parser api.StreamFilterConfigParser) {
Expand Down

0 comments on commit f0c241f

Please sign in to comment.