-
Notifications
You must be signed in to change notification settings - Fork 462
/
doc.go
29 lines (23 loc) · 953 Bytes
/
doc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Gardener contributors
//
// SPDX-License-Identifier: Apache-2.0
//go:generate mockgen -package=context -destination=funcs.go github.com/gardener/gardener/third_party/mock/go/context WithTimeout,CancelFunc
//go:generate mockgen -package=context -destination=mocks.go github.com/gardener/gardener/third_party/mock/go/context Context
package context
import (
"context"
"time"
)
// Context allows mocking context.Context. The interface is necessary due to an issue with
// golang/mock not being able to generate code for go's core context package.
type Context interface {
context.Context
}
// WithTimeout is an interface that allows mocking `WithTimeout`.
type WithTimeout interface {
Do(parent context.Context, timeout time.Duration) (context.Context, context.CancelFunc)
}
// CancelFunc is an interface that allows mocking `CancelFunc`.
type CancelFunc interface {
Do()
}