MCPcopy Create free account
hub / github.com/cloudwan/gohan / LoadExtensionsForPath

Method LoadExtensionsForPath

extension/golang/env.go:48–62  ·  view source on GitHub ↗

LoadExtensionsForPath for returns extensions for specific path

(extensions []*schema.Extension, timeLimit time.Duration, timeLimits []*schema.PathEventTimeLimit, path string)

Source from the content-addressed store, hash-verified

46
47//LoadExtensionsForPath for returns extensions for specific path
48func (env *Environment) LoadExtensionsForPath(extensions []*schema.Extension, timeLimit time.Duration, timeLimits []*schema.PathEventTimeLimit, path string) error {
49 for _, extension := range extensions {
50 if extension.Match(path) {
51 if extension.CodeType != "go" {
52 continue
53 }
54 code := extension.Code
55 callback := GetGoCallback(code)
56 if callback != nil {
57 env.goCallbacks = append(env.goCallbacks, callback)
58 }
59 }
60 }
61 return nil
62}
63
64//HandleEvent handles event
65func (env *Environment) HandleEvent(event string, context map[string]interface{}) (err error) {

Callers

nothing calls this directly

Implementers 8

MultiEnvironmentextension/multienv.go
Environmentextension/gohanscript/env.go
Environmentextension/golang/env.go
Environmentextension/goplugin/environment.go
MockIEnvironmentextension/goplugin/environment_mock.go
MockEnvironmentextension/mocks/environment_mock.go
MockEnvironmentMockRecorderextension/mocks/environment_mock.go
Environmentextension/otto/otto.go

Calls 2

GetGoCallbackFunction · 0.85
MatchMethod · 0.45

Tested by

no test coverage detected