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

Method State

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

Source from the content-addressed store, hash-verified

135}
136
137func (m *mockService) State(ctx context.Context) (string, error) {
138 if ctx.Err() != nil {
139 return "", fmt.Errorf("context canceled: %w", ctx.Err())
140 }
141
142 if m.stateError != nil {
143 return "error", m.stateError
144 }
145
146 if m.started {
147 return "running", nil
148 }
149
150 if m.terminated {
151 return "stopped", nil
152 }
153
154 return "unknown", nil
155}
156
157func (m *mockService) Terminate(ctx context.Context) error {
158 select {

Callers

nothing calls this directly

Calls 2

ErrMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected