MCPcopy
hub / github.com/gofiber/fiber / Terminate

Method Terminate

services_test.go:157–183  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

155}
156
157func (m *mockService) Terminate(ctx context.Context) error {
158 select {
159 case <-ctx.Done():
160 return fmt.Errorf("context canceled: %w", ctx.Err())
161 default:
162 }
163
164 if m.terminateDelay > 0 {
165 timer := time.NewTimer(m.terminateDelay)
166 select {
167 case <-ctx.Done():
168 timer.Stop()
169 return fmt.Errorf("context canceled: %w", ctx.Err())
170 case <-timer.C:
171 // Continue after delay
172 }
173 }
174
175 if m.terminateError != nil {
176 m.terminated = false
177 return m.terminateError
178 }
179
180 m.started = false
181 m.terminated = true
182 return nil
183}
184
185func Test_HasConfiguredServices(t *testing.T) {
186 testHasConfiguredServicesFn := func(t *testing.T, app *App, expected bool) {

Callers

nothing calls this directly

Calls 3

DoneMethod · 0.65
ErrorfMethod · 0.65
ErrMethod · 0.65

Tested by

no test coverage detected