-
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.
- Loading branch information
1 parent
dd351b8
commit 9e1e071
Showing
52 changed files
with
1,230 additions
and
611 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,8 @@ | ||
package config | ||
|
||
const ( | ||
DefaultFendDelimiter = ";" | ||
DefaultFendNameDelimiter = ":" | ||
DefaultRuleDelimiter = ":" | ||
DefaultRuleMetaDelimiter = "=" | ||
) | ||
|
||
var ( | ||
FendDelimiter = DefaultFendDelimiter | ||
FendNameDelimiter = DefaultFendNameDelimiter | ||
RuleDelimiter = DefaultRuleDelimiter | ||
RuleMetaDelimiter = DefaultRuleMetaDelimiter | ||
DelimiterFend = ";" | ||
DelimiterFendName = ":" | ||
DelimiterRule = ":" | ||
DelimiterRuleMeta = "=" | ||
) |
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,15 @@ | ||
package config | ||
|
||
import ( | ||
"regexp" | ||
) | ||
|
||
var ( | ||
RegexEmailWeak = regexp.MustCompile(`.+@.+\..+`) // https://davidcel.is/posts/stop-validating-email-addresses-with-regex/ | ||
RegexHostname = regexp.MustCompile(`^[a-zA-Z]([a-zA-Z0-9\-]+[\.]?)*[a-zA-Z0-9]$`) // https://tools.ietf.org/html/rfc952 | ||
RegexAlphaNumeric = regexp.MustCompile(`^[a-zA-Z0-9]+$`) | ||
RegexNumeric = regexp.MustCompile(`^[0-9]+$`) | ||
RegexAlpha = regexp.MustCompile(`^[a-zA-Z]+$`) | ||
RegexUUID = regexp.MustCompile(`^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$`) | ||
RegexMD5 = regexp.MustCompile(`^[0-9a-f]{32}$`) | ||
) |
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
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 |
---|---|---|
@@ -1,3 +1,11 @@ | ||
package fend | ||
|
||
type Fends []Fend | ||
|
||
func (f Fends) Append(v ...Fend) Fends { | ||
return append(f, v...) | ||
} | ||
|
||
func (f Fends) Prepend(v ...Fend) Fends { | ||
return append(v, f...) | ||
} |
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,13 @@ | ||
package fend | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/foomo/fender/rule" | ||
) | ||
|
||
func Fn(rules ...rule.Fn) Fend { | ||
return func(ctx context.Context, mode Mode) error { | ||
return fendFn(ctx, mode, "", rules...) | ||
} | ||
} |
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
Oops, something went wrong.