MCPcopy Create free account
hub / github.com/convox/rack / hook

Method hook

pkg/api/api.go:84–106  ·  view source on GitHub ↗
(name string, args ...interface{})

Source from the content-addressed store, hash-verified

82}
83
84func (s *Server) hook(name string, args ...interface{}) error {
85 vfn, ok := reflect.TypeOf(s).MethodByName(name)
86 if !ok {
87 return nil
88 }
89
90 rargs := []reflect.Value{reflect.ValueOf(s)}
91
92 for _, arg := range args {
93 rargs = append(rargs, reflect.ValueOf(arg))
94 }
95
96 rvs := vfn.Func.Call(rargs)
97 if len(rvs) == 0 {
98 return nil
99 }
100
101 if err, ok := rvs[0].Interface().(error); ok && err != nil {
102 return err
103 }
104
105 return nil
106}
107
108func (s *Server) provider(c *stdapi.Context) structs.Provider {
109 return s.Provider

Callers 15

AppCancelMethod · 0.95
AppCreateMethod · 0.95
AppDeleteMethod · 0.95
AppGetMethod · 0.95
AppListMethod · 0.95
AppLogsMethod · 0.95
AppMetricsMethod · 0.95
AppUpdateMethod · 0.95
BuildCreateMethod · 0.95
BuildExportMethod · 0.95
BuildGetMethod · 0.95
BuildImportMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected