NewClient creates a new NTRIP client with the given configuration.
(cfg Config, opts ...Option)
| 102 | |
| 103 | // NewClient creates a new NTRIP client with the given configuration. |
| 104 | func NewClient(cfg Config, opts ...Option) *Client { |
| 105 | if cfg.UserAgent == "" { |
| 106 | cfg.UserAgent = defaultUserAgent |
| 107 | } |
| 108 | c := &Client{ |
| 109 | config: cfg, |
| 110 | logger: slog.Default(), |
| 111 | } |
| 112 | for _, opt := range opts { |
| 113 | opt(c) |
| 114 | } |
| 115 | return c |
| 116 | } |
| 117 | |
| 118 | // Connect establishes a connection to the NTRIP caster. If a proxy is |
| 119 | // configured, it first establishes an HTTP CONNECT tunnel through the proxy |
no outgoing calls
searching dependent graphs…