MCPcopy
hub / github.com/crowdsecurity/crowdsec / NewAPIServer

Function NewAPIServer

pkg/apiserver/apiserver_test.go:140–153  ·  view source on GitHub ↗
(t *testing.T, ctx context.Context)

Source from the content-addressed store, hash-verified

138}
139
140func NewAPIServer(t *testing.T, ctx context.Context) (*APIServer, csconfig.Config) {
141 config := LoadTestConfig(t)
142
143 os.Remove("./ent")
144
145 logger, _ := logtest.NewNullLogger()
146 apiServer, err := NewServer(ctx, config.API.Server, logger.WithFields(nil))
147 require.NoError(t, err)
148
149 log.Info("Creating new API server")
150 gin.SetMode(gin.TestMode)
151
152 return apiServer, config
153}
154
155func NewAPITest(t *testing.T, ctx context.Context) (*gin.Engine, csconfig.Config) {
156 apiServer, config := NewAPIServer(t, ctx)

Callers 2

TestCreateAlertChannelsFunction · 0.85
NewAPITestFunction · 0.85

Calls 3

LoadTestConfigFunction · 0.85
NewServerFunction · 0.85
InfoMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…