MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / ValidateContext

Method ValidateContext

pkg/ttnpb/message_validators.go:24–29  ·  view source on GitHub ↗

ValidateContext wraps the generated validator with (optionally context-based) custom checks.

(context.Context)

Source from the content-addressed store, hash-verified

22
23// ValidateContext wraps the generated validator with (optionally context-based) custom checks.
24func (p *MACPayload) ValidateContext(context.Context) error {
25 if h := p.GetFHdr(); h == nil || types.MustDevAddr(h.DevAddr).OrZero().IsZero() {
26 return errMissing("DevAddr")
27 }
28 return p.ValidateFields()
29}
30
31// ValidateContext wraps the generated validator with (optionally context-based) custom checks.
32func (p *JoinRequestPayload) ValidateContext(context.Context) error {

Callers

nothing calls this directly

Calls 6

GetFHdrMethod · 0.95
ValidateFieldsMethod · 0.95
MustDevAddrFunction · 0.92
errMissingFunction · 0.70
IsZeroMethod · 0.65
OrZeroMethod · 0.45

Tested by

no test coverage detected