ValidatePeerID reports whether the peer identifier matches the RFC grammar.
(peerID string)
| 134 | |
| 135 | // ValidatePeerID reports whether the peer identifier matches the RFC grammar. |
| 136 | func ValidatePeerID(peerID string) error { |
| 137 | if !peerIDPattern.MatchString(peerID) { |
| 138 | return fmt.Errorf("%w: peer_id=%q", ErrInvalidField, peerID) |
| 139 | } |
| 140 | return nil |
| 141 | } |
| 142 | |
| 143 | // ValidateConversationID reports whether a container identifier matches its field grammar. |
| 144 | func ValidateConversationID(id string, field string) error { |
no outgoing calls
no test coverage detected