Skip to content

Commit e0eb330

Browse files
hiddecostefanprodan
authored andcommitted
Add source interface spec
1 parent e002278 commit e0eb330

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

docs/spec/v1alpha1/common.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,21 @@ Common defines resources used across all source types.
44

55
## Specification
66

7+
### Source interface
8+
9+
Source objects should adhere to the `Source` interface. This interface exposes the [interval](#source-synchronization)
10+
and [artifact](#source-status) of the source to clients without the prerequisite of knowing the source kind:
11+
12+
````go
13+
type Source interface {
14+
// GetInterval returns the interval at which the source is updated.
15+
GetInterval() metav1.Duration
16+
17+
// GetArtifact returns the latest artifact from the source, or nil.
18+
GetArtifact() *Artifact
19+
}
20+
````
21+
722
### Source synchronization
823

924
Source objects should contain a `spec.interval` field that tells the controller at which interval to check for updates:

0 commit comments

Comments
 (0)