MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / New

Function New

internal/pluginhost/host.go:76–105  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

74}
75
76func New() *Host {
77 h := &Host{
78 loader: defaultPluginLoader(),
79 loaded: make(map[string]*loadedPlugin),
80 retired: make(map[string][]*loadedPlugin),
81 loading: make(map[string]struct{}),
82 fused: make(map[string]string),
83 pluginFileVersions: make(map[string]string),
84 activePluginVersions: make(map[string]string),
85 activePluginPaths: make(map[string]string),
86 cleanupFilesPending: true,
87 modelClientIDs: make(map[string]struct{}),
88 executorModelClientIDs: make(map[string]struct{}),
89 modelProviders: make(map[string]string),
90 modelRegistrations: make(map[string]pluginModelRegistration),
91 providerModels: make(map[string][]*registryModelInfo),
92 executorProviders: make(map[string]struct{}),
93 accessProviderKeys: make(map[string]struct{}),
94 commandLineFlags: make(map[string]commandLineFlagRecord),
95 commandLineHits: make(map[string]struct{}),
96 managementRoutes: make(map[string]managementRouteRecord),
97 resourceRoutes: make(map[string]resourceRouteRecord),
98 streams: newStreamBridge(),
99 httpStreams: newHostHTTPStreamBridge(),
100 modelStreams: newModelStreamBridge(),
101 callbackContexts: newCallbackContextRegistry(),
102 }
103 h.snapshot.Store(emptySnapshot())
104 return h
105}
106
107func NewForTest(loader pluginLoader) *Host {
108 h := New()

Calls 6

newStreamBridgeFunction · 0.85
newHostHTTPStreamBridgeFunction · 0.85
newModelStreamBridgeFunction · 0.85
emptySnapshotFunction · 0.85
defaultPluginLoaderFunction · 0.70