forked from cloudfoundry/bosh-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
interfaces.go
71 lines (54 loc) · 1.56 KB
/
interfaces.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
package release
import (
boshjob "github.com/cloudfoundry/bosh-cli/release/job"
boshlic "github.com/cloudfoundry/bosh-cli/release/license"
boshman "github.com/cloudfoundry/bosh-cli/release/manifest"
boshpkg "github.com/cloudfoundry/bosh-cli/release/pkg"
boshres "github.com/cloudfoundry/bosh-cli/release/resource"
)
type Extractor interface {
Extract(string) (Release, error)
}
//go:generate counterfeiter . Reader
type Reader interface {
// Read reads an archive for example and returns a Release.
Read(string) (Release, error)
}
//go:generate counterfeiter . Writer
type Writer interface {
// Write writes an archive for example and returns its path.
// Archive does not include packages that have fingerprints
// included in the second argument.
Write(Release, []string) (string, error)
}
//go:generate counterfeiter . Release
type Release interface {
Name() string
SetName(string)
Version() string
SetVersion(string)
CommitHashWithMark(string) string
SetCommitHash(string)
SetUncommittedChanges(bool)
Jobs() []*boshjob.Job
Packages() []*boshpkg.Package
CompiledPackages() []*boshpkg.CompiledPackage
License() *boshlic.License
IsCompiled() bool
FindJobByName(string) (boshjob.Job, bool)
Manifest() boshman.Manifest
Build(dev, final ArchiveIndicies) error
Finalize(final ArchiveIndicies) error
CleanUp() error
}
type ArchiveIndicies struct {
Jobs boshres.ArchiveIndex
Packages boshres.ArchiveIndex
Licenses boshres.ArchiveIndex
}
type Manager interface {
Add(Release)
List() []Release
Find(string) (Release, bool)
DeleteAll() error
}