MCPcopy Create free account
hub / github.com/daodst/chat / pushRuleAttrGetter

Function pushRuleAttrGetter

clientapi/routing/pushrules.go:326–335  ·  view source on GitHub ↗
(attr string)

Source from the content-addressed store, hash-verified

324}
325
326func pushRuleAttrGetter(attr string) (func(*pushrules.Rule) interface{}, error) {
327 switch attr {
328 case "actions":
329 return func(rule *pushrules.Rule) interface{} { return rule.Actions }, nil
330 case "enabled":
331 return func(rule *pushrules.Rule) interface{} { return rule.Enabled }, nil
332 default:
333 return nil, jsonerror.InvalidArgumentValue("invalid push rule attribute")
334 }
335}
336
337func pushRuleAttrSetter(attr string) (func(dest, src *pushrules.Rule), error) {
338 switch attr {

Callers 2

GetPushRuleAttrByRuleIDFunction · 0.85
PutPushRuleAttrByRuleIDFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected