-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: [CN-37] - Merge censor constructors. (#33)
- Loading branch information
1 parent
c32a0c4
commit 8efda64
Showing
5 changed files
with
84 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package censor | ||
|
||
// OptsConfig is a options configuration for the Processor. | ||
type OptsConfig struct { | ||
config *Config | ||
configPath string | ||
} | ||
|
||
// Option is a function that sets some option on the Processor. | ||
type Option func(*OptsConfig) | ||
|
||
// WithConfig returns an Option that sets the configuration on the Processor. | ||
func WithConfig(c *Config) func(*OptsConfig) { | ||
return func(o *OptsConfig) { | ||
o.config = c | ||
} | ||
} | ||
|
||
// WithConfigPath returns an Option that sets the configuration path on the Processor. | ||
func WithConfigPath(path string) func(*OptsConfig) { | ||
return func(o *OptsConfig) { | ||
o.configPath = path | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters