IP Whitelists for Frontend (with Docker- & Kubernetes-Provider Support)
This commit is contained in:
parent
55f610422a
commit
5f0b215e90
16 changed files with 731 additions and 14 deletions
19
provider/string_util.go
Normal file
19
provider/string_util.go
Normal file
|
@ -0,0 +1,19 @@
|
|||
package provider
|
||||
|
||||
import "strings"
|
||||
|
||||
// SplitAndTrimString splits separatedString at the comma character and trims each
|
||||
// piece, filtering out empty pieces. Returns the list of pieces or nil if the input
|
||||
// did not contain a non-empty piece.
|
||||
func SplitAndTrimString(separatedString string) []string {
|
||||
listOfStrings := strings.Split(separatedString, ",")
|
||||
var trimmedListOfStrings []string
|
||||
for _, s := range listOfStrings {
|
||||
s = strings.TrimSpace(s)
|
||||
if len(s) > 0 {
|
||||
trimmedListOfStrings = append(trimmedListOfStrings, s)
|
||||
}
|
||||
}
|
||||
|
||||
return trimmedListOfStrings
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue