MCPcopy
hub / github.com/keploy/keploy / New

Function New

config/default.go:141–158  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

139`
140
141func New() *Config {
142 // merge default config with internal config
143 mergedConfig, err := Merge(defaultConfig, InternalConfig)
144 if err != nil {
145 panic(err)
146 }
147 config := &Config{}
148 err = yaml3.Unmarshal([]byte(mergedConfig), config)
149 if err != nil {
150 panic(err)
151 }
152 // Defaults for fields whose Go zero value is not the desired default.
153 // EnableIPv6Redirect defaults to true so ::1 traffic is redirected to
154 // the proxy on modern Linux distros where glibc resolves localhost to
155 // ::1 first. Setting it false in config is the opt-in rollback knob.
156 config.Agent.EnableIPv6Redirect = true
157 return config
158}
159
160func Merge(srcStr, destStr string) (string, error) {
161 return mergeStrings(srcStr, destStr, false, yaml.MergeOptions{})

Callers 2

startFunction · 0.92
RootFunction · 0.92

Calls 2

MergeFunction · 0.85
UnmarshalMethod · 0.80

Tested by

no test coverage detected