From 82d071329700beb96fd8844c3ce5f29a63b52ffc Mon Sep 17 00:00:00 2001 From: jackgr Date: Wed, 16 Mar 2016 16:53:25 -0600 Subject: [PATCH] Stub out chart repository interface --- pkg/repository/repository.go | 49 ++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 pkg/repository/repository.go diff --git a/pkg/repository/repository.go b/pkg/repository/repository.go new file mode 100644 index 000000000..d141fc775 --- /dev/null +++ b/pkg/repository/repository.go @@ -0,0 +1,49 @@ +/* +Copyright 2015 The Kubernetes Authors All rights reserved. + +Licensed under the Apache License, version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package repository + +import ( + "github.com/kubernetes/helm/pkg/common" + + "regexp" +) + +// Repository abstracts a repository that holds charts, which can be +// used in a Deployment Manager configuration. There can be multiple +// repository implementations. +type Repository interface { + // GetRepositoryName returns the name of this repository + GetRepositoryName() string + // GetRepositoryChart returns the chart of this repository. + GetRepositoryChart() common.RepositoryChart + // GetRepositoryShortURL returns the short URL for this repository. + GetRepositoryShortURL() string + // GetRepositoryFormat returns the format of this repository. + GetRepositoryFormat() common.RepositoryFormat + + // ListCharts lists charts in this repository whose string values conform to the + // supplied regular expression, or all charts, if the regular expression is nil. + ListCharts(regex *regexp.Regexp) ([]*common.Chart, error) + GetChart(name string) (*common.Chart, error) +} + +// ObjectStorageRepository abstracts a repository that resides in an Object Storage, for +// example Google Cloud Storage or AWS S3, etc. +type ObjectStorageRepository interface { + Repository // An ObjectStorageRepository is a Repository. + GetBucket() string +}