MCPcopy Create free account
hub / github.com/pion/dtls / buildClientConfig

Function buildClientConfig

options.go:194–205  ·  view source on GitHub ↗

buildClientConfig builds a Config for client from the provided options.

(opts ...ClientOption)

Source from the content-addressed store, hash-verified

192
193// buildClientConfig builds a Config for client from the provided options.
194func 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.

Callers 9

TestDefaultsAreAppliedFunction · 0.85
TestValidOptionsSucceedFunction · 0.85
TestOptionImmutabilityFunction · 0.85
DialWithOptionsFunction · 0.85
ClientWithOptionsFunction · 0.85

Calls 3

applyDefaultsMethod · 0.95
toConfigMethod · 0.95
applyClientMethod · 0.65

Used in the wild real call sites across dependent graphs

searching dependent graphs…