-
Notifications
You must be signed in to change notification settings - Fork 2
/
repox.go
38 lines (31 loc) · 881 Bytes
/
repox.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
package repox
import (
"io"
)
type BuilderOptions struct {
TenantId string
BasePath string
ExtraMeta map[string]string
}
type Builder func(opts *BuilderOptions) (Repository, error)
type RepoQuery struct {
Group string
Tags []string
Page int64
}
type BPrint struct {
Name string `json:"name,omitempty"`
Slug string `json:"slug,omitempty"`
Type string `json:"type,omitempty"`
SubType string `json:"sub_type,omitempty"`
Description string `json:"description,omitempty"`
Icon string `json:"icon,omitempty"`
Versions []string `json:"versions,omitempty"`
Tags []string `json:"tags,omitempty"`
}
type Repository interface {
Name() string
Query(tenantId string, opts *RepoQuery) ([]BPrint, error)
Get(tenantid, slug string) (*BPrint, error)
GetZip(tenantid, slug, version string) (io.ReadCloser, error)
}