MCPcopy
hub / github.com/netdata/netdata / ValidateHasPayload

Method ValidateHasPayload

src/go/plugin/framework/dyncfg/function.go:114–119  ·  view source on GitHub ↗

ValidateHasPayload checks if the function has a payload. Returns an error if the payload is empty.

()

Source from the content-addressed store, hash-verified

112// ValidateHasPayload checks if the function has a payload.
113// Returns an error if the payload is empty.
114func (f Function) ValidateHasPayload() error {
115 if !f.HasPayload() {
116 return fmt.Errorf("missing configuration payload")
117 }
118 return nil
119}
120
121// UnmarshalPayload unmarshals the payload into dst based on ContentType.
122// Uses JSON for "application/json", YAML otherwise.

Callers 7

CmdAddMethod · 0.80
CmdUpdateMethod · 0.80
dyncfgCmdTestMethod · 0.80
dyncfgCmdAddMethod · 0.80
dyncfgCmdUserconfigMethod · 0.80

Calls 2

HasPayloadMethod · 0.95
ErrorfMethod · 0.65

Tested by 1