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

Function cleanFieldMaskPaths

pkg/identityserver/utils.go:35–53  ·  view source on GitHub ↗
(allowedPaths []string, requestedPaths *fieldmaskpb.FieldMask, addPaths, removePaths []string)

Source from the content-addressed store, hash-verified

33)
34
35func cleanFieldMaskPaths(allowedPaths []string, requestedPaths *fieldmaskpb.FieldMask, addPaths, removePaths []string) *fieldmaskpb.FieldMask {
36 selected := make(map[string]struct{})
37 for _, path := range addPaths {
38 selected[path] = struct{}{}
39 }
40 for _, path := range requestedPaths.GetPaths() {
41 selected[path] = struct{}{}
42 }
43 for _, path := range removePaths {
44 delete(selected, path)
45 }
46 out := make([]string, 0, len(selected))
47 for _, path := range allowedPaths {
48 if _, ok := selected[path]; ok {
49 out = append(out, path)
50 }
51 }
52 return ttnpb.FieldMask(out...)
53}
54
55func cleanContactInfo(info []*ttnpb.ContactInfo) {
56 for _, info := range info {

Callers 15

getEndDeviceMethod · 0.85
listEndDevicesMethod · 0.85
updateEndDeviceMethod · 0.85
batchGetEndDevicesMethod · 0.85
getUserMethod · 0.85
listUsersMethod · 0.85
updateUserMethod · 0.85
getGatewayMethod · 0.85
listGatewaysMethod · 0.85
updateGatewayMethod · 0.85
getApplicationMethod · 0.85
listApplicationsMethod · 0.85

Calls 1

FieldMaskFunction · 0.92

Tested by

no test coverage detected