blob: b31f3d86eccbaac356d2b6b96112cc94ea72793c (
plain)
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
|
package store
const infoJson = "info.json"
// LockPath returns path to lock file.
func (s *Store) LockPath() string {
return s.Path + "/lock"
}
// TagsDir returns path to tags.
func (s *Store) TagsDir() string {
return s.Path + "/tags"
}
// TagPath returns path to a specific tag.
func (s *Store) TagPath(tag string) string {
return s.TagsDir() + "/" + tag
}
// TagMetadataPath returns path to a specific tag's metadata file.
func (s *Store) TagMetadataPath(tag string) string {
return s.TagPath(tag) + "/info.json"
}
// ImagesDir returns path to images.
func (s *Store) ImagesDir() string {
return s.Path + "/images"
}
// ImagePath returns path to an image with specific hash.
func (s *Store) ImagePath(hash string) string {
return s.ImagesDir() + "/" + s.ImageHashSplit(hash)
}
// ImageHashSplit returns split image hash.
func (s *Store) ImageHashSplit(hash string) string {
return hash[0:2] + "/" + hash[2:]
}
// ImageFilePath returns path to an image file with specific hash.
func (s *Store) ImageFilePath(hash string) string {
return s.ImagePath(hash) + "/f"
}
// ImagePreviewFilePath returns path to an image preview file with specific hash.
func (s *Store) ImagePreviewFilePath(hash string) string {
return s.ImagePath(hash) + "/p"
}
// ImageMetadataPath returns path to an image's metadata file with specific hash.
func (s *Store) ImageMetadataPath(hash string) string {
return s.ImagePath(hash) + "/info.json"
}
// ImageTagsPath returns path to an image's tags with specific hash.
func (s *Store) ImageTagsPath(flake string) string {
return s.ImageSnowflakePath(flake) + "/tags"
}
// ImageHashTagsPath returns path to an image's tags with specific hash.
func (s *Store) ImageHashTagsPath(hash string) string {
return s.ImagePath(hash) + "/tags"
}
// ImagesSnowflakeDir returns path to image snowflakes.
func (s *Store) ImagesSnowflakeDir() string {
return s.Path + "/snowflakes"
}
// ImageSnowflakePath returns path to an image with specific snowflake.
func (s *Store) ImageSnowflakePath(flake string) string {
return s.ImagesSnowflakeDir() + "/" + flake
}
// UsersDir returns path to users.
func (s *Store) UsersDir() string {
return s.Path + "/users"
}
// UserPath returns path to a user with specific snowflake.
func (s *Store) UserPath(flake string) string {
return s.UsersDir() + "/" + flake
}
// UserMetadataPath returns path to a user's metadata file with specific snowflake.
func (s *Store) UserMetadataPath(flake string) string {
return s.UserPath(flake) + "/info.json"
}
// UserImagesPath returns path to a user's images with specific snowflake.
func (s *Store) UserImagesPath(flake string) string {
return s.UserPath(flake) + "/images"
}
// UserPasswordPath returns path to a user's password.
func (s *Store) UserPasswordPath(flake string) string {
return s.UserPath(flake) + "/password"
}
// UsernamesDir returns path to usernames.
func (s *Store) UsernamesDir() string {
return s.Path + "/usernames"
}
// UsernamePath returns path to username.
func (s *Store) UsernamePath(name string) string {
return s.UsernamesDir() + "/" + name
}
// SecretsDir returns path to tokens.
func (s *Store) SecretsDir() string {
return s.Path + "/secrets"
}
// SecretPath returns path to tokens.
func (s *Store) SecretPath(secret string) string {
return s.SecretsDir() + "/" + secret
}
// PageBaseDir returns path to page base directory.
func (s *Store) PageBaseDir() string {
return s.Path + "/pages"
}
// PageVariantPath returns path to pages of a variant.
func (s *Store) PageVariantPath(variant string) string {
return s.PageBaseDir() + "/" + variant
}
|