-
Notifications
You must be signed in to change notification settings - Fork 29
/
client.go
32 lines (26 loc) · 1.04 KB
/
client.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
package client
import (
"github.com/bitnami/charts-syncer/pkg/client/types"
"helm.sh/helm/v3/pkg/chart"
)
// This package defines the interfaces that clients needs to satisfy in order to work with chart repositories or
// intermediate bundles directories.
// ChartsReader defines the methods that a ReadOnly chart or bundle client should implement.
type ChartsReader interface {
Fetch(name string, version string) (string, error)
List() ([]string, error)
ListChartVersions(name string) ([]string, error)
Has(name string, version string) (bool, error)
GetChartDetails(name string, version string) (*types.ChartDetails, error)
// Reload reloads or refresh the client-side data, in case it needs it
Reload() error
}
// ChartsWriter defines the methods that a WriteOnly chart or bundle client should implement.
type ChartsWriter interface {
Upload(filepath string, metadata *chart.Metadata) error
}
// ChartsReaderWriter defines the methods that a chart or bundle client should implement
type ChartsReaderWriter interface {
ChartsReader
ChartsWriter
}