(ctx context.Context)
| 135 | } |
| 136 | |
| 137 | func (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 | |
| 157 | func (m *mockService) Terminate(ctx context.Context) error { |
| 158 | select { |