buildServerConfig builds a Config for server from the provided options.
(opts ...ServerOption)
| 178 | |
| 179 | // buildServerConfig builds a Config for server from the provided options. |
| 180 | func buildServerConfig(opts ...ServerOption) (*Config, error) { |
| 181 | cfg := &dtlsConfig{} |
| 182 | cfg.applyDefaults() |
| 183 | |
| 184 | for _, opt := range opts { |
| 185 | if err := opt.applyServer(cfg); err != nil { |
| 186 | return nil, err |
| 187 | } |
| 188 | } |
| 189 | |
| 190 | return cfg.toConfig(), nil |
| 191 | } |
| 192 | |
| 193 | // buildClientConfig builds a Config for client from the provided options. |
| 194 | func buildClientConfig(opts ...ClientOption) (*Config, error) { |
searching dependent graphs…