If we have a Domain, convert to the appropriate ext.APIPrefix. This will change the stream source, so should be a copy passed in.
()
| 316 | // If we have a Domain, convert to the appropriate ext.APIPrefix. |
| 317 | // This will change the stream source, so should be a copy passed in. |
| 318 | func (ss *StreamSource) convertDomain() error { |
| 319 | if ss.Domain == _EMPTY_ { |
| 320 | return nil |
| 321 | } |
| 322 | if ss.External != nil { |
| 323 | // These should be mutually exclusive. |
| 324 | // TODO(dlc) - Make generic? |
| 325 | return errors.New("nats: domain and external are both set") |
| 326 | } |
| 327 | ss.External = &ExternalStream{APIPrefix: fmt.Sprintf(jsExtDomainT, ss.Domain)} |
| 328 | return nil |
| 329 | } |
| 330 | |
| 331 | // apiResponse is a standard response from the JetStream JSON API |
| 332 | type apiResponse struct { |