MCPcopy Create free account
hub / github.com/erpc/erpc / SetDefaults

Method SetDefaults

common/defaults.go:749–767  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

747}
748
749func (m *MetricsConfig) SetDefaults() error {
750 if m.Enabled == nil && !util.IsTest() {
751 m.Enabled = util.BoolPtr(true)
752 }
753 if m.HostV4 == nil {
754 m.HostV4 = util.StringPtr("0.0.0.0")
755 }
756 if m.HostV6 == nil {
757 m.HostV6 = util.StringPtr("[::]")
758 }
759 if m.Port == nil {
760 m.Port = util.IntPtr(4001)
761 }
762 if m.ErrorLabelMode == "" {
763 m.ErrorLabelMode = ErrorLabelModeCompact
764 }
765
766 return nil
767}
768
769func (a *AdminConfig) SetDefaults() error {
770 if a.Auth != nil {

Callers

nothing calls this directly

Calls 4

IsTestFunction · 0.92
BoolPtrFunction · 0.92
StringPtrFunction · 0.92
IntPtrFunction · 0.92

Tested by

no test coverage detected