Process the url string argument to Connect. Return an array of urls, even if only one.
(url string)
| 1782 | // Process the url string argument to Connect. |
| 1783 | // Return an array of urls, even if only one. |
| 1784 | func processUrlString(url string) []string { |
| 1785 | urls := strings.Split(url, ",") |
| 1786 | var j int |
| 1787 | for _, s := range urls { |
| 1788 | u := strings.TrimSuffix(strings.TrimSpace(s), "/") |
| 1789 | if len(u) > 0 { |
| 1790 | urls[j] = u |
| 1791 | j++ |
| 1792 | } |
| 1793 | } |
| 1794 | return urls[:j] |
| 1795 | } |
| 1796 | |
| 1797 | // Connect will attempt to connect to a NATS server with multiple options. |
| 1798 | func (o Options) Connect() (*Conn, error) { |
no outgoing calls