This repository has been archived by the owner on Nov 16, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 58
/
entities.go
71 lines (60 loc) · 2.09 KB
/
entities.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
///////////////////////////////////////////////////////////////////////
// Copyright (c) 2017 VMware, Inc. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
///////////////////////////////////////////////////////////////////////
package imagemanager
// NO TESTS
import (
entitystore "github.com/vmware/dispatch/pkg/entity-store"
)
const (
// StatusINITIALIZED captures enum value "INITIALIZED"
StatusINITIALIZED entitystore.Status = "INITIALIZED"
// StatusCREATING captures enum value "CREATING"
StatusCREATING entitystore.Status = "CREATING"
// StatusUPDATING capture enum value "UPDATING"
StatusUPDATING entitystore.Status = "UPDATING"
// StatusREADY captures enum value "READY"
StatusREADY entitystore.Status = "READY"
// StatusERROR captures enum value "ERROR"
StatusERROR entitystore.Status = "ERROR"
// StatusDELETED captures enum value "DELETED"
StatusDELETED entitystore.Status = "DELETED"
)
// BaseImage defines a base image type
type BaseImage struct {
entitystore.BaseEntity
DockerURL string `json:"dockerUrl"`
Language string `json:"language"`
}
// SystemPackage defines a system package type
type SystemPackage struct {
Name string `json:"name"`
Version string `json:"version"`
}
// SystemDependencies defines a system dependency type
type SystemDependencies struct {
Packages []SystemPackage `json:"packages"`
}
// RuntimeDependencies defines a runtime dependency type
type RuntimeDependencies struct {
Manifest string `json:"manifest"`
}
// Image defines an image type
type Image struct {
entitystore.BaseEntity
DockerURL string `json:"dockerUrl"`
Language string `json:"language"`
BaseImageName string `json:"baseImageName"`
RuntimeDependencies RuntimeDependencies `json:"runtimeDependencies"`
SystemDependencies SystemDependencies `json:"systemDependencies"`
}
// GetDockerURL returns the docker URL for the image
func (i *Image) GetDockerURL() string {
return i.DockerURL
}
// DockerImage defines the docker image interface
type DockerImage interface {
entitystore.Entity
GetDockerURL() string
}