-
Notifications
You must be signed in to change notification settings - Fork 15
update event types #266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update event types #266
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,9 +33,9 @@ var dataSelectNotSupported = map[string]bool{ | |
| "minuimumlength": true, | ||
| } | ||
|
|
||
| // nslcReg: FDSN spec allows all ascii, but we'll only allow alpha, number, _, ?, *, "," and "--" (exactly 2 hyphens only) | ||
| var nslcReg = regexp.MustCompile(`^([\w*?,]+|--)$`) | ||
| var eventTypeReg = regexp.MustCompile(`^([\w*?, ]+|--)$`) // space allowed | ||
| // nslcReg: FDSN spec allows all ascii, but we'll only allow alpha, number, _,-, ?, *, "," and "--" (exactly 2 hyphens only) | ||
| var nslcReg = regexp.MustCompile(`^([\w*?,]+(?:-[\w*?,]+)*|--)$`) // space not allowed | ||
| var eventTypeReg = regexp.MustCompile(`^([\w*?, ]+(?:[ -][\w*?,]+)*|--)$`) // space allowed | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure which cases are this change aim to deal with? If it's for
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is to allow
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unless the specification says "no hyphen at the start" (though people won't do it) otherwise we don't need to make sure it's in the middle. |
||
|
|
||
| // nslcRegPassPattern: This is beyond FDSN spec. | ||
| // Any NSLC regex string doesn't match this pattern we knew it won't generate any results. | ||
|
|
@@ -306,6 +306,7 @@ func GenRegex(input []string, emptyDash bool, allowSpace bool) ([]string, error) | |
| } else { | ||
| matched = nslcReg.MatchString(s) | ||
| } | ||
|
|
||
| if !matched { | ||
| return nil, fmt.Errorf("invalid parameter:'%s'", s) | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This
nslcRegis used to verify network/station/location/channel identifiers, is not for event type.We don't have any identifiers containing
-.However, it's fine to add this since it's in FDSN specification.