buildClientConfig builds a Config for client from the provided options.
(opts ...ClientOption)
| 192 | |
| 193 | // buildClientConfig builds a Config for client from the provided options. |
| 194 | func buildClientConfig(opts ...ClientOption) (*Config, error) { |
| 195 | cfg := &dtlsConfig{} |
| 196 | cfg.applyDefaults() |
| 197 | |
| 198 | for _, opt := range opts { |
| 199 | if err := opt.applyClient(cfg); err != nil { |
| 200 | return nil, err |
| 201 | } |
| 202 | } |
| 203 | |
| 204 | return cfg.toConfig(), nil |
| 205 | } |
| 206 | |
| 207 | // sharedOption wraps an apply function that works for both client and server. |
| 208 | // This eliminates code duplication for options that behave identically on both sides. |
searching dependent graphs…