forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 1
/
glide.go
50 lines (38 loc) · 1000 Bytes
/
glide.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
package glide
import (
"time"
yaml "gopkg.in/yaml.v2"
)
type LockFile struct {
Hash string `yaml:"hash"`
Updated time.Time `yaml:"updated"`
Imports []*LockFileImport `yaml:"imports"`
}
func (l *LockFile) Decode(b []byte) error {
return yaml.Unmarshal(b, l)
}
type YamlFile struct {
Package string `yaml:"package"`
ExcludeDirs []string `yaml:"excludeDirs"`
Imports YamlFileImportList `yaml:"import"`
}
func (y *YamlFile) Encode() ([]byte, error) {
return yaml.Marshal(y)
}
func (y *YamlFile) Decode(b []byte) error {
return yaml.Unmarshal(b, y)
}
type LockFileImport struct {
Name string `yaml:"name"`
Repo string `yaml:"repo,omitempty"`
Version string `yaml:"version"`
}
type YamlFileImport struct {
Package string `yaml:"package"`
Repo string `yaml:"repo,omitempty"`
Version string `yaml:"version"`
}
type YamlFileImportList []*YamlFileImport
func (l *YamlFileImportList) Encode() ([]byte, error) {
return yaml.Marshal(l)
}