-
Notifications
You must be signed in to change notification settings - Fork 238
/
interface.go
63 lines (54 loc) · 1.78 KB
/
interface.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
51
52
53
54
55
56
57
58
59
60
61
62
63
// Copyright © 2019 The Tekton Authors.
//
// 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 cli
import (
"io"
"net/http"
"github.com/jonboulle/clockwork"
"github.com/tektoncd/pipeline/pkg/client/clientset/versioned"
versionedTriggers "github.com/tektoncd/triggers/pkg/client/clientset/versioned"
"k8s.io/client-go/dynamic"
k8s "k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
)
type Stream struct {
In io.Reader
Out io.Writer
Err io.Writer
}
type Clients struct {
Tekton versioned.Interface
Kube k8s.Interface
Triggers versionedTriggers.Interface
HTTPClient http.Client
Dynamic dynamic.Interface
}
// Params interface provides
type Params interface {
// SetKubeConfigPath uses the kubeconfig path to instantiate tekton
// returned by Clientset function
SetKubeConfigPath(string)
// SetKubeContext extends the specificity of the above SetKubeConfigPath
// by using a context other than the default context in the given kubeconfig
SetKubeContext(string)
Clients(...*rest.Config) (*Clients, error)
KubeClient() (k8s.Interface, error)
// SetNamespace can be used to store the namespace parameter that is needed
// by most commands
SetNamespace(string)
Namespace() string
// SetNoColour set colouring or not
SetNoColour(bool)
Time() clockwork.Clock
}