MCPcopy
hub / github.com/livekit/livekit / createSingleNodeServer

Function createSingleNodeServer

test/integration_helpers.go:170–195  ·  view source on GitHub ↗
(configUpdater func(*config.Config))

Source from the content-addressed store, hash-verified

168}
169
170func createSingleNodeServer(configUpdater func(*config.Config)) *service.LivekitServer {
171 var err error
172 conf, err := config.NewConfig("", true, nil, nil)
173 if err != nil {
174 panic(fmt.Sprintf("could not create config: %v", err))
175 }
176 conf.Keys = map[string]string{testApiKey: testApiSecret}
177 conf.EnableDataTracks = true
178 if configUpdater != nil {
179 configUpdater(conf)
180 }
181
182 currentNode, err := routing.NewLocalNode(conf)
183 if err != nil {
184 panic(fmt.Sprintf("could not create local node: %v", err))
185 }
186 currentNode.SetNodeID(livekit.NodeID(guid.New(nodeID1)))
187
188 s, err := service.InitializeServer(conf, currentNode)
189 if err != nil {
190 panic(fmt.Sprintf("could not create server: %v", err))
191 }
192
193 roomClient = livekit.NewRoomServiceJSONClient(fmt.Sprintf("http://localhost:%d", defaultServerPort), &http.Client{})
194 return s
195}
196
197func createMultiNodeServer(nodeID string, port uint32, configUpdater func(*config.Config)) *service.LivekitServer {
198 var err error

Callers 6

setupSingleNodeTestFunction · 0.85
TestAutoCreateFunction · 0.85
TestTurnRelayFunction · 0.85
TestTurnAuthFailureFunction · 0.85
setupDataBlobServerFunction · 0.85

Calls 5

SetNodeIDMethod · 0.95
NewConfigFunction · 0.92
NewLocalNodeFunction · 0.92
InitializeServerFunction · 0.92
NodeIDMethod · 0.65

Tested by 5

TestAutoCreateFunction · 0.68
TestTurnRelayFunction · 0.68
TestTurnAuthFailureFunction · 0.68
setupDataBlobServerFunction · 0.68