mirror of
https://github.com/rancher/rke.git
synced 2025-07-17 17:01:08 +00:00
Merge pull request #477 from moelsayed/process_authconfig
Process authconfig
This commit is contained in:
commit
d33f1ce65c
@ -8,6 +8,7 @@ import (
|
|||||||
|
|
||||||
b64 "encoding/base64"
|
b64 "encoding/base64"
|
||||||
|
|
||||||
|
"github.com/rancher/rke/docker"
|
||||||
"github.com/rancher/rke/hosts"
|
"github.com/rancher/rke/hosts"
|
||||||
"github.com/rancher/rke/k8s"
|
"github.com/rancher/rke/k8s"
|
||||||
"github.com/rancher/rke/pki"
|
"github.com/rancher/rke/pki"
|
||||||
@ -153,6 +154,8 @@ func (c *Cluster) BuildKubeAPIProcess() v3.Process {
|
|||||||
healthCheck := v3.HealthCheck{
|
healthCheck := v3.HealthCheck{
|
||||||
URL: services.GetHealthCheckURL(true, services.KubeAPIPort),
|
URL: services.GetHealthCheckURL(true, services.KubeAPIPort),
|
||||||
}
|
}
|
||||||
|
registryAuthConfig, _, _ := docker.GetImageRegistryConfig(c.Services.KubeAPI.Image, c.PrivateRegistriesMap)
|
||||||
|
|
||||||
return v3.Process{
|
return v3.Process{
|
||||||
Name: services.KubeAPIContainerName,
|
Name: services.KubeAPIContainerName,
|
||||||
Command: Command,
|
Command: Command,
|
||||||
@ -163,6 +166,7 @@ func (c *Cluster) BuildKubeAPIProcess() v3.Process {
|
|||||||
RestartPolicy: "always",
|
RestartPolicy: "always",
|
||||||
Image: c.Services.KubeAPI.Image,
|
Image: c.Services.KubeAPI.Image,
|
||||||
HealthCheck: healthCheck,
|
HealthCheck: healthCheck,
|
||||||
|
ImageRegistryAuthConfig: registryAuthConfig,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -219,6 +223,8 @@ func (c *Cluster) BuildKubeControllerProcess() v3.Process {
|
|||||||
healthCheck := v3.HealthCheck{
|
healthCheck := v3.HealthCheck{
|
||||||
URL: services.GetHealthCheckURL(false, services.KubeControllerPort),
|
URL: services.GetHealthCheckURL(false, services.KubeControllerPort),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
registryAuthConfig, _, _ := docker.GetImageRegistryConfig(c.Services.KubeController.Image, c.PrivateRegistriesMap)
|
||||||
return v3.Process{
|
return v3.Process{
|
||||||
Name: services.KubeControllerContainerName,
|
Name: services.KubeControllerContainerName,
|
||||||
Command: Command,
|
Command: Command,
|
||||||
@ -229,6 +235,7 @@ func (c *Cluster) BuildKubeControllerProcess() v3.Process {
|
|||||||
RestartPolicy: "always",
|
RestartPolicy: "always",
|
||||||
Image: c.Services.KubeController.Image,
|
Image: c.Services.KubeController.Image,
|
||||||
HealthCheck: healthCheck,
|
HealthCheck: healthCheck,
|
||||||
|
ImageRegistryAuthConfig: registryAuthConfig,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -304,6 +311,8 @@ func (c *Cluster) BuildKubeletProcess(host *hosts.Host) v3.Process {
|
|||||||
healthCheck := v3.HealthCheck{
|
healthCheck := v3.HealthCheck{
|
||||||
URL: services.GetHealthCheckURL(true, services.KubeletPort),
|
URL: services.GetHealthCheckURL(true, services.KubeletPort),
|
||||||
}
|
}
|
||||||
|
registryAuthConfig, _, _ := docker.GetImageRegistryConfig(c.Services.Kubelet.Image, c.PrivateRegistriesMap)
|
||||||
|
|
||||||
return v3.Process{
|
return v3.Process{
|
||||||
Name: services.KubeletContainerName,
|
Name: services.KubeletContainerName,
|
||||||
Command: Command,
|
Command: Command,
|
||||||
@ -315,6 +324,7 @@ func (c *Cluster) BuildKubeletProcess(host *hosts.Host) v3.Process {
|
|||||||
PidMode: "host",
|
PidMode: "host",
|
||||||
Privileged: true,
|
Privileged: true,
|
||||||
HealthCheck: healthCheck,
|
HealthCheck: healthCheck,
|
||||||
|
ImageRegistryAuthConfig: registryAuthConfig,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -353,6 +363,7 @@ func (c *Cluster) BuildKubeProxyProcess() v3.Process {
|
|||||||
healthCheck := v3.HealthCheck{
|
healthCheck := v3.HealthCheck{
|
||||||
URL: services.GetHealthCheckURL(false, services.KubeproxyPort),
|
URL: services.GetHealthCheckURL(false, services.KubeproxyPort),
|
||||||
}
|
}
|
||||||
|
registryAuthConfig, _, _ := docker.GetImageRegistryConfig(c.Services.Kubeproxy.Image, c.PrivateRegistriesMap)
|
||||||
return v3.Process{
|
return v3.Process{
|
||||||
Name: services.KubeproxyContainerName,
|
Name: services.KubeproxyContainerName,
|
||||||
Command: Command,
|
Command: Command,
|
||||||
@ -364,6 +375,7 @@ func (c *Cluster) BuildKubeProxyProcess() v3.Process {
|
|||||||
Privileged: true,
|
Privileged: true,
|
||||||
HealthCheck: healthCheck,
|
HealthCheck: healthCheck,
|
||||||
Image: c.Services.Kubeproxy.Image,
|
Image: c.Services.Kubeproxy.Image,
|
||||||
|
ImageRegistryAuthConfig: registryAuthConfig,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -377,6 +389,7 @@ func (c *Cluster) BuildProxyProcess() v3.Process {
|
|||||||
}
|
}
|
||||||
Env := []string{fmt.Sprintf("%s=%s", services.NginxProxyEnvName, nginxProxyEnv)}
|
Env := []string{fmt.Sprintf("%s=%s", services.NginxProxyEnvName, nginxProxyEnv)}
|
||||||
|
|
||||||
|
registryAuthConfig, _, _ := docker.GetImageRegistryConfig(c.SystemImages.NginxProxy, c.PrivateRegistriesMap)
|
||||||
return v3.Process{
|
return v3.Process{
|
||||||
Name: services.NginxProxyContainerName,
|
Name: services.NginxProxyContainerName,
|
||||||
Env: Env,
|
Env: Env,
|
||||||
@ -385,6 +398,7 @@ func (c *Cluster) BuildProxyProcess() v3.Process {
|
|||||||
RestartPolicy: "always",
|
RestartPolicy: "always",
|
||||||
HealthCheck: v3.HealthCheck{},
|
HealthCheck: v3.HealthCheck{},
|
||||||
Image: c.SystemImages.NginxProxy,
|
Image: c.SystemImages.NginxProxy,
|
||||||
|
ImageRegistryAuthConfig: registryAuthConfig,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -424,6 +438,7 @@ func (c *Cluster) BuildSchedulerProcess() v3.Process {
|
|||||||
healthCheck := v3.HealthCheck{
|
healthCheck := v3.HealthCheck{
|
||||||
URL: services.GetHealthCheckURL(false, services.SchedulerPort),
|
URL: services.GetHealthCheckURL(false, services.SchedulerPort),
|
||||||
}
|
}
|
||||||
|
registryAuthConfig, _, _ := docker.GetImageRegistryConfig(c.Services.Scheduler.Image, c.PrivateRegistriesMap)
|
||||||
return v3.Process{
|
return v3.Process{
|
||||||
Name: services.SchedulerContainerName,
|
Name: services.SchedulerContainerName,
|
||||||
Command: Command,
|
Command: Command,
|
||||||
@ -433,15 +448,18 @@ func (c *Cluster) BuildSchedulerProcess() v3.Process {
|
|||||||
RestartPolicy: "always",
|
RestartPolicy: "always",
|
||||||
Image: c.Services.Scheduler.Image,
|
Image: c.Services.Scheduler.Image,
|
||||||
HealthCheck: healthCheck,
|
HealthCheck: healthCheck,
|
||||||
|
ImageRegistryAuthConfig: registryAuthConfig,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Cluster) BuildSidecarProcess() v3.Process {
|
func (c *Cluster) BuildSidecarProcess() v3.Process {
|
||||||
|
registryAuthConfig, _, _ := docker.GetImageRegistryConfig(c.SystemImages.KubernetesServicesSidecar, c.PrivateRegistriesMap)
|
||||||
return v3.Process{
|
return v3.Process{
|
||||||
Name: services.SidekickContainerName,
|
Name: services.SidekickContainerName,
|
||||||
NetworkMode: "none",
|
NetworkMode: "none",
|
||||||
Image: c.SystemImages.KubernetesServicesSidecar,
|
Image: c.SystemImages.KubernetesServicesSidecar,
|
||||||
HealthCheck: v3.HealthCheck{},
|
HealthCheck: v3.HealthCheck{},
|
||||||
|
ImageRegistryAuthConfig: registryAuthConfig,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -503,6 +521,8 @@ func (c *Cluster) BuildEtcdProcess(host *hosts.Host, etcdHosts []*hosts.Host) v3
|
|||||||
healthCheck := v3.HealthCheck{
|
healthCheck := v3.HealthCheck{
|
||||||
URL: services.EtcdHealthCheckURL,
|
URL: services.EtcdHealthCheckURL,
|
||||||
}
|
}
|
||||||
|
registryAuthConfig, _, _ := docker.GetImageRegistryConfig(c.Services.Etcd.Image, c.PrivateRegistriesMap)
|
||||||
|
|
||||||
return v3.Process{
|
return v3.Process{
|
||||||
Name: services.EtcdContainerName,
|
Name: services.EtcdContainerName,
|
||||||
Args: args,
|
Args: args,
|
||||||
@ -511,6 +531,7 @@ func (c *Cluster) BuildEtcdProcess(host *hosts.Host, etcdHosts []*hosts.Host) v3
|
|||||||
RestartPolicy: "always",
|
RestartPolicy: "always",
|
||||||
Image: c.Services.Etcd.Image,
|
Image: c.Services.Etcd.Image,
|
||||||
HealthCheck: healthCheck,
|
HealthCheck: healthCheck,
|
||||||
|
ImageRegistryAuthConfig: registryAuthConfig,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -159,31 +159,16 @@ func localImageExists(ctx context.Context, dClient *client.Client, hostname stri
|
|||||||
}
|
}
|
||||||
|
|
||||||
func pullImage(ctx context.Context, dClient *client.Client, hostname string, containerImage string, prsMap map[string]v3.PrivateRegistry) error {
|
func pullImage(ctx context.Context, dClient *client.Client, hostname string, containerImage string, prsMap map[string]v3.PrivateRegistry) error {
|
||||||
|
|
||||||
pullOptions := types.ImagePullOptions{}
|
pullOptions := types.ImagePullOptions{}
|
||||||
containerNamed, err := ref.ParseNormalizedNamed(containerImage)
|
|
||||||
|
regAuth, prURL, err := GetImageRegistryConfig(containerImage, prsMap)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
if regAuth != "" && prURL == DockerRegistryURL {
|
||||||
regURL := ref.Domain(containerNamed)
|
pullOptions.PrivilegeFunc = tryRegistryAuth(prsMap[prURL])
|
||||||
if pr, ok := prsMap[regURL]; ok {
|
|
||||||
// We do this if we have some docker.io login information
|
|
||||||
regAuth, err := getRegistryAuth(pr)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
}
|
||||||
if pr.URL == DockerRegistryURL {
|
|
||||||
pullOptions.RegistryAuth = regAuth
|
pullOptions.RegistryAuth = regAuth
|
||||||
} else {
|
|
||||||
// We have a registry, but it's not docker.io
|
|
||||||
// this could be public or private, ImagePull() can handle it
|
|
||||||
// if we provide a PrivilegeFunc
|
|
||||||
|
|
||||||
pullOptions.PrivilegeFunc = tryRegistryAuth(pr)
|
|
||||||
pullOptions.RegistryAuth = regAuth
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
out, err := dClient.ImagePull(ctx, containerImage, pullOptions)
|
out, err := dClient.ImagePull(ctx, containerImage, pullOptions)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -360,3 +345,17 @@ func getRegistryAuth(pr v3.PrivateRegistry) (string, error) {
|
|||||||
}
|
}
|
||||||
return base64.URLEncoding.EncodeToString(encodedJSON), nil
|
return base64.URLEncoding.EncodeToString(encodedJSON), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func GetImageRegistryConfig(image string, prsMap map[string]v3.PrivateRegistry) (string, string, error) {
|
||||||
|
namedImage, err := ref.ParseNormalizedNamed(image)
|
||||||
|
if err != nil {
|
||||||
|
return "", "", err
|
||||||
|
}
|
||||||
|
regURL := ref.Domain(namedImage)
|
||||||
|
if pr, ok := prsMap[regURL]; ok {
|
||||||
|
// We do this if we have some docker.io login information
|
||||||
|
regAuth, err := getRegistryAuth(pr)
|
||||||
|
return regAuth, pr.URL, err
|
||||||
|
}
|
||||||
|
return "", "", nil
|
||||||
|
}
|
||||||
|
@ -23,5 +23,5 @@ github.com/coreos/etcd 52f73c5a6cb0d1d196ffd6eced406c9d8502078
|
|||||||
github.com/coreos/go-semver e214231b295a8ea9479f11b70b35d5acf3556d9b
|
github.com/coreos/go-semver e214231b295a8ea9479f11b70b35d5acf3556d9b
|
||||||
github.com/ugorji/go/codec ccfe18359b55b97855cee1d3f74e5efbda4869dc
|
github.com/ugorji/go/codec ccfe18359b55b97855cee1d3f74e5efbda4869dc
|
||||||
|
|
||||||
github.com/rancher/norman 510ed570d2e29a00e6bc1bcd18bdcad6c6860a13
|
github.com/rancher/norman ff60298f31f081b06d198815b4c178a578664f7d
|
||||||
github.com/rancher/types 0efe60ff1a97dbe1a55eed74e685c73ca4cd8c82
|
github.com/rancher/types 2e66000b6b101dbad981c350fd8216bd90ad562a
|
||||||
|
25
vendor/github.com/gorilla/websocket/.gitignore
generated
vendored
25
vendor/github.com/gorilla/websocket/.gitignore
generated
vendored
@ -1,25 +0,0 @@
|
|||||||
# Compiled Object files, Static and Dynamic libs (Shared Objects)
|
|
||||||
*.o
|
|
||||||
*.a
|
|
||||||
*.so
|
|
||||||
|
|
||||||
# Folders
|
|
||||||
_obj
|
|
||||||
_test
|
|
||||||
|
|
||||||
# Architecture specific extensions/prefixes
|
|
||||||
*.[568vq]
|
|
||||||
[568vq].out
|
|
||||||
|
|
||||||
*.cgo1.go
|
|
||||||
*.cgo2.c
|
|
||||||
_cgo_defun.c
|
|
||||||
_cgo_gotypes.go
|
|
||||||
_cgo_export.*
|
|
||||||
|
|
||||||
_testmain.go
|
|
||||||
|
|
||||||
*.exe
|
|
||||||
|
|
||||||
.idea/
|
|
||||||
*.iml
|
|
19
vendor/github.com/gorilla/websocket/.travis.yml
generated
vendored
19
vendor/github.com/gorilla/websocket/.travis.yml
generated
vendored
@ -1,19 +0,0 @@
|
|||||||
language: go
|
|
||||||
sudo: false
|
|
||||||
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- go: 1.4
|
|
||||||
- go: 1.5
|
|
||||||
- go: 1.6
|
|
||||||
- go: 1.7
|
|
||||||
- go: 1.8
|
|
||||||
- go: tip
|
|
||||||
allow_failures:
|
|
||||||
- go: tip
|
|
||||||
|
|
||||||
script:
|
|
||||||
- go get -t -v ./...
|
|
||||||
- diff -u <(echo -n) <(gofmt -d .)
|
|
||||||
- go vet $(go list ./... | grep -v /vendor/)
|
|
||||||
- go test -v -race ./...
|
|
8
vendor/github.com/gorilla/websocket/AUTHORS
generated
vendored
8
vendor/github.com/gorilla/websocket/AUTHORS
generated
vendored
@ -1,8 +0,0 @@
|
|||||||
# This is the official list of Gorilla WebSocket authors for copyright
|
|
||||||
# purposes.
|
|
||||||
#
|
|
||||||
# Please keep the list sorted.
|
|
||||||
|
|
||||||
Gary Burd <gary@beagledreams.com>
|
|
||||||
Joachim Bauch <mail@joachim-bauch.de>
|
|
||||||
|
|
22
vendor/github.com/gorilla/websocket/LICENSE
generated
vendored
22
vendor/github.com/gorilla/websocket/LICENSE
generated
vendored
@ -1,22 +0,0 @@
|
|||||||
Copyright (c) 2013 The Gorilla WebSocket Authors. All rights reserved.
|
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
|
||||||
modification, are permitted provided that the following conditions are met:
|
|
||||||
|
|
||||||
Redistributions of source code must retain the above copyright notice, this
|
|
||||||
list of conditions and the following disclaimer.
|
|
||||||
|
|
||||||
Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
this list of conditions and the following disclaimer in the documentation
|
|
||||||
and/or other materials provided with the distribution.
|
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
||||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
||||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
||||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
||||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
||||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
||||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
||||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
64
vendor/github.com/gorilla/websocket/README.md
generated
vendored
64
vendor/github.com/gorilla/websocket/README.md
generated
vendored
@ -1,64 +0,0 @@
|
|||||||
# Gorilla WebSocket
|
|
||||||
|
|
||||||
Gorilla WebSocket is a [Go](http://golang.org/) implementation of the
|
|
||||||
[WebSocket](http://www.rfc-editor.org/rfc/rfc6455.txt) protocol.
|
|
||||||
|
|
||||||
[](https://travis-ci.org/gorilla/websocket)
|
|
||||||
[](https://godoc.org/github.com/gorilla/websocket)
|
|
||||||
|
|
||||||
### Documentation
|
|
||||||
|
|
||||||
* [API Reference](http://godoc.org/github.com/gorilla/websocket)
|
|
||||||
* [Chat example](https://github.com/gorilla/websocket/tree/master/examples/chat)
|
|
||||||
* [Command example](https://github.com/gorilla/websocket/tree/master/examples/command)
|
|
||||||
* [Client and server example](https://github.com/gorilla/websocket/tree/master/examples/echo)
|
|
||||||
* [File watch example](https://github.com/gorilla/websocket/tree/master/examples/filewatch)
|
|
||||||
|
|
||||||
### Status
|
|
||||||
|
|
||||||
The Gorilla WebSocket package provides a complete and tested implementation of
|
|
||||||
the [WebSocket](http://www.rfc-editor.org/rfc/rfc6455.txt) protocol. The
|
|
||||||
package API is stable.
|
|
||||||
|
|
||||||
### Installation
|
|
||||||
|
|
||||||
go get github.com/gorilla/websocket
|
|
||||||
|
|
||||||
### Protocol Compliance
|
|
||||||
|
|
||||||
The Gorilla WebSocket package passes the server tests in the [Autobahn Test
|
|
||||||
Suite](http://autobahn.ws/testsuite) using the application in the [examples/autobahn
|
|
||||||
subdirectory](https://github.com/gorilla/websocket/tree/master/examples/autobahn).
|
|
||||||
|
|
||||||
### Gorilla WebSocket compared with other packages
|
|
||||||
|
|
||||||
<table>
|
|
||||||
<tr>
|
|
||||||
<th></th>
|
|
||||||
<th><a href="http://godoc.org/github.com/gorilla/websocket">github.com/gorilla</a></th>
|
|
||||||
<th><a href="http://godoc.org/golang.org/x/net/websocket">golang.org/x/net</a></th>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<tr><td colspan="3"><a href="http://tools.ietf.org/html/rfc6455">RFC 6455</a> Features</td></tr>
|
|
||||||
<tr><td>Passes <a href="http://autobahn.ws/testsuite/">Autobahn Test Suite</a></td><td><a href="https://github.com/gorilla/websocket/tree/master/examples/autobahn">Yes</a></td><td>No</td></tr>
|
|
||||||
<tr><td>Receive <a href="https://tools.ietf.org/html/rfc6455#section-5.4">fragmented</a> message<td>Yes</td><td><a href="https://code.google.com/p/go/issues/detail?id=7632">No</a>, see note 1</td></tr>
|
|
||||||
<tr><td>Send <a href="https://tools.ietf.org/html/rfc6455#section-5.5.1">close</a> message</td><td><a href="http://godoc.org/github.com/gorilla/websocket#hdr-Control_Messages">Yes</a></td><td><a href="https://code.google.com/p/go/issues/detail?id=4588">No</a></td></tr>
|
|
||||||
<tr><td>Send <a href="https://tools.ietf.org/html/rfc6455#section-5.5.2">pings</a> and receive <a href="https://tools.ietf.org/html/rfc6455#section-5.5.3">pongs</a></td><td><a href="http://godoc.org/github.com/gorilla/websocket#hdr-Control_Messages">Yes</a></td><td>No</td></tr>
|
|
||||||
<tr><td>Get the <a href="https://tools.ietf.org/html/rfc6455#section-5.6">type</a> of a received data message</td><td>Yes</td><td>Yes, see note 2</td></tr>
|
|
||||||
<tr><td colspan="3">Other Features</tr></td>
|
|
||||||
<tr><td><a href="https://tools.ietf.org/html/rfc7692">Compression Extensions</a></td><td>Experimental</td><td>No</td></tr>
|
|
||||||
<tr><td>Read message using io.Reader</td><td><a href="http://godoc.org/github.com/gorilla/websocket#Conn.NextReader">Yes</a></td><td>No, see note 3</td></tr>
|
|
||||||
<tr><td>Write message using io.WriteCloser</td><td><a href="http://godoc.org/github.com/gorilla/websocket#Conn.NextWriter">Yes</a></td><td>No, see note 3</td></tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
Notes:
|
|
||||||
|
|
||||||
1. Large messages are fragmented in [Chrome's new WebSocket implementation](http://www.ietf.org/mail-archive/web/hybi/current/msg10503.html).
|
|
||||||
2. The application can get the type of a received data message by implementing
|
|
||||||
a [Codec marshal](http://godoc.org/golang.org/x/net/websocket#Codec.Marshal)
|
|
||||||
function.
|
|
||||||
3. The go.net io.Reader and io.Writer operate across WebSocket frame boundaries.
|
|
||||||
Read returns when the input buffer is full or a frame boundary is
|
|
||||||
encountered. Each call to Write sends a single frame message. The Gorilla
|
|
||||||
io.Reader and io.WriteCloser operate on a single WebSocket message.
|
|
||||||
|
|
392
vendor/github.com/gorilla/websocket/client.go
generated
vendored
392
vendor/github.com/gorilla/websocket/client.go
generated
vendored
@ -1,392 +0,0 @@
|
|||||||
// Copyright 2013 The Gorilla WebSocket Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
package websocket
|
|
||||||
|
|
||||||
import (
|
|
||||||
"bufio"
|
|
||||||
"bytes"
|
|
||||||
"crypto/tls"
|
|
||||||
"encoding/base64"
|
|
||||||
"errors"
|
|
||||||
"io"
|
|
||||||
"io/ioutil"
|
|
||||||
"net"
|
|
||||||
"net/http"
|
|
||||||
"net/url"
|
|
||||||
"strings"
|
|
||||||
"time"
|
|
||||||
)
|
|
||||||
|
|
||||||
// ErrBadHandshake is returned when the server response to opening handshake is
|
|
||||||
// invalid.
|
|
||||||
var ErrBadHandshake = errors.New("websocket: bad handshake")
|
|
||||||
|
|
||||||
var errInvalidCompression = errors.New("websocket: invalid compression negotiation")
|
|
||||||
|
|
||||||
// NewClient creates a new client connection using the given net connection.
|
|
||||||
// The URL u specifies the host and request URI. Use requestHeader to specify
|
|
||||||
// the origin (Origin), subprotocols (Sec-WebSocket-Protocol) and cookies
|
|
||||||
// (Cookie). Use the response.Header to get the selected subprotocol
|
|
||||||
// (Sec-WebSocket-Protocol) and cookies (Set-Cookie).
|
|
||||||
//
|
|
||||||
// If the WebSocket handshake fails, ErrBadHandshake is returned along with a
|
|
||||||
// non-nil *http.Response so that callers can handle redirects, authentication,
|
|
||||||
// etc.
|
|
||||||
//
|
|
||||||
// Deprecated: Use Dialer instead.
|
|
||||||
func NewClient(netConn net.Conn, u *url.URL, requestHeader http.Header, readBufSize, writeBufSize int) (c *Conn, response *http.Response, err error) {
|
|
||||||
d := Dialer{
|
|
||||||
ReadBufferSize: readBufSize,
|
|
||||||
WriteBufferSize: writeBufSize,
|
|
||||||
NetDial: func(net, addr string) (net.Conn, error) {
|
|
||||||
return netConn, nil
|
|
||||||
},
|
|
||||||
}
|
|
||||||
return d.Dial(u.String(), requestHeader)
|
|
||||||
}
|
|
||||||
|
|
||||||
// A Dialer contains options for connecting to WebSocket server.
|
|
||||||
type Dialer struct {
|
|
||||||
// NetDial specifies the dial function for creating TCP connections. If
|
|
||||||
// NetDial is nil, net.Dial is used.
|
|
||||||
NetDial func(network, addr string) (net.Conn, error)
|
|
||||||
|
|
||||||
// Proxy specifies a function to return a proxy for a given
|
|
||||||
// Request. If the function returns a non-nil error, the
|
|
||||||
// request is aborted with the provided error.
|
|
||||||
// If Proxy is nil or returns a nil *URL, no proxy is used.
|
|
||||||
Proxy func(*http.Request) (*url.URL, error)
|
|
||||||
|
|
||||||
// TLSClientConfig specifies the TLS configuration to use with tls.Client.
|
|
||||||
// If nil, the default configuration is used.
|
|
||||||
TLSClientConfig *tls.Config
|
|
||||||
|
|
||||||
// HandshakeTimeout specifies the duration for the handshake to complete.
|
|
||||||
HandshakeTimeout time.Duration
|
|
||||||
|
|
||||||
// ReadBufferSize and WriteBufferSize specify I/O buffer sizes. If a buffer
|
|
||||||
// size is zero, then a useful default size is used. The I/O buffer sizes
|
|
||||||
// do not limit the size of the messages that can be sent or received.
|
|
||||||
ReadBufferSize, WriteBufferSize int
|
|
||||||
|
|
||||||
// Subprotocols specifies the client's requested subprotocols.
|
|
||||||
Subprotocols []string
|
|
||||||
|
|
||||||
// EnableCompression specifies if the client should attempt to negotiate
|
|
||||||
// per message compression (RFC 7692). Setting this value to true does not
|
|
||||||
// guarantee that compression will be supported. Currently only "no context
|
|
||||||
// takeover" modes are supported.
|
|
||||||
EnableCompression bool
|
|
||||||
|
|
||||||
// Jar specifies the cookie jar.
|
|
||||||
// If Jar is nil, cookies are not sent in requests and ignored
|
|
||||||
// in responses.
|
|
||||||
Jar http.CookieJar
|
|
||||||
}
|
|
||||||
|
|
||||||
var errMalformedURL = errors.New("malformed ws or wss URL")
|
|
||||||
|
|
||||||
// parseURL parses the URL.
|
|
||||||
//
|
|
||||||
// This function is a replacement for the standard library url.Parse function.
|
|
||||||
// In Go 1.4 and earlier, url.Parse loses information from the path.
|
|
||||||
func parseURL(s string) (*url.URL, error) {
|
|
||||||
// From the RFC:
|
|
||||||
//
|
|
||||||
// ws-URI = "ws:" "//" host [ ":" port ] path [ "?" query ]
|
|
||||||
// wss-URI = "wss:" "//" host [ ":" port ] path [ "?" query ]
|
|
||||||
var u url.URL
|
|
||||||
switch {
|
|
||||||
case strings.HasPrefix(s, "ws://"):
|
|
||||||
u.Scheme = "ws"
|
|
||||||
s = s[len("ws://"):]
|
|
||||||
case strings.HasPrefix(s, "wss://"):
|
|
||||||
u.Scheme = "wss"
|
|
||||||
s = s[len("wss://"):]
|
|
||||||
default:
|
|
||||||
return nil, errMalformedURL
|
|
||||||
}
|
|
||||||
|
|
||||||
if i := strings.Index(s, "?"); i >= 0 {
|
|
||||||
u.RawQuery = s[i+1:]
|
|
||||||
s = s[:i]
|
|
||||||
}
|
|
||||||
|
|
||||||
if i := strings.Index(s, "/"); i >= 0 {
|
|
||||||
u.Opaque = s[i:]
|
|
||||||
s = s[:i]
|
|
||||||
} else {
|
|
||||||
u.Opaque = "/"
|
|
||||||
}
|
|
||||||
|
|
||||||
u.Host = s
|
|
||||||
|
|
||||||
if strings.Contains(u.Host, "@") {
|
|
||||||
// Don't bother parsing user information because user information is
|
|
||||||
// not allowed in websocket URIs.
|
|
||||||
return nil, errMalformedURL
|
|
||||||
}
|
|
||||||
|
|
||||||
return &u, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func hostPortNoPort(u *url.URL) (hostPort, hostNoPort string) {
|
|
||||||
hostPort = u.Host
|
|
||||||
hostNoPort = u.Host
|
|
||||||
if i := strings.LastIndex(u.Host, ":"); i > strings.LastIndex(u.Host, "]") {
|
|
||||||
hostNoPort = hostNoPort[:i]
|
|
||||||
} else {
|
|
||||||
switch u.Scheme {
|
|
||||||
case "wss":
|
|
||||||
hostPort += ":443"
|
|
||||||
case "https":
|
|
||||||
hostPort += ":443"
|
|
||||||
default:
|
|
||||||
hostPort += ":80"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return hostPort, hostNoPort
|
|
||||||
}
|
|
||||||
|
|
||||||
// DefaultDialer is a dialer with all fields set to the default zero values.
|
|
||||||
var DefaultDialer = &Dialer{
|
|
||||||
Proxy: http.ProxyFromEnvironment,
|
|
||||||
}
|
|
||||||
|
|
||||||
// Dial creates a new client connection. Use requestHeader to specify the
|
|
||||||
// origin (Origin), subprotocols (Sec-WebSocket-Protocol) and cookies (Cookie).
|
|
||||||
// Use the response.Header to get the selected subprotocol
|
|
||||||
// (Sec-WebSocket-Protocol) and cookies (Set-Cookie).
|
|
||||||
//
|
|
||||||
// If the WebSocket handshake fails, ErrBadHandshake is returned along with a
|
|
||||||
// non-nil *http.Response so that callers can handle redirects, authentication,
|
|
||||||
// etcetera. The response body may not contain the entire response and does not
|
|
||||||
// need to be closed by the application.
|
|
||||||
func (d *Dialer) Dial(urlStr string, requestHeader http.Header) (*Conn, *http.Response, error) {
|
|
||||||
|
|
||||||
if d == nil {
|
|
||||||
d = &Dialer{
|
|
||||||
Proxy: http.ProxyFromEnvironment,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
challengeKey, err := generateChallengeKey()
|
|
||||||
if err != nil {
|
|
||||||
return nil, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
u, err := parseURL(urlStr)
|
|
||||||
if err != nil {
|
|
||||||
return nil, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
switch u.Scheme {
|
|
||||||
case "ws":
|
|
||||||
u.Scheme = "http"
|
|
||||||
case "wss":
|
|
||||||
u.Scheme = "https"
|
|
||||||
default:
|
|
||||||
return nil, nil, errMalformedURL
|
|
||||||
}
|
|
||||||
|
|
||||||
if u.User != nil {
|
|
||||||
// User name and password are not allowed in websocket URIs.
|
|
||||||
return nil, nil, errMalformedURL
|
|
||||||
}
|
|
||||||
|
|
||||||
req := &http.Request{
|
|
||||||
Method: "GET",
|
|
||||||
URL: u,
|
|
||||||
Proto: "HTTP/1.1",
|
|
||||||
ProtoMajor: 1,
|
|
||||||
ProtoMinor: 1,
|
|
||||||
Header: make(http.Header),
|
|
||||||
Host: u.Host,
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set the cookies present in the cookie jar of the dialer
|
|
||||||
if d.Jar != nil {
|
|
||||||
for _, cookie := range d.Jar.Cookies(u) {
|
|
||||||
req.AddCookie(cookie)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set the request headers using the capitalization for names and values in
|
|
||||||
// RFC examples. Although the capitalization shouldn't matter, there are
|
|
||||||
// servers that depend on it. The Header.Set method is not used because the
|
|
||||||
// method canonicalizes the header names.
|
|
||||||
req.Header["Upgrade"] = []string{"websocket"}
|
|
||||||
req.Header["Connection"] = []string{"Upgrade"}
|
|
||||||
req.Header["Sec-WebSocket-Key"] = []string{challengeKey}
|
|
||||||
req.Header["Sec-WebSocket-Version"] = []string{"13"}
|
|
||||||
if len(d.Subprotocols) > 0 {
|
|
||||||
req.Header["Sec-WebSocket-Protocol"] = []string{strings.Join(d.Subprotocols, ", ")}
|
|
||||||
}
|
|
||||||
for k, vs := range requestHeader {
|
|
||||||
switch {
|
|
||||||
case k == "Host":
|
|
||||||
if len(vs) > 0 {
|
|
||||||
req.Host = vs[0]
|
|
||||||
}
|
|
||||||
case k == "Upgrade" ||
|
|
||||||
k == "Connection" ||
|
|
||||||
k == "Sec-Websocket-Key" ||
|
|
||||||
k == "Sec-Websocket-Version" ||
|
|
||||||
k == "Sec-Websocket-Extensions" ||
|
|
||||||
(k == "Sec-Websocket-Protocol" && len(d.Subprotocols) > 0):
|
|
||||||
return nil, nil, errors.New("websocket: duplicate header not allowed: " + k)
|
|
||||||
default:
|
|
||||||
req.Header[k] = vs
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if d.EnableCompression {
|
|
||||||
req.Header.Set("Sec-Websocket-Extensions", "permessage-deflate; server_no_context_takeover; client_no_context_takeover")
|
|
||||||
}
|
|
||||||
|
|
||||||
hostPort, hostNoPort := hostPortNoPort(u)
|
|
||||||
|
|
||||||
var proxyURL *url.URL
|
|
||||||
// Check wether the proxy method has been configured
|
|
||||||
if d.Proxy != nil {
|
|
||||||
proxyURL, err = d.Proxy(req)
|
|
||||||
}
|
|
||||||
if err != nil {
|
|
||||||
return nil, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
var targetHostPort string
|
|
||||||
if proxyURL != nil {
|
|
||||||
targetHostPort, _ = hostPortNoPort(proxyURL)
|
|
||||||
} else {
|
|
||||||
targetHostPort = hostPort
|
|
||||||
}
|
|
||||||
|
|
||||||
var deadline time.Time
|
|
||||||
if d.HandshakeTimeout != 0 {
|
|
||||||
deadline = time.Now().Add(d.HandshakeTimeout)
|
|
||||||
}
|
|
||||||
|
|
||||||
netDial := d.NetDial
|
|
||||||
if netDial == nil {
|
|
||||||
netDialer := &net.Dialer{Deadline: deadline}
|
|
||||||
netDial = netDialer.Dial
|
|
||||||
}
|
|
||||||
|
|
||||||
netConn, err := netDial("tcp", targetHostPort)
|
|
||||||
if err != nil {
|
|
||||||
return nil, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
defer func() {
|
|
||||||
if netConn != nil {
|
|
||||||
netConn.Close()
|
|
||||||
}
|
|
||||||
}()
|
|
||||||
|
|
||||||
if err := netConn.SetDeadline(deadline); err != nil {
|
|
||||||
return nil, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
if proxyURL != nil {
|
|
||||||
connectHeader := make(http.Header)
|
|
||||||
if user := proxyURL.User; user != nil {
|
|
||||||
proxyUser := user.Username()
|
|
||||||
if proxyPassword, passwordSet := user.Password(); passwordSet {
|
|
||||||
credential := base64.StdEncoding.EncodeToString([]byte(proxyUser + ":" + proxyPassword))
|
|
||||||
connectHeader.Set("Proxy-Authorization", "Basic "+credential)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
connectReq := &http.Request{
|
|
||||||
Method: "CONNECT",
|
|
||||||
URL: &url.URL{Opaque: hostPort},
|
|
||||||
Host: hostPort,
|
|
||||||
Header: connectHeader,
|
|
||||||
}
|
|
||||||
|
|
||||||
connectReq.Write(netConn)
|
|
||||||
|
|
||||||
// Read response.
|
|
||||||
// Okay to use and discard buffered reader here, because
|
|
||||||
// TLS server will not speak until spoken to.
|
|
||||||
br := bufio.NewReader(netConn)
|
|
||||||
resp, err := http.ReadResponse(br, connectReq)
|
|
||||||
if err != nil {
|
|
||||||
return nil, nil, err
|
|
||||||
}
|
|
||||||
if resp.StatusCode != 200 {
|
|
||||||
f := strings.SplitN(resp.Status, " ", 2)
|
|
||||||
return nil, nil, errors.New(f[1])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if u.Scheme == "https" {
|
|
||||||
cfg := cloneTLSConfig(d.TLSClientConfig)
|
|
||||||
if cfg.ServerName == "" {
|
|
||||||
cfg.ServerName = hostNoPort
|
|
||||||
}
|
|
||||||
tlsConn := tls.Client(netConn, cfg)
|
|
||||||
netConn = tlsConn
|
|
||||||
if err := tlsConn.Handshake(); err != nil {
|
|
||||||
return nil, nil, err
|
|
||||||
}
|
|
||||||
if !cfg.InsecureSkipVerify {
|
|
||||||
if err := tlsConn.VerifyHostname(cfg.ServerName); err != nil {
|
|
||||||
return nil, nil, err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
conn := newConn(netConn, false, d.ReadBufferSize, d.WriteBufferSize)
|
|
||||||
|
|
||||||
if err := req.Write(netConn); err != nil {
|
|
||||||
return nil, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
resp, err := http.ReadResponse(conn.br, req)
|
|
||||||
if err != nil {
|
|
||||||
return nil, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
if d.Jar != nil {
|
|
||||||
if rc := resp.Cookies(); len(rc) > 0 {
|
|
||||||
d.Jar.SetCookies(u, rc)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if resp.StatusCode != 101 ||
|
|
||||||
!strings.EqualFold(resp.Header.Get("Upgrade"), "websocket") ||
|
|
||||||
!strings.EqualFold(resp.Header.Get("Connection"), "upgrade") ||
|
|
||||||
resp.Header.Get("Sec-Websocket-Accept") != computeAcceptKey(challengeKey) {
|
|
||||||
// Before closing the network connection on return from this
|
|
||||||
// function, slurp up some of the response to aid application
|
|
||||||
// debugging.
|
|
||||||
buf := make([]byte, 1024)
|
|
||||||
n, _ := io.ReadFull(resp.Body, buf)
|
|
||||||
resp.Body = ioutil.NopCloser(bytes.NewReader(buf[:n]))
|
|
||||||
return nil, resp, ErrBadHandshake
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, ext := range parseExtensions(resp.Header) {
|
|
||||||
if ext[""] != "permessage-deflate" {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
_, snct := ext["server_no_context_takeover"]
|
|
||||||
_, cnct := ext["client_no_context_takeover"]
|
|
||||||
if !snct || !cnct {
|
|
||||||
return nil, resp, errInvalidCompression
|
|
||||||
}
|
|
||||||
conn.newCompressionWriter = compressNoContextTakeover
|
|
||||||
conn.newDecompressionReader = decompressNoContextTakeover
|
|
||||||
break
|
|
||||||
}
|
|
||||||
|
|
||||||
resp.Body = ioutil.NopCloser(bytes.NewReader([]byte{}))
|
|
||||||
conn.subprotocol = resp.Header.Get("Sec-Websocket-Protocol")
|
|
||||||
|
|
||||||
netConn.SetDeadline(time.Time{})
|
|
||||||
netConn = nil // to avoid close in defer.
|
|
||||||
return conn, resp, nil
|
|
||||||
}
|
|
16
vendor/github.com/gorilla/websocket/client_clone.go
generated
vendored
16
vendor/github.com/gorilla/websocket/client_clone.go
generated
vendored
@ -1,16 +0,0 @@
|
|||||||
// Copyright 2013 The Gorilla WebSocket Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
// +build go1.8
|
|
||||||
|
|
||||||
package websocket
|
|
||||||
|
|
||||||
import "crypto/tls"
|
|
||||||
|
|
||||||
func cloneTLSConfig(cfg *tls.Config) *tls.Config {
|
|
||||||
if cfg == nil {
|
|
||||||
return &tls.Config{}
|
|
||||||
}
|
|
||||||
return cfg.Clone()
|
|
||||||
}
|
|
38
vendor/github.com/gorilla/websocket/client_clone_legacy.go
generated
vendored
38
vendor/github.com/gorilla/websocket/client_clone_legacy.go
generated
vendored
@ -1,38 +0,0 @@
|
|||||||
// Copyright 2013 The Gorilla WebSocket Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
// +build !go1.8
|
|
||||||
|
|
||||||
package websocket
|
|
||||||
|
|
||||||
import "crypto/tls"
|
|
||||||
|
|
||||||
// cloneTLSConfig clones all public fields except the fields
|
|
||||||
// SessionTicketsDisabled and SessionTicketKey. This avoids copying the
|
|
||||||
// sync.Mutex in the sync.Once and makes it safe to call cloneTLSConfig on a
|
|
||||||
// config in active use.
|
|
||||||
func cloneTLSConfig(cfg *tls.Config) *tls.Config {
|
|
||||||
if cfg == nil {
|
|
||||||
return &tls.Config{}
|
|
||||||
}
|
|
||||||
return &tls.Config{
|
|
||||||
Rand: cfg.Rand,
|
|
||||||
Time: cfg.Time,
|
|
||||||
Certificates: cfg.Certificates,
|
|
||||||
NameToCertificate: cfg.NameToCertificate,
|
|
||||||
GetCertificate: cfg.GetCertificate,
|
|
||||||
RootCAs: cfg.RootCAs,
|
|
||||||
NextProtos: cfg.NextProtos,
|
|
||||||
ServerName: cfg.ServerName,
|
|
||||||
ClientAuth: cfg.ClientAuth,
|
|
||||||
ClientCAs: cfg.ClientCAs,
|
|
||||||
InsecureSkipVerify: cfg.InsecureSkipVerify,
|
|
||||||
CipherSuites: cfg.CipherSuites,
|
|
||||||
PreferServerCipherSuites: cfg.PreferServerCipherSuites,
|
|
||||||
ClientSessionCache: cfg.ClientSessionCache,
|
|
||||||
MinVersion: cfg.MinVersion,
|
|
||||||
MaxVersion: cfg.MaxVersion,
|
|
||||||
CurvePreferences: cfg.CurvePreferences,
|
|
||||||
}
|
|
||||||
}
|
|
148
vendor/github.com/gorilla/websocket/compression.go
generated
vendored
148
vendor/github.com/gorilla/websocket/compression.go
generated
vendored
@ -1,148 +0,0 @@
|
|||||||
// Copyright 2017 The Gorilla WebSocket Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
package websocket
|
|
||||||
|
|
||||||
import (
|
|
||||||
"compress/flate"
|
|
||||||
"errors"
|
|
||||||
"io"
|
|
||||||
"strings"
|
|
||||||
"sync"
|
|
||||||
)
|
|
||||||
|
|
||||||
const (
|
|
||||||
minCompressionLevel = -2 // flate.HuffmanOnly not defined in Go < 1.6
|
|
||||||
maxCompressionLevel = flate.BestCompression
|
|
||||||
defaultCompressionLevel = 1
|
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
|
||||||
flateWriterPools [maxCompressionLevel - minCompressionLevel + 1]sync.Pool
|
|
||||||
flateReaderPool = sync.Pool{New: func() interface{} {
|
|
||||||
return flate.NewReader(nil)
|
|
||||||
}}
|
|
||||||
)
|
|
||||||
|
|
||||||
func decompressNoContextTakeover(r io.Reader) io.ReadCloser {
|
|
||||||
const tail =
|
|
||||||
// Add four bytes as specified in RFC
|
|
||||||
"\x00\x00\xff\xff" +
|
|
||||||
// Add final block to squelch unexpected EOF error from flate reader.
|
|
||||||
"\x01\x00\x00\xff\xff"
|
|
||||||
|
|
||||||
fr, _ := flateReaderPool.Get().(io.ReadCloser)
|
|
||||||
fr.(flate.Resetter).Reset(io.MultiReader(r, strings.NewReader(tail)), nil)
|
|
||||||
return &flateReadWrapper{fr}
|
|
||||||
}
|
|
||||||
|
|
||||||
func isValidCompressionLevel(level int) bool {
|
|
||||||
return minCompressionLevel <= level && level <= maxCompressionLevel
|
|
||||||
}
|
|
||||||
|
|
||||||
func compressNoContextTakeover(w io.WriteCloser, level int) io.WriteCloser {
|
|
||||||
p := &flateWriterPools[level-minCompressionLevel]
|
|
||||||
tw := &truncWriter{w: w}
|
|
||||||
fw, _ := p.Get().(*flate.Writer)
|
|
||||||
if fw == nil {
|
|
||||||
fw, _ = flate.NewWriter(tw, level)
|
|
||||||
} else {
|
|
||||||
fw.Reset(tw)
|
|
||||||
}
|
|
||||||
return &flateWriteWrapper{fw: fw, tw: tw, p: p}
|
|
||||||
}
|
|
||||||
|
|
||||||
// truncWriter is an io.Writer that writes all but the last four bytes of the
|
|
||||||
// stream to another io.Writer.
|
|
||||||
type truncWriter struct {
|
|
||||||
w io.WriteCloser
|
|
||||||
n int
|
|
||||||
p [4]byte
|
|
||||||
}
|
|
||||||
|
|
||||||
func (w *truncWriter) Write(p []byte) (int, error) {
|
|
||||||
n := 0
|
|
||||||
|
|
||||||
// fill buffer first for simplicity.
|
|
||||||
if w.n < len(w.p) {
|
|
||||||
n = copy(w.p[w.n:], p)
|
|
||||||
p = p[n:]
|
|
||||||
w.n += n
|
|
||||||
if len(p) == 0 {
|
|
||||||
return n, nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
m := len(p)
|
|
||||||
if m > len(w.p) {
|
|
||||||
m = len(w.p)
|
|
||||||
}
|
|
||||||
|
|
||||||
if nn, err := w.w.Write(w.p[:m]); err != nil {
|
|
||||||
return n + nn, err
|
|
||||||
}
|
|
||||||
|
|
||||||
copy(w.p[:], w.p[m:])
|
|
||||||
copy(w.p[len(w.p)-m:], p[len(p)-m:])
|
|
||||||
nn, err := w.w.Write(p[:len(p)-m])
|
|
||||||
return n + nn, err
|
|
||||||
}
|
|
||||||
|
|
||||||
type flateWriteWrapper struct {
|
|
||||||
fw *flate.Writer
|
|
||||||
tw *truncWriter
|
|
||||||
p *sync.Pool
|
|
||||||
}
|
|
||||||
|
|
||||||
func (w *flateWriteWrapper) Write(p []byte) (int, error) {
|
|
||||||
if w.fw == nil {
|
|
||||||
return 0, errWriteClosed
|
|
||||||
}
|
|
||||||
return w.fw.Write(p)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (w *flateWriteWrapper) Close() error {
|
|
||||||
if w.fw == nil {
|
|
||||||
return errWriteClosed
|
|
||||||
}
|
|
||||||
err1 := w.fw.Flush()
|
|
||||||
w.p.Put(w.fw)
|
|
||||||
w.fw = nil
|
|
||||||
if w.tw.p != [4]byte{0, 0, 0xff, 0xff} {
|
|
||||||
return errors.New("websocket: internal error, unexpected bytes at end of flate stream")
|
|
||||||
}
|
|
||||||
err2 := w.tw.w.Close()
|
|
||||||
if err1 != nil {
|
|
||||||
return err1
|
|
||||||
}
|
|
||||||
return err2
|
|
||||||
}
|
|
||||||
|
|
||||||
type flateReadWrapper struct {
|
|
||||||
fr io.ReadCloser
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r *flateReadWrapper) Read(p []byte) (int, error) {
|
|
||||||
if r.fr == nil {
|
|
||||||
return 0, io.ErrClosedPipe
|
|
||||||
}
|
|
||||||
n, err := r.fr.Read(p)
|
|
||||||
if err == io.EOF {
|
|
||||||
// Preemptively place the reader back in the pool. This helps with
|
|
||||||
// scenarios where the application does not call NextReader() soon after
|
|
||||||
// this final read.
|
|
||||||
r.Close()
|
|
||||||
}
|
|
||||||
return n, err
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r *flateReadWrapper) Close() error {
|
|
||||||
if r.fr == nil {
|
|
||||||
return io.ErrClosedPipe
|
|
||||||
}
|
|
||||||
err := r.fr.Close()
|
|
||||||
flateReaderPool.Put(r.fr)
|
|
||||||
r.fr = nil
|
|
||||||
return err
|
|
||||||
}
|
|
1149
vendor/github.com/gorilla/websocket/conn.go
generated
vendored
1149
vendor/github.com/gorilla/websocket/conn.go
generated
vendored
File diff suppressed because it is too large
Load Diff
18
vendor/github.com/gorilla/websocket/conn_read.go
generated
vendored
18
vendor/github.com/gorilla/websocket/conn_read.go
generated
vendored
@ -1,18 +0,0 @@
|
|||||||
// Copyright 2016 The Gorilla WebSocket Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
// +build go1.5
|
|
||||||
|
|
||||||
package websocket
|
|
||||||
|
|
||||||
import "io"
|
|
||||||
|
|
||||||
func (c *Conn) read(n int) ([]byte, error) {
|
|
||||||
p, err := c.br.Peek(n)
|
|
||||||
if err == io.EOF {
|
|
||||||
err = errUnexpectedEOF
|
|
||||||
}
|
|
||||||
c.br.Discard(len(p))
|
|
||||||
return p, err
|
|
||||||
}
|
|
21
vendor/github.com/gorilla/websocket/conn_read_legacy.go
generated
vendored
21
vendor/github.com/gorilla/websocket/conn_read_legacy.go
generated
vendored
@ -1,21 +0,0 @@
|
|||||||
// Copyright 2016 The Gorilla WebSocket Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
// +build !go1.5
|
|
||||||
|
|
||||||
package websocket
|
|
||||||
|
|
||||||
import "io"
|
|
||||||
|
|
||||||
func (c *Conn) read(n int) ([]byte, error) {
|
|
||||||
p, err := c.br.Peek(n)
|
|
||||||
if err == io.EOF {
|
|
||||||
err = errUnexpectedEOF
|
|
||||||
}
|
|
||||||
if len(p) > 0 {
|
|
||||||
// advance over the bytes just read
|
|
||||||
io.ReadFull(c.br, p)
|
|
||||||
}
|
|
||||||
return p, err
|
|
||||||
}
|
|
180
vendor/github.com/gorilla/websocket/doc.go
generated
vendored
180
vendor/github.com/gorilla/websocket/doc.go
generated
vendored
@ -1,180 +0,0 @@
|
|||||||
// Copyright 2013 The Gorilla WebSocket Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
// Package websocket implements the WebSocket protocol defined in RFC 6455.
|
|
||||||
//
|
|
||||||
// Overview
|
|
||||||
//
|
|
||||||
// The Conn type represents a WebSocket connection. A server application uses
|
|
||||||
// the Upgrade function from an Upgrader object with a HTTP request handler
|
|
||||||
// to get a pointer to a Conn:
|
|
||||||
//
|
|
||||||
// var upgrader = websocket.Upgrader{
|
|
||||||
// ReadBufferSize: 1024,
|
|
||||||
// WriteBufferSize: 1024,
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// func handler(w http.ResponseWriter, r *http.Request) {
|
|
||||||
// conn, err := upgrader.Upgrade(w, r, nil)
|
|
||||||
// if err != nil {
|
|
||||||
// log.Println(err)
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
// ... Use conn to send and receive messages.
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// Call the connection's WriteMessage and ReadMessage methods to send and
|
|
||||||
// receive messages as a slice of bytes. This snippet of code shows how to echo
|
|
||||||
// messages using these methods:
|
|
||||||
//
|
|
||||||
// for {
|
|
||||||
// messageType, p, err := conn.ReadMessage()
|
|
||||||
// if err != nil {
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
// if err = conn.WriteMessage(messageType, p); err != nil {
|
|
||||||
// return err
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// In above snippet of code, p is a []byte and messageType is an int with value
|
|
||||||
// websocket.BinaryMessage or websocket.TextMessage.
|
|
||||||
//
|
|
||||||
// An application can also send and receive messages using the io.WriteCloser
|
|
||||||
// and io.Reader interfaces. To send a message, call the connection NextWriter
|
|
||||||
// method to get an io.WriteCloser, write the message to the writer and close
|
|
||||||
// the writer when done. To receive a message, call the connection NextReader
|
|
||||||
// method to get an io.Reader and read until io.EOF is returned. This snippet
|
|
||||||
// shows how to echo messages using the NextWriter and NextReader methods:
|
|
||||||
//
|
|
||||||
// for {
|
|
||||||
// messageType, r, err := conn.NextReader()
|
|
||||||
// if err != nil {
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
// w, err := conn.NextWriter(messageType)
|
|
||||||
// if err != nil {
|
|
||||||
// return err
|
|
||||||
// }
|
|
||||||
// if _, err := io.Copy(w, r); err != nil {
|
|
||||||
// return err
|
|
||||||
// }
|
|
||||||
// if err := w.Close(); err != nil {
|
|
||||||
// return err
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// Data Messages
|
|
||||||
//
|
|
||||||
// The WebSocket protocol distinguishes between text and binary data messages.
|
|
||||||
// Text messages are interpreted as UTF-8 encoded text. The interpretation of
|
|
||||||
// binary messages is left to the application.
|
|
||||||
//
|
|
||||||
// This package uses the TextMessage and BinaryMessage integer constants to
|
|
||||||
// identify the two data message types. The ReadMessage and NextReader methods
|
|
||||||
// return the type of the received message. The messageType argument to the
|
|
||||||
// WriteMessage and NextWriter methods specifies the type of a sent message.
|
|
||||||
//
|
|
||||||
// It is the application's responsibility to ensure that text messages are
|
|
||||||
// valid UTF-8 encoded text.
|
|
||||||
//
|
|
||||||
// Control Messages
|
|
||||||
//
|
|
||||||
// The WebSocket protocol defines three types of control messages: close, ping
|
|
||||||
// and pong. Call the connection WriteControl, WriteMessage or NextWriter
|
|
||||||
// methods to send a control message to the peer.
|
|
||||||
//
|
|
||||||
// Connections handle received close messages by sending a close message to the
|
|
||||||
// peer and returning a *CloseError from the the NextReader, ReadMessage or the
|
|
||||||
// message Read method.
|
|
||||||
//
|
|
||||||
// Connections handle received ping and pong messages by invoking callback
|
|
||||||
// functions set with SetPingHandler and SetPongHandler methods. The callback
|
|
||||||
// functions are called from the NextReader, ReadMessage and the message Read
|
|
||||||
// methods.
|
|
||||||
//
|
|
||||||
// The default ping handler sends a pong to the peer. The application's reading
|
|
||||||
// goroutine can block for a short time while the handler writes the pong data
|
|
||||||
// to the connection.
|
|
||||||
//
|
|
||||||
// The application must read the connection to process ping, pong and close
|
|
||||||
// messages sent from the peer. If the application is not otherwise interested
|
|
||||||
// in messages from the peer, then the application should start a goroutine to
|
|
||||||
// read and discard messages from the peer. A simple example is:
|
|
||||||
//
|
|
||||||
// func readLoop(c *websocket.Conn) {
|
|
||||||
// for {
|
|
||||||
// if _, _, err := c.NextReader(); err != nil {
|
|
||||||
// c.Close()
|
|
||||||
// break
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// Concurrency
|
|
||||||
//
|
|
||||||
// Connections support one concurrent reader and one concurrent writer.
|
|
||||||
//
|
|
||||||
// Applications are responsible for ensuring that no more than one goroutine
|
|
||||||
// calls the write methods (NextWriter, SetWriteDeadline, WriteMessage,
|
|
||||||
// WriteJSON, EnableWriteCompression, SetCompressionLevel) concurrently and
|
|
||||||
// that no more than one goroutine calls the read methods (NextReader,
|
|
||||||
// SetReadDeadline, ReadMessage, ReadJSON, SetPongHandler, SetPingHandler)
|
|
||||||
// concurrently.
|
|
||||||
//
|
|
||||||
// The Close and WriteControl methods can be called concurrently with all other
|
|
||||||
// methods.
|
|
||||||
//
|
|
||||||
// Origin Considerations
|
|
||||||
//
|
|
||||||
// Web browsers allow Javascript applications to open a WebSocket connection to
|
|
||||||
// any host. It's up to the server to enforce an origin policy using the Origin
|
|
||||||
// request header sent by the browser.
|
|
||||||
//
|
|
||||||
// The Upgrader calls the function specified in the CheckOrigin field to check
|
|
||||||
// the origin. If the CheckOrigin function returns false, then the Upgrade
|
|
||||||
// method fails the WebSocket handshake with HTTP status 403.
|
|
||||||
//
|
|
||||||
// If the CheckOrigin field is nil, then the Upgrader uses a safe default: fail
|
|
||||||
// the handshake if the Origin request header is present and not equal to the
|
|
||||||
// Host request header.
|
|
||||||
//
|
|
||||||
// An application can allow connections from any origin by specifying a
|
|
||||||
// function that always returns true:
|
|
||||||
//
|
|
||||||
// var upgrader = websocket.Upgrader{
|
|
||||||
// CheckOrigin: func(r *http.Request) bool { return true },
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// The deprecated Upgrade function does not enforce an origin policy. It's the
|
|
||||||
// application's responsibility to check the Origin header before calling
|
|
||||||
// Upgrade.
|
|
||||||
//
|
|
||||||
// Compression EXPERIMENTAL
|
|
||||||
//
|
|
||||||
// Per message compression extensions (RFC 7692) are experimentally supported
|
|
||||||
// by this package in a limited capacity. Setting the EnableCompression option
|
|
||||||
// to true in Dialer or Upgrader will attempt to negotiate per message deflate
|
|
||||||
// support.
|
|
||||||
//
|
|
||||||
// var upgrader = websocket.Upgrader{
|
|
||||||
// EnableCompression: true,
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// If compression was successfully negotiated with the connection's peer, any
|
|
||||||
// message received in compressed form will be automatically decompressed.
|
|
||||||
// All Read methods will return uncompressed bytes.
|
|
||||||
//
|
|
||||||
// Per message compression of messages written to a connection can be enabled
|
|
||||||
// or disabled by calling the corresponding Conn method:
|
|
||||||
//
|
|
||||||
// conn.EnableWriteCompression(false)
|
|
||||||
//
|
|
||||||
// Currently this package does not support compression with "context takeover".
|
|
||||||
// This means that messages must be compressed and decompressed in isolation,
|
|
||||||
// without retaining sliding window or dictionary state across messages. For
|
|
||||||
// more details refer to RFC 7692.
|
|
||||||
//
|
|
||||||
// Use of compression is experimental and may result in decreased performance.
|
|
||||||
package websocket
|
|
55
vendor/github.com/gorilla/websocket/json.go
generated
vendored
55
vendor/github.com/gorilla/websocket/json.go
generated
vendored
@ -1,55 +0,0 @@
|
|||||||
// Copyright 2013 The Gorilla WebSocket Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
package websocket
|
|
||||||
|
|
||||||
import (
|
|
||||||
"encoding/json"
|
|
||||||
"io"
|
|
||||||
)
|
|
||||||
|
|
||||||
// WriteJSON is deprecated, use c.WriteJSON instead.
|
|
||||||
func WriteJSON(c *Conn, v interface{}) error {
|
|
||||||
return c.WriteJSON(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// WriteJSON writes the JSON encoding of v to the connection.
|
|
||||||
//
|
|
||||||
// See the documentation for encoding/json Marshal for details about the
|
|
||||||
// conversion of Go values to JSON.
|
|
||||||
func (c *Conn) WriteJSON(v interface{}) error {
|
|
||||||
w, err := c.NextWriter(TextMessage)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
err1 := json.NewEncoder(w).Encode(v)
|
|
||||||
err2 := w.Close()
|
|
||||||
if err1 != nil {
|
|
||||||
return err1
|
|
||||||
}
|
|
||||||
return err2
|
|
||||||
}
|
|
||||||
|
|
||||||
// ReadJSON is deprecated, use c.ReadJSON instead.
|
|
||||||
func ReadJSON(c *Conn, v interface{}) error {
|
|
||||||
return c.ReadJSON(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// ReadJSON reads the next JSON-encoded message from the connection and stores
|
|
||||||
// it in the value pointed to by v.
|
|
||||||
//
|
|
||||||
// See the documentation for the encoding/json Unmarshal function for details
|
|
||||||
// about the conversion of JSON to a Go value.
|
|
||||||
func (c *Conn) ReadJSON(v interface{}) error {
|
|
||||||
_, r, err := c.NextReader()
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
err = json.NewDecoder(r).Decode(v)
|
|
||||||
if err == io.EOF {
|
|
||||||
// One value is expected in the message.
|
|
||||||
err = io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
return err
|
|
||||||
}
|
|
55
vendor/github.com/gorilla/websocket/mask.go
generated
vendored
55
vendor/github.com/gorilla/websocket/mask.go
generated
vendored
@ -1,55 +0,0 @@
|
|||||||
// Copyright 2016 The Gorilla WebSocket Authors. All rights reserved. Use of
|
|
||||||
// this source code is governed by a BSD-style license that can be found in the
|
|
||||||
// LICENSE file.
|
|
||||||
|
|
||||||
// +build !appengine
|
|
||||||
|
|
||||||
package websocket
|
|
||||||
|
|
||||||
import "unsafe"
|
|
||||||
|
|
||||||
const wordSize = int(unsafe.Sizeof(uintptr(0)))
|
|
||||||
|
|
||||||
func maskBytes(key [4]byte, pos int, b []byte) int {
|
|
||||||
|
|
||||||
// Mask one byte at a time for small buffers.
|
|
||||||
if len(b) < 2*wordSize {
|
|
||||||
for i := range b {
|
|
||||||
b[i] ^= key[pos&3]
|
|
||||||
pos++
|
|
||||||
}
|
|
||||||
return pos & 3
|
|
||||||
}
|
|
||||||
|
|
||||||
// Mask one byte at a time to word boundary.
|
|
||||||
if n := int(uintptr(unsafe.Pointer(&b[0]))) % wordSize; n != 0 {
|
|
||||||
n = wordSize - n
|
|
||||||
for i := range b[:n] {
|
|
||||||
b[i] ^= key[pos&3]
|
|
||||||
pos++
|
|
||||||
}
|
|
||||||
b = b[n:]
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create aligned word size key.
|
|
||||||
var k [wordSize]byte
|
|
||||||
for i := range k {
|
|
||||||
k[i] = key[(pos+i)&3]
|
|
||||||
}
|
|
||||||
kw := *(*uintptr)(unsafe.Pointer(&k))
|
|
||||||
|
|
||||||
// Mask one word at a time.
|
|
||||||
n := (len(b) / wordSize) * wordSize
|
|
||||||
for i := 0; i < n; i += wordSize {
|
|
||||||
*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&b[0])) + uintptr(i))) ^= kw
|
|
||||||
}
|
|
||||||
|
|
||||||
// Mask one byte at a time for remaining bytes.
|
|
||||||
b = b[n:]
|
|
||||||
for i := range b {
|
|
||||||
b[i] ^= key[pos&3]
|
|
||||||
pos++
|
|
||||||
}
|
|
||||||
|
|
||||||
return pos & 3
|
|
||||||
}
|
|
15
vendor/github.com/gorilla/websocket/mask_safe.go
generated
vendored
15
vendor/github.com/gorilla/websocket/mask_safe.go
generated
vendored
@ -1,15 +0,0 @@
|
|||||||
// Copyright 2016 The Gorilla WebSocket Authors. All rights reserved. Use of
|
|
||||||
// this source code is governed by a BSD-style license that can be found in the
|
|
||||||
// LICENSE file.
|
|
||||||
|
|
||||||
// +build appengine
|
|
||||||
|
|
||||||
package websocket
|
|
||||||
|
|
||||||
func maskBytes(key [4]byte, pos int, b []byte) int {
|
|
||||||
for i := range b {
|
|
||||||
b[i] ^= key[pos&3]
|
|
||||||
pos++
|
|
||||||
}
|
|
||||||
return pos & 3
|
|
||||||
}
|
|
103
vendor/github.com/gorilla/websocket/prepared.go
generated
vendored
103
vendor/github.com/gorilla/websocket/prepared.go
generated
vendored
@ -1,103 +0,0 @@
|
|||||||
// Copyright 2017 The Gorilla WebSocket Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
package websocket
|
|
||||||
|
|
||||||
import (
|
|
||||||
"bytes"
|
|
||||||
"net"
|
|
||||||
"sync"
|
|
||||||
"time"
|
|
||||||
)
|
|
||||||
|
|
||||||
// PreparedMessage caches on the wire representations of a message payload.
|
|
||||||
// Use PreparedMessage to efficiently send a message payload to multiple
|
|
||||||
// connections. PreparedMessage is especially useful when compression is used
|
|
||||||
// because the CPU and memory expensive compression operation can be executed
|
|
||||||
// once for a given set of compression options.
|
|
||||||
type PreparedMessage struct {
|
|
||||||
messageType int
|
|
||||||
data []byte
|
|
||||||
err error
|
|
||||||
mu sync.Mutex
|
|
||||||
frames map[prepareKey]*preparedFrame
|
|
||||||
}
|
|
||||||
|
|
||||||
// prepareKey defines a unique set of options to cache prepared frames in PreparedMessage.
|
|
||||||
type prepareKey struct {
|
|
||||||
isServer bool
|
|
||||||
compress bool
|
|
||||||
compressionLevel int
|
|
||||||
}
|
|
||||||
|
|
||||||
// preparedFrame contains data in wire representation.
|
|
||||||
type preparedFrame struct {
|
|
||||||
once sync.Once
|
|
||||||
data []byte
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewPreparedMessage returns an initialized PreparedMessage. You can then send
|
|
||||||
// it to connection using WritePreparedMessage method. Valid wire
|
|
||||||
// representation will be calculated lazily only once for a set of current
|
|
||||||
// connection options.
|
|
||||||
func NewPreparedMessage(messageType int, data []byte) (*PreparedMessage, error) {
|
|
||||||
pm := &PreparedMessage{
|
|
||||||
messageType: messageType,
|
|
||||||
frames: make(map[prepareKey]*preparedFrame),
|
|
||||||
data: data,
|
|
||||||
}
|
|
||||||
|
|
||||||
// Prepare a plain server frame.
|
|
||||||
_, frameData, err := pm.frame(prepareKey{isServer: true, compress: false})
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
// To protect against caller modifying the data argument, remember the data
|
|
||||||
// copied to the plain server frame.
|
|
||||||
pm.data = frameData[len(frameData)-len(data):]
|
|
||||||
return pm, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (pm *PreparedMessage) frame(key prepareKey) (int, []byte, error) {
|
|
||||||
pm.mu.Lock()
|
|
||||||
frame, ok := pm.frames[key]
|
|
||||||
if !ok {
|
|
||||||
frame = &preparedFrame{}
|
|
||||||
pm.frames[key] = frame
|
|
||||||
}
|
|
||||||
pm.mu.Unlock()
|
|
||||||
|
|
||||||
var err error
|
|
||||||
frame.once.Do(func() {
|
|
||||||
// Prepare a frame using a 'fake' connection.
|
|
||||||
// TODO: Refactor code in conn.go to allow more direct construction of
|
|
||||||
// the frame.
|
|
||||||
mu := make(chan bool, 1)
|
|
||||||
mu <- true
|
|
||||||
var nc prepareConn
|
|
||||||
c := &Conn{
|
|
||||||
conn: &nc,
|
|
||||||
mu: mu,
|
|
||||||
isServer: key.isServer,
|
|
||||||
compressionLevel: key.compressionLevel,
|
|
||||||
enableWriteCompression: true,
|
|
||||||
writeBuf: make([]byte, defaultWriteBufferSize+maxFrameHeaderSize),
|
|
||||||
}
|
|
||||||
if key.compress {
|
|
||||||
c.newCompressionWriter = compressNoContextTakeover
|
|
||||||
}
|
|
||||||
err = c.WriteMessage(pm.messageType, pm.data)
|
|
||||||
frame.data = nc.buf.Bytes()
|
|
||||||
})
|
|
||||||
return pm.messageType, frame.data, err
|
|
||||||
}
|
|
||||||
|
|
||||||
type prepareConn struct {
|
|
||||||
buf bytes.Buffer
|
|
||||||
net.Conn
|
|
||||||
}
|
|
||||||
|
|
||||||
func (pc *prepareConn) Write(p []byte) (int, error) { return pc.buf.Write(p) }
|
|
||||||
func (pc *prepareConn) SetWriteDeadline(t time.Time) error { return nil }
|
|
291
vendor/github.com/gorilla/websocket/server.go
generated
vendored
291
vendor/github.com/gorilla/websocket/server.go
generated
vendored
@ -1,291 +0,0 @@
|
|||||||
// Copyright 2013 The Gorilla WebSocket Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
package websocket
|
|
||||||
|
|
||||||
import (
|
|
||||||
"bufio"
|
|
||||||
"errors"
|
|
||||||
"net"
|
|
||||||
"net/http"
|
|
||||||
"net/url"
|
|
||||||
"strings"
|
|
||||||
"time"
|
|
||||||
)
|
|
||||||
|
|
||||||
// HandshakeError describes an error with the handshake from the peer.
|
|
||||||
type HandshakeError struct {
|
|
||||||
message string
|
|
||||||
}
|
|
||||||
|
|
||||||
func (e HandshakeError) Error() string { return e.message }
|
|
||||||
|
|
||||||
// Upgrader specifies parameters for upgrading an HTTP connection to a
|
|
||||||
// WebSocket connection.
|
|
||||||
type Upgrader struct {
|
|
||||||
// HandshakeTimeout specifies the duration for the handshake to complete.
|
|
||||||
HandshakeTimeout time.Duration
|
|
||||||
|
|
||||||
// ReadBufferSize and WriteBufferSize specify I/O buffer sizes. If a buffer
|
|
||||||
// size is zero, then buffers allocated by the HTTP server are used. The
|
|
||||||
// I/O buffer sizes do not limit the size of the messages that can be sent
|
|
||||||
// or received.
|
|
||||||
ReadBufferSize, WriteBufferSize int
|
|
||||||
|
|
||||||
// Subprotocols specifies the server's supported protocols in order of
|
|
||||||
// preference. If this field is set, then the Upgrade method negotiates a
|
|
||||||
// subprotocol by selecting the first match in this list with a protocol
|
|
||||||
// requested by the client.
|
|
||||||
Subprotocols []string
|
|
||||||
|
|
||||||
// Error specifies the function for generating HTTP error responses. If Error
|
|
||||||
// is nil, then http.Error is used to generate the HTTP response.
|
|
||||||
Error func(w http.ResponseWriter, r *http.Request, status int, reason error)
|
|
||||||
|
|
||||||
// CheckOrigin returns true if the request Origin header is acceptable. If
|
|
||||||
// CheckOrigin is nil, the host in the Origin header must not be set or
|
|
||||||
// must match the host of the request.
|
|
||||||
CheckOrigin func(r *http.Request) bool
|
|
||||||
|
|
||||||
// EnableCompression specify if the server should attempt to negotiate per
|
|
||||||
// message compression (RFC 7692). Setting this value to true does not
|
|
||||||
// guarantee that compression will be supported. Currently only "no context
|
|
||||||
// takeover" modes are supported.
|
|
||||||
EnableCompression bool
|
|
||||||
}
|
|
||||||
|
|
||||||
func (u *Upgrader) returnError(w http.ResponseWriter, r *http.Request, status int, reason string) (*Conn, error) {
|
|
||||||
err := HandshakeError{reason}
|
|
||||||
if u.Error != nil {
|
|
||||||
u.Error(w, r, status, err)
|
|
||||||
} else {
|
|
||||||
w.Header().Set("Sec-Websocket-Version", "13")
|
|
||||||
http.Error(w, http.StatusText(status), status)
|
|
||||||
}
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
// checkSameOrigin returns true if the origin is not set or is equal to the request host.
|
|
||||||
func checkSameOrigin(r *http.Request) bool {
|
|
||||||
origin := r.Header["Origin"]
|
|
||||||
if len(origin) == 0 {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
u, err := url.Parse(origin[0])
|
|
||||||
if err != nil {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
return u.Host == r.Host
|
|
||||||
}
|
|
||||||
|
|
||||||
func (u *Upgrader) selectSubprotocol(r *http.Request, responseHeader http.Header) string {
|
|
||||||
if u.Subprotocols != nil {
|
|
||||||
clientProtocols := Subprotocols(r)
|
|
||||||
for _, serverProtocol := range u.Subprotocols {
|
|
||||||
for _, clientProtocol := range clientProtocols {
|
|
||||||
if clientProtocol == serverProtocol {
|
|
||||||
return clientProtocol
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if responseHeader != nil {
|
|
||||||
return responseHeader.Get("Sec-Websocket-Protocol")
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
// Upgrade upgrades the HTTP server connection to the WebSocket protocol.
|
|
||||||
//
|
|
||||||
// The responseHeader is included in the response to the client's upgrade
|
|
||||||
// request. Use the responseHeader to specify cookies (Set-Cookie) and the
|
|
||||||
// application negotiated subprotocol (Sec-Websocket-Protocol).
|
|
||||||
//
|
|
||||||
// If the upgrade fails, then Upgrade replies to the client with an HTTP error
|
|
||||||
// response.
|
|
||||||
func (u *Upgrader) Upgrade(w http.ResponseWriter, r *http.Request, responseHeader http.Header) (*Conn, error) {
|
|
||||||
if r.Method != "GET" {
|
|
||||||
return u.returnError(w, r, http.StatusMethodNotAllowed, "websocket: not a websocket handshake: request method is not GET")
|
|
||||||
}
|
|
||||||
|
|
||||||
if _, ok := responseHeader["Sec-Websocket-Extensions"]; ok {
|
|
||||||
return u.returnError(w, r, http.StatusInternalServerError, "websocket: application specific 'Sec-Websocket-Extensions' headers are unsupported")
|
|
||||||
}
|
|
||||||
|
|
||||||
if !tokenListContainsValue(r.Header, "Connection", "upgrade") {
|
|
||||||
return u.returnError(w, r, http.StatusBadRequest, "websocket: not a websocket handshake: 'upgrade' token not found in 'Connection' header")
|
|
||||||
}
|
|
||||||
|
|
||||||
if !tokenListContainsValue(r.Header, "Upgrade", "websocket") {
|
|
||||||
return u.returnError(w, r, http.StatusBadRequest, "websocket: not a websocket handshake: 'websocket' token not found in 'Upgrade' header")
|
|
||||||
}
|
|
||||||
|
|
||||||
if !tokenListContainsValue(r.Header, "Sec-Websocket-Version", "13") {
|
|
||||||
return u.returnError(w, r, http.StatusBadRequest, "websocket: unsupported version: 13 not found in 'Sec-Websocket-Version' header")
|
|
||||||
}
|
|
||||||
|
|
||||||
checkOrigin := u.CheckOrigin
|
|
||||||
if checkOrigin == nil {
|
|
||||||
checkOrigin = checkSameOrigin
|
|
||||||
}
|
|
||||||
if !checkOrigin(r) {
|
|
||||||
return u.returnError(w, r, http.StatusForbidden, "websocket: 'Origin' header value not allowed")
|
|
||||||
}
|
|
||||||
|
|
||||||
challengeKey := r.Header.Get("Sec-Websocket-Key")
|
|
||||||
if challengeKey == "" {
|
|
||||||
return u.returnError(w, r, http.StatusBadRequest, "websocket: not a websocket handshake: `Sec-Websocket-Key' header is missing or blank")
|
|
||||||
}
|
|
||||||
|
|
||||||
subprotocol := u.selectSubprotocol(r, responseHeader)
|
|
||||||
|
|
||||||
// Negotiate PMCE
|
|
||||||
var compress bool
|
|
||||||
if u.EnableCompression {
|
|
||||||
for _, ext := range parseExtensions(r.Header) {
|
|
||||||
if ext[""] != "permessage-deflate" {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
compress = true
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var (
|
|
||||||
netConn net.Conn
|
|
||||||
err error
|
|
||||||
)
|
|
||||||
|
|
||||||
h, ok := w.(http.Hijacker)
|
|
||||||
if !ok {
|
|
||||||
return u.returnError(w, r, http.StatusInternalServerError, "websocket: response does not implement http.Hijacker")
|
|
||||||
}
|
|
||||||
var brw *bufio.ReadWriter
|
|
||||||
netConn, brw, err = h.Hijack()
|
|
||||||
if err != nil {
|
|
||||||
return u.returnError(w, r, http.StatusInternalServerError, err.Error())
|
|
||||||
}
|
|
||||||
|
|
||||||
if brw.Reader.Buffered() > 0 {
|
|
||||||
netConn.Close()
|
|
||||||
return nil, errors.New("websocket: client sent data before handshake is complete")
|
|
||||||
}
|
|
||||||
|
|
||||||
c := newConnBRW(netConn, true, u.ReadBufferSize, u.WriteBufferSize, brw)
|
|
||||||
c.subprotocol = subprotocol
|
|
||||||
|
|
||||||
if compress {
|
|
||||||
c.newCompressionWriter = compressNoContextTakeover
|
|
||||||
c.newDecompressionReader = decompressNoContextTakeover
|
|
||||||
}
|
|
||||||
|
|
||||||
p := c.writeBuf[:0]
|
|
||||||
p = append(p, "HTTP/1.1 101 Switching Protocols\r\nUpgrade: websocket\r\nConnection: Upgrade\r\nSec-WebSocket-Accept: "...)
|
|
||||||
p = append(p, computeAcceptKey(challengeKey)...)
|
|
||||||
p = append(p, "\r\n"...)
|
|
||||||
if c.subprotocol != "" {
|
|
||||||
p = append(p, "Sec-Websocket-Protocol: "...)
|
|
||||||
p = append(p, c.subprotocol...)
|
|
||||||
p = append(p, "\r\n"...)
|
|
||||||
}
|
|
||||||
if compress {
|
|
||||||
p = append(p, "Sec-Websocket-Extensions: permessage-deflate; server_no_context_takeover; client_no_context_takeover\r\n"...)
|
|
||||||
}
|
|
||||||
for k, vs := range responseHeader {
|
|
||||||
if k == "Sec-Websocket-Protocol" {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
for _, v := range vs {
|
|
||||||
p = append(p, k...)
|
|
||||||
p = append(p, ": "...)
|
|
||||||
for i := 0; i < len(v); i++ {
|
|
||||||
b := v[i]
|
|
||||||
if b <= 31 {
|
|
||||||
// prevent response splitting.
|
|
||||||
b = ' '
|
|
||||||
}
|
|
||||||
p = append(p, b)
|
|
||||||
}
|
|
||||||
p = append(p, "\r\n"...)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
p = append(p, "\r\n"...)
|
|
||||||
|
|
||||||
// Clear deadlines set by HTTP server.
|
|
||||||
netConn.SetDeadline(time.Time{})
|
|
||||||
|
|
||||||
if u.HandshakeTimeout > 0 {
|
|
||||||
netConn.SetWriteDeadline(time.Now().Add(u.HandshakeTimeout))
|
|
||||||
}
|
|
||||||
if _, err = netConn.Write(p); err != nil {
|
|
||||||
netConn.Close()
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if u.HandshakeTimeout > 0 {
|
|
||||||
netConn.SetWriteDeadline(time.Time{})
|
|
||||||
}
|
|
||||||
|
|
||||||
return c, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Upgrade upgrades the HTTP server connection to the WebSocket protocol.
|
|
||||||
//
|
|
||||||
// This function is deprecated, use websocket.Upgrader instead.
|
|
||||||
//
|
|
||||||
// The application is responsible for checking the request origin before
|
|
||||||
// calling Upgrade. An example implementation of the same origin policy is:
|
|
||||||
//
|
|
||||||
// if req.Header.Get("Origin") != "http://"+req.Host {
|
|
||||||
// http.Error(w, "Origin not allowed", 403)
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// If the endpoint supports subprotocols, then the application is responsible
|
|
||||||
// for negotiating the protocol used on the connection. Use the Subprotocols()
|
|
||||||
// function to get the subprotocols requested by the client. Use the
|
|
||||||
// Sec-Websocket-Protocol response header to specify the subprotocol selected
|
|
||||||
// by the application.
|
|
||||||
//
|
|
||||||
// The responseHeader is included in the response to the client's upgrade
|
|
||||||
// request. Use the responseHeader to specify cookies (Set-Cookie) and the
|
|
||||||
// negotiated subprotocol (Sec-Websocket-Protocol).
|
|
||||||
//
|
|
||||||
// The connection buffers IO to the underlying network connection. The
|
|
||||||
// readBufSize and writeBufSize parameters specify the size of the buffers to
|
|
||||||
// use. Messages can be larger than the buffers.
|
|
||||||
//
|
|
||||||
// If the request is not a valid WebSocket handshake, then Upgrade returns an
|
|
||||||
// error of type HandshakeError. Applications should handle this error by
|
|
||||||
// replying to the client with an HTTP error response.
|
|
||||||
func Upgrade(w http.ResponseWriter, r *http.Request, responseHeader http.Header, readBufSize, writeBufSize int) (*Conn, error) {
|
|
||||||
u := Upgrader{ReadBufferSize: readBufSize, WriteBufferSize: writeBufSize}
|
|
||||||
u.Error = func(w http.ResponseWriter, r *http.Request, status int, reason error) {
|
|
||||||
// don't return errors to maintain backwards compatibility
|
|
||||||
}
|
|
||||||
u.CheckOrigin = func(r *http.Request) bool {
|
|
||||||
// allow all connections by default
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return u.Upgrade(w, r, responseHeader)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Subprotocols returns the subprotocols requested by the client in the
|
|
||||||
// Sec-Websocket-Protocol header.
|
|
||||||
func Subprotocols(r *http.Request) []string {
|
|
||||||
h := strings.TrimSpace(r.Header.Get("Sec-Websocket-Protocol"))
|
|
||||||
if h == "" {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
protocols := strings.Split(h, ",")
|
|
||||||
for i := range protocols {
|
|
||||||
protocols[i] = strings.TrimSpace(protocols[i])
|
|
||||||
}
|
|
||||||
return protocols
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsWebSocketUpgrade returns true if the client requested upgrade to the
|
|
||||||
// WebSocket protocol.
|
|
||||||
func IsWebSocketUpgrade(r *http.Request) bool {
|
|
||||||
return tokenListContainsValue(r.Header, "Connection", "upgrade") &&
|
|
||||||
tokenListContainsValue(r.Header, "Upgrade", "websocket")
|
|
||||||
}
|
|
214
vendor/github.com/gorilla/websocket/util.go
generated
vendored
214
vendor/github.com/gorilla/websocket/util.go
generated
vendored
@ -1,214 +0,0 @@
|
|||||||
// Copyright 2013 The Gorilla WebSocket Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
package websocket
|
|
||||||
|
|
||||||
import (
|
|
||||||
"crypto/rand"
|
|
||||||
"crypto/sha1"
|
|
||||||
"encoding/base64"
|
|
||||||
"io"
|
|
||||||
"net/http"
|
|
||||||
"strings"
|
|
||||||
)
|
|
||||||
|
|
||||||
var keyGUID = []byte("258EAFA5-E914-47DA-95CA-C5AB0DC85B11")
|
|
||||||
|
|
||||||
func computeAcceptKey(challengeKey string) string {
|
|
||||||
h := sha1.New()
|
|
||||||
h.Write([]byte(challengeKey))
|
|
||||||
h.Write(keyGUID)
|
|
||||||
return base64.StdEncoding.EncodeToString(h.Sum(nil))
|
|
||||||
}
|
|
||||||
|
|
||||||
func generateChallengeKey() (string, error) {
|
|
||||||
p := make([]byte, 16)
|
|
||||||
if _, err := io.ReadFull(rand.Reader, p); err != nil {
|
|
||||||
return "", err
|
|
||||||
}
|
|
||||||
return base64.StdEncoding.EncodeToString(p), nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Octet types from RFC 2616.
|
|
||||||
var octetTypes [256]byte
|
|
||||||
|
|
||||||
const (
|
|
||||||
isTokenOctet = 1 << iota
|
|
||||||
isSpaceOctet
|
|
||||||
)
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
// From RFC 2616
|
|
||||||
//
|
|
||||||
// OCTET = <any 8-bit sequence of data>
|
|
||||||
// CHAR = <any US-ASCII character (octets 0 - 127)>
|
|
||||||
// CTL = <any US-ASCII control character (octets 0 - 31) and DEL (127)>
|
|
||||||
// CR = <US-ASCII CR, carriage return (13)>
|
|
||||||
// LF = <US-ASCII LF, linefeed (10)>
|
|
||||||
// SP = <US-ASCII SP, space (32)>
|
|
||||||
// HT = <US-ASCII HT, horizontal-tab (9)>
|
|
||||||
// <"> = <US-ASCII double-quote mark (34)>
|
|
||||||
// CRLF = CR LF
|
|
||||||
// LWS = [CRLF] 1*( SP | HT )
|
|
||||||
// TEXT = <any OCTET except CTLs, but including LWS>
|
|
||||||
// separators = "(" | ")" | "<" | ">" | "@" | "," | ";" | ":" | "\" | <">
|
|
||||||
// | "/" | "[" | "]" | "?" | "=" | "{" | "}" | SP | HT
|
|
||||||
// token = 1*<any CHAR except CTLs or separators>
|
|
||||||
// qdtext = <any TEXT except <">>
|
|
||||||
|
|
||||||
for c := 0; c < 256; c++ {
|
|
||||||
var t byte
|
|
||||||
isCtl := c <= 31 || c == 127
|
|
||||||
isChar := 0 <= c && c <= 127
|
|
||||||
isSeparator := strings.IndexRune(" \t\"(),/:;<=>?@[]\\{}", rune(c)) >= 0
|
|
||||||
if strings.IndexRune(" \t\r\n", rune(c)) >= 0 {
|
|
||||||
t |= isSpaceOctet
|
|
||||||
}
|
|
||||||
if isChar && !isCtl && !isSeparator {
|
|
||||||
t |= isTokenOctet
|
|
||||||
}
|
|
||||||
octetTypes[c] = t
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func skipSpace(s string) (rest string) {
|
|
||||||
i := 0
|
|
||||||
for ; i < len(s); i++ {
|
|
||||||
if octetTypes[s[i]]&isSpaceOctet == 0 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return s[i:]
|
|
||||||
}
|
|
||||||
|
|
||||||
func nextToken(s string) (token, rest string) {
|
|
||||||
i := 0
|
|
||||||
for ; i < len(s); i++ {
|
|
||||||
if octetTypes[s[i]]&isTokenOctet == 0 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return s[:i], s[i:]
|
|
||||||
}
|
|
||||||
|
|
||||||
func nextTokenOrQuoted(s string) (value string, rest string) {
|
|
||||||
if !strings.HasPrefix(s, "\"") {
|
|
||||||
return nextToken(s)
|
|
||||||
}
|
|
||||||
s = s[1:]
|
|
||||||
for i := 0; i < len(s); i++ {
|
|
||||||
switch s[i] {
|
|
||||||
case '"':
|
|
||||||
return s[:i], s[i+1:]
|
|
||||||
case '\\':
|
|
||||||
p := make([]byte, len(s)-1)
|
|
||||||
j := copy(p, s[:i])
|
|
||||||
escape := true
|
|
||||||
for i = i + 1; i < len(s); i++ {
|
|
||||||
b := s[i]
|
|
||||||
switch {
|
|
||||||
case escape:
|
|
||||||
escape = false
|
|
||||||
p[j] = b
|
|
||||||
j += 1
|
|
||||||
case b == '\\':
|
|
||||||
escape = true
|
|
||||||
case b == '"':
|
|
||||||
return string(p[:j]), s[i+1:]
|
|
||||||
default:
|
|
||||||
p[j] = b
|
|
||||||
j += 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return "", ""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return "", ""
|
|
||||||
}
|
|
||||||
|
|
||||||
// tokenListContainsValue returns true if the 1#token header with the given
|
|
||||||
// name contains token.
|
|
||||||
func tokenListContainsValue(header http.Header, name string, value string) bool {
|
|
||||||
headers:
|
|
||||||
for _, s := range header[name] {
|
|
||||||
for {
|
|
||||||
var t string
|
|
||||||
t, s = nextToken(skipSpace(s))
|
|
||||||
if t == "" {
|
|
||||||
continue headers
|
|
||||||
}
|
|
||||||
s = skipSpace(s)
|
|
||||||
if s != "" && s[0] != ',' {
|
|
||||||
continue headers
|
|
||||||
}
|
|
||||||
if strings.EqualFold(t, value) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
if s == "" {
|
|
||||||
continue headers
|
|
||||||
}
|
|
||||||
s = s[1:]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// parseExtensiosn parses WebSocket extensions from a header.
|
|
||||||
func parseExtensions(header http.Header) []map[string]string {
|
|
||||||
|
|
||||||
// From RFC 6455:
|
|
||||||
//
|
|
||||||
// Sec-WebSocket-Extensions = extension-list
|
|
||||||
// extension-list = 1#extension
|
|
||||||
// extension = extension-token *( ";" extension-param )
|
|
||||||
// extension-token = registered-token
|
|
||||||
// registered-token = token
|
|
||||||
// extension-param = token [ "=" (token | quoted-string) ]
|
|
||||||
// ;When using the quoted-string syntax variant, the value
|
|
||||||
// ;after quoted-string unescaping MUST conform to the
|
|
||||||
// ;'token' ABNF.
|
|
||||||
|
|
||||||
var result []map[string]string
|
|
||||||
headers:
|
|
||||||
for _, s := range header["Sec-Websocket-Extensions"] {
|
|
||||||
for {
|
|
||||||
var t string
|
|
||||||
t, s = nextToken(skipSpace(s))
|
|
||||||
if t == "" {
|
|
||||||
continue headers
|
|
||||||
}
|
|
||||||
ext := map[string]string{"": t}
|
|
||||||
for {
|
|
||||||
s = skipSpace(s)
|
|
||||||
if !strings.HasPrefix(s, ";") {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
var k string
|
|
||||||
k, s = nextToken(skipSpace(s[1:]))
|
|
||||||
if k == "" {
|
|
||||||
continue headers
|
|
||||||
}
|
|
||||||
s = skipSpace(s)
|
|
||||||
var v string
|
|
||||||
if strings.HasPrefix(s, "=") {
|
|
||||||
v, s = nextTokenOrQuoted(skipSpace(s[1:]))
|
|
||||||
s = skipSpace(s)
|
|
||||||
}
|
|
||||||
if s != "" && s[0] != ',' && s[0] != ';' {
|
|
||||||
continue headers
|
|
||||||
}
|
|
||||||
ext[k] = v
|
|
||||||
}
|
|
||||||
if s != "" && s[0] != ',' {
|
|
||||||
continue headers
|
|
||||||
}
|
|
||||||
result = append(result, ext)
|
|
||||||
if s == "" {
|
|
||||||
continue headers
|
|
||||||
}
|
|
||||||
s = s[1:]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result
|
|
||||||
}
|
|
19
vendor/github.com/rancher/norman/clientbase/client.go
generated
vendored
19
vendor/github.com/rancher/norman/clientbase/client.go
generated
vendored
@ -1,19 +0,0 @@
|
|||||||
package clientbase
|
|
||||||
|
|
||||||
import (
|
|
||||||
"net/http"
|
|
||||||
|
|
||||||
"github.com/rancher/norman/types"
|
|
||||||
)
|
|
||||||
|
|
||||||
type APIBaseClient struct {
|
|
||||||
Ops *APIOperations
|
|
||||||
Opts *ClientOpts
|
|
||||||
Types map[string]types.Schema
|
|
||||||
}
|
|
||||||
|
|
||||||
type APIOperations struct {
|
|
||||||
Opts *ClientOpts
|
|
||||||
Types map[string]types.Schema
|
|
||||||
Client *http.Client
|
|
||||||
}
|
|
329
vendor/github.com/rancher/norman/clientbase/common.go
generated
vendored
329
vendor/github.com/rancher/norman/clientbase/common.go
generated
vendored
@ -1,329 +0,0 @@
|
|||||||
package clientbase
|
|
||||||
|
|
||||||
import (
|
|
||||||
"bytes"
|
|
||||||
"crypto/tls"
|
|
||||||
"crypto/x509"
|
|
||||||
"encoding/base64"
|
|
||||||
"encoding/json"
|
|
||||||
"fmt"
|
|
||||||
"io/ioutil"
|
|
||||||
"net/http"
|
|
||||||
"net/url"
|
|
||||||
"os"
|
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/gorilla/websocket"
|
|
||||||
"github.com/pkg/errors"
|
|
||||||
"github.com/rancher/norman/types"
|
|
||||||
)
|
|
||||||
|
|
||||||
const (
|
|
||||||
SELF = "self"
|
|
||||||
COLLECTION = "collection"
|
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
|
||||||
debug = false
|
|
||||||
dialer = &websocket.Dialer{}
|
|
||||||
)
|
|
||||||
|
|
||||||
type ClientOpts struct {
|
|
||||||
URL string
|
|
||||||
AccessKey string
|
|
||||||
SecretKey string
|
|
||||||
TokenKey string
|
|
||||||
Timeout time.Duration
|
|
||||||
HTTPClient *http.Client
|
|
||||||
CACerts string
|
|
||||||
Insecure bool
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *ClientOpts) getAuthHeader() string {
|
|
||||||
if c.TokenKey != "" {
|
|
||||||
return "Bearer " + c.TokenKey
|
|
||||||
}
|
|
||||||
if c.AccessKey != "" && c.SecretKey != "" {
|
|
||||||
s := c.AccessKey + ":" + c.SecretKey
|
|
||||||
return "Basic " + base64.StdEncoding.EncodeToString([]byte(s))
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
type APIError struct {
|
|
||||||
StatusCode int
|
|
||||||
URL string
|
|
||||||
Msg string
|
|
||||||
Status string
|
|
||||||
Body string
|
|
||||||
}
|
|
||||||
|
|
||||||
func (e *APIError) Error() string {
|
|
||||||
return e.Msg
|
|
||||||
}
|
|
||||||
|
|
||||||
func IsNotFound(err error) bool {
|
|
||||||
apiError, ok := err.(*APIError)
|
|
||||||
if !ok {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
return apiError.StatusCode == http.StatusNotFound
|
|
||||||
}
|
|
||||||
|
|
||||||
func newAPIError(resp *http.Response, url string) *APIError {
|
|
||||||
contents, err := ioutil.ReadAll(resp.Body)
|
|
||||||
var body string
|
|
||||||
if err != nil {
|
|
||||||
body = "Unreadable body."
|
|
||||||
} else {
|
|
||||||
body = string(contents)
|
|
||||||
}
|
|
||||||
|
|
||||||
data := map[string]interface{}{}
|
|
||||||
if json.Unmarshal(contents, &data) == nil {
|
|
||||||
delete(data, "id")
|
|
||||||
delete(data, "links")
|
|
||||||
delete(data, "actions")
|
|
||||||
delete(data, "type")
|
|
||||||
delete(data, "status")
|
|
||||||
buf := &bytes.Buffer{}
|
|
||||||
for k, v := range data {
|
|
||||||
if v == nil {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if buf.Len() > 0 {
|
|
||||||
buf.WriteString(", ")
|
|
||||||
}
|
|
||||||
fmt.Fprintf(buf, "%s=%v", k, v)
|
|
||||||
}
|
|
||||||
body = buf.String()
|
|
||||||
}
|
|
||||||
formattedMsg := fmt.Sprintf("Bad response statusCode [%d]. Status [%s]. Body: [%s] from [%s]",
|
|
||||||
resp.StatusCode, resp.Status, body, url)
|
|
||||||
return &APIError{
|
|
||||||
URL: url,
|
|
||||||
Msg: formattedMsg,
|
|
||||||
StatusCode: resp.StatusCode,
|
|
||||||
Status: resp.Status,
|
|
||||||
Body: body,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func contains(array []string, item string) bool {
|
|
||||||
for _, check := range array {
|
|
||||||
if check == item {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
func appendFilters(urlString string, filters map[string]interface{}) (string, error) {
|
|
||||||
if len(filters) == 0 {
|
|
||||||
return urlString, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
u, err := url.Parse(urlString)
|
|
||||||
if err != nil {
|
|
||||||
return "", err
|
|
||||||
}
|
|
||||||
|
|
||||||
q := u.Query()
|
|
||||||
for k, v := range filters {
|
|
||||||
if l, ok := v.([]string); ok {
|
|
||||||
for _, v := range l {
|
|
||||||
q.Add(k, v)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
q.Add(k, fmt.Sprintf("%v", v))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
u.RawQuery = q.Encode()
|
|
||||||
return u.String(), nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewAPIClient(opts *ClientOpts) (APIBaseClient, error) {
|
|
||||||
var err error
|
|
||||||
|
|
||||||
result := APIBaseClient{
|
|
||||||
Types: map[string]types.Schema{},
|
|
||||||
}
|
|
||||||
|
|
||||||
client := opts.HTTPClient
|
|
||||||
if client == nil {
|
|
||||||
client = &http.Client{}
|
|
||||||
}
|
|
||||||
|
|
||||||
if opts.Timeout == 0 {
|
|
||||||
opts.Timeout = time.Second * 10
|
|
||||||
}
|
|
||||||
|
|
||||||
client.Timeout = opts.Timeout
|
|
||||||
|
|
||||||
if opts.CACerts != "" {
|
|
||||||
roots := x509.NewCertPool()
|
|
||||||
ok := roots.AppendCertsFromPEM([]byte(opts.CACerts))
|
|
||||||
if !ok {
|
|
||||||
return result, err
|
|
||||||
}
|
|
||||||
tr := &http.Transport{
|
|
||||||
TLSClientConfig: &tls.Config{
|
|
||||||
RootCAs: roots,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
client.Transport = tr
|
|
||||||
}
|
|
||||||
|
|
||||||
if opts.Insecure {
|
|
||||||
tr := &http.Transport{
|
|
||||||
TLSClientConfig: &tls.Config{
|
|
||||||
InsecureSkipVerify: opts.Insecure,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
client.Transport = tr
|
|
||||||
}
|
|
||||||
|
|
||||||
req, err := http.NewRequest("GET", opts.URL, nil)
|
|
||||||
if err != nil {
|
|
||||||
return result, err
|
|
||||||
}
|
|
||||||
|
|
||||||
req.Header.Add("Authorization", opts.getAuthHeader())
|
|
||||||
|
|
||||||
resp, err := client.Do(req)
|
|
||||||
if err != nil {
|
|
||||||
return result, err
|
|
||||||
}
|
|
||||||
defer resp.Body.Close()
|
|
||||||
|
|
||||||
if resp.StatusCode != 200 {
|
|
||||||
return result, newAPIError(resp, opts.URL)
|
|
||||||
}
|
|
||||||
|
|
||||||
schemasURLs := resp.Header.Get("X-API-Schemas")
|
|
||||||
if len(schemasURLs) == 0 {
|
|
||||||
return result, errors.New("Failed to find schema at [" + opts.URL + "]")
|
|
||||||
}
|
|
||||||
|
|
||||||
if schemasURLs != opts.URL {
|
|
||||||
req, err = http.NewRequest("GET", schemasURLs, nil)
|
|
||||||
req.Header.Add("Authorization", opts.getAuthHeader())
|
|
||||||
if err != nil {
|
|
||||||
return result, err
|
|
||||||
}
|
|
||||||
|
|
||||||
resp, err = client.Do(req)
|
|
||||||
if err != nil {
|
|
||||||
return result, err
|
|
||||||
}
|
|
||||||
|
|
||||||
defer resp.Body.Close()
|
|
||||||
|
|
||||||
if resp.StatusCode != 200 {
|
|
||||||
return result, newAPIError(resp, opts.URL)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var schemas types.SchemaCollection
|
|
||||||
bytes, err := ioutil.ReadAll(resp.Body)
|
|
||||||
if err != nil {
|
|
||||||
return result, err
|
|
||||||
}
|
|
||||||
|
|
||||||
err = json.Unmarshal(bytes, &schemas)
|
|
||||||
if err != nil {
|
|
||||||
return result, err
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, schema := range schemas.Data {
|
|
||||||
result.Types[schema.ID] = schema
|
|
||||||
}
|
|
||||||
|
|
||||||
result.Opts = opts
|
|
||||||
result.Ops = &APIOperations{
|
|
||||||
Opts: opts,
|
|
||||||
Client: client,
|
|
||||||
Types: result.Types,
|
|
||||||
}
|
|
||||||
|
|
||||||
return result, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewListOpts() *types.ListOpts {
|
|
||||||
return &types.ListOpts{
|
|
||||||
Filters: map[string]interface{}{},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *APIBaseClient) Websocket(url string, headers map[string][]string) (*websocket.Conn, *http.Response, error) {
|
|
||||||
httpHeaders := http.Header{}
|
|
||||||
for k, v := range httpHeaders {
|
|
||||||
httpHeaders[k] = v
|
|
||||||
}
|
|
||||||
|
|
||||||
if a.Opts != nil {
|
|
||||||
httpHeaders.Add("Authorization", a.Opts.getAuthHeader())
|
|
||||||
}
|
|
||||||
|
|
||||||
return dialer.Dial(url, http.Header(httpHeaders))
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *APIBaseClient) List(schemaType string, opts *types.ListOpts, respObject interface{}) error {
|
|
||||||
return a.Ops.DoList(schemaType, opts, respObject)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *APIBaseClient) Post(url string, createObj interface{}, respObject interface{}) error {
|
|
||||||
return a.Ops.DoModify("POST", url, createObj, respObject)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *APIBaseClient) GetLink(resource types.Resource, link string, respObject interface{}) error {
|
|
||||||
url := resource.Links[link]
|
|
||||||
if url == "" {
|
|
||||||
return fmt.Errorf("failed to find link: %s", link)
|
|
||||||
}
|
|
||||||
|
|
||||||
return a.Ops.DoGet(url, &types.ListOpts{}, respObject)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *APIBaseClient) Create(schemaType string, createObj interface{}, respObject interface{}) error {
|
|
||||||
return a.Ops.DoCreate(schemaType, createObj, respObject)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *APIBaseClient) Update(schemaType string, existing *types.Resource, updates interface{}, respObject interface{}) error {
|
|
||||||
return a.Ops.DoUpdate(schemaType, existing, updates, respObject)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *APIBaseClient) ByID(schemaType string, id string, respObject interface{}) error {
|
|
||||||
return a.Ops.DoByID(schemaType, id, respObject)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *APIBaseClient) Delete(existing *types.Resource) error {
|
|
||||||
if existing == nil {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
return a.Ops.DoResourceDelete(existing.Type, existing)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *APIBaseClient) Reload(existing *types.Resource, output interface{}) error {
|
|
||||||
selfURL, ok := existing.Links[SELF]
|
|
||||||
if !ok {
|
|
||||||
return fmt.Errorf("failed to find self URL of [%v]", existing)
|
|
||||||
}
|
|
||||||
|
|
||||||
return a.Ops.DoGet(selfURL, NewListOpts(), output)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *APIBaseClient) Action(schemaType string, action string,
|
|
||||||
existing *types.Resource, inputObject, respObject interface{}) error {
|
|
||||||
return a.Ops.DoAction(schemaType, action, existing, inputObject, respObject)
|
|
||||||
}
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
debug = os.Getenv("RANCHER_CLIENT_DEBUG") == "true"
|
|
||||||
if debug {
|
|
||||||
fmt.Println("Rancher client debug on")
|
|
||||||
}
|
|
||||||
}
|
|
298
vendor/github.com/rancher/norman/clientbase/ops.go
generated
vendored
298
vendor/github.com/rancher/norman/clientbase/ops.go
generated
vendored
@ -1,298 +0,0 @@
|
|||||||
package clientbase
|
|
||||||
|
|
||||||
import (
|
|
||||||
"bytes"
|
|
||||||
"encoding/json"
|
|
||||||
"fmt"
|
|
||||||
"io"
|
|
||||||
"io/ioutil"
|
|
||||||
"net/http"
|
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
|
||||||
"github.com/rancher/norman/types"
|
|
||||||
)
|
|
||||||
|
|
||||||
func (a *APIOperations) setupRequest(req *http.Request) {
|
|
||||||
req.Header.Add("Authorization", a.Opts.getAuthHeader())
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *APIOperations) DoDelete(url string) error {
|
|
||||||
req, err := http.NewRequest("DELETE", url, nil)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
a.setupRequest(req)
|
|
||||||
|
|
||||||
resp, err := a.Client.Do(req)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
defer resp.Body.Close()
|
|
||||||
|
|
||||||
io.Copy(ioutil.Discard, resp.Body)
|
|
||||||
|
|
||||||
if resp.StatusCode >= 300 {
|
|
||||||
return newAPIError(resp, url)
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *APIOperations) DoGet(url string, opts *types.ListOpts, respObject interface{}) error {
|
|
||||||
if opts == nil {
|
|
||||||
opts = NewListOpts()
|
|
||||||
}
|
|
||||||
url, err := appendFilters(url, opts.Filters)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
if debug {
|
|
||||||
fmt.Println("GET " + url)
|
|
||||||
}
|
|
||||||
|
|
||||||
req, err := http.NewRequest("GET", url, nil)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
a.setupRequest(req)
|
|
||||||
|
|
||||||
resp, err := a.Client.Do(req)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
defer resp.Body.Close()
|
|
||||||
|
|
||||||
if resp.StatusCode != 200 {
|
|
||||||
return newAPIError(resp, url)
|
|
||||||
}
|
|
||||||
|
|
||||||
byteContent, err := ioutil.ReadAll(resp.Body)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
if debug {
|
|
||||||
fmt.Println("Response <= " + string(byteContent))
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := json.Unmarshal(byteContent, respObject); err != nil {
|
|
||||||
return errors.Wrap(err, fmt.Sprintf("Failed to parse: %s", byteContent))
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *APIOperations) DoList(schemaType string, opts *types.ListOpts, respObject interface{}) error {
|
|
||||||
schema, ok := a.Types[schemaType]
|
|
||||||
if !ok {
|
|
||||||
return errors.New("Unknown schema type [" + schemaType + "]")
|
|
||||||
}
|
|
||||||
|
|
||||||
if !contains(schema.CollectionMethods, "GET") {
|
|
||||||
return errors.New("Resource type [" + schemaType + "] is not listable")
|
|
||||||
}
|
|
||||||
|
|
||||||
return a.DoGet(a.Opts.URL+"/"+schemaType, opts, respObject)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *APIOperations) DoNext(nextURL string, respObject interface{}) error {
|
|
||||||
return a.DoGet(nextURL, nil, respObject)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *APIOperations) DoModify(method string, url string, createObj interface{}, respObject interface{}) error {
|
|
||||||
bodyContent, err := json.Marshal(createObj)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
if debug {
|
|
||||||
fmt.Println(method + " " + url)
|
|
||||||
fmt.Println("Request => " + string(bodyContent))
|
|
||||||
}
|
|
||||||
|
|
||||||
req, err := http.NewRequest(method, url, bytes.NewBuffer(bodyContent))
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
a.setupRequest(req)
|
|
||||||
req.Header.Set("Content-Type", "application/json")
|
|
||||||
|
|
||||||
resp, err := a.Client.Do(req)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
defer resp.Body.Close()
|
|
||||||
|
|
||||||
if resp.StatusCode >= 300 {
|
|
||||||
return newAPIError(resp, url)
|
|
||||||
}
|
|
||||||
|
|
||||||
byteContent, err := ioutil.ReadAll(resp.Body)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(byteContent) > 0 {
|
|
||||||
if debug {
|
|
||||||
fmt.Println("Response <= " + string(byteContent))
|
|
||||||
}
|
|
||||||
return json.Unmarshal(byteContent, respObject)
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *APIOperations) DoCreate(schemaType string, createObj interface{}, respObject interface{}) error {
|
|
||||||
if createObj == nil {
|
|
||||||
createObj = map[string]string{}
|
|
||||||
}
|
|
||||||
if respObject == nil {
|
|
||||||
respObject = &map[string]interface{}{}
|
|
||||||
}
|
|
||||||
schema, ok := a.Types[schemaType]
|
|
||||||
if !ok {
|
|
||||||
return errors.New("Unknown schema type [" + schemaType + "]")
|
|
||||||
}
|
|
||||||
|
|
||||||
if !contains(schema.CollectionMethods, "POST") {
|
|
||||||
return errors.New("Resource type [" + schemaType + "] is not creatable")
|
|
||||||
}
|
|
||||||
|
|
||||||
// using collection link to post doesn't help the resources under project or cluster, because they need a projectId or clusterId in the path
|
|
||||||
// for example, v3/projects/foo/apps, v3/cluster/bar/namespaces
|
|
||||||
return a.DoModify("POST", a.Opts.URL+"/"+schemaType, createObj, respObject)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *APIOperations) DoUpdate(schemaType string, existing *types.Resource, updates interface{}, respObject interface{}) error {
|
|
||||||
if existing == nil {
|
|
||||||
return errors.New("Existing object is nil")
|
|
||||||
}
|
|
||||||
|
|
||||||
selfURL, ok := existing.Links[SELF]
|
|
||||||
if !ok {
|
|
||||||
return fmt.Errorf("failed to find self URL of [%v]", existing)
|
|
||||||
}
|
|
||||||
|
|
||||||
if updates == nil {
|
|
||||||
updates = map[string]string{}
|
|
||||||
}
|
|
||||||
|
|
||||||
if respObject == nil {
|
|
||||||
respObject = &map[string]interface{}{}
|
|
||||||
}
|
|
||||||
|
|
||||||
schema, ok := a.Types[schemaType]
|
|
||||||
if !ok {
|
|
||||||
return errors.New("Unknown schema type [" + schemaType + "]")
|
|
||||||
}
|
|
||||||
|
|
||||||
if !contains(schema.ResourceMethods, "PUT") {
|
|
||||||
return errors.New("Resource type [" + schemaType + "] is not updatable")
|
|
||||||
}
|
|
||||||
|
|
||||||
return a.DoModify("PUT", selfURL, updates, respObject)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *APIOperations) DoByID(schemaType string, id string, respObject interface{}) error {
|
|
||||||
schema, ok := a.Types[schemaType]
|
|
||||||
if !ok {
|
|
||||||
return errors.New("Unknown schema type [" + schemaType + "]")
|
|
||||||
}
|
|
||||||
|
|
||||||
if !contains(schema.ResourceMethods, "GET") {
|
|
||||||
return errors.New("Resource type [" + schemaType + "] can not be looked up by ID")
|
|
||||||
}
|
|
||||||
|
|
||||||
collectionURL, ok := schema.Links[COLLECTION]
|
|
||||||
if !ok {
|
|
||||||
return errors.New("Failed to find collection URL for [" + schemaType + "]")
|
|
||||||
}
|
|
||||||
|
|
||||||
return a.DoGet(collectionURL+"/"+id, nil, respObject)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *APIOperations) DoResourceDelete(schemaType string, existing *types.Resource) error {
|
|
||||||
schema, ok := a.Types[schemaType]
|
|
||||||
if !ok {
|
|
||||||
return errors.New("Unknown schema type [" + schemaType + "]")
|
|
||||||
}
|
|
||||||
|
|
||||||
if !contains(schema.ResourceMethods, "DELETE") {
|
|
||||||
return errors.New("Resource type [" + schemaType + "] can not be deleted")
|
|
||||||
}
|
|
||||||
|
|
||||||
selfURL, ok := existing.Links[SELF]
|
|
||||||
if !ok {
|
|
||||||
return fmt.Errorf("failed to find self URL of [%v]", existing)
|
|
||||||
}
|
|
||||||
|
|
||||||
return a.DoDelete(selfURL)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *APIOperations) DoAction(schemaType string, action string,
|
|
||||||
existing *types.Resource, inputObject, respObject interface{}) error {
|
|
||||||
|
|
||||||
if existing == nil {
|
|
||||||
return errors.New("Existing object is nil")
|
|
||||||
}
|
|
||||||
|
|
||||||
actionURL, ok := existing.Actions[action]
|
|
||||||
if !ok {
|
|
||||||
return fmt.Errorf("action [%v] not available on [%v]", action, existing)
|
|
||||||
}
|
|
||||||
|
|
||||||
_, ok = a.Types[schemaType]
|
|
||||||
if !ok {
|
|
||||||
return errors.New("Unknown schema type [" + schemaType + "]")
|
|
||||||
}
|
|
||||||
|
|
||||||
var input io.Reader
|
|
||||||
|
|
||||||
if inputObject != nil {
|
|
||||||
bodyContent, err := json.Marshal(inputObject)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if debug {
|
|
||||||
fmt.Println("Request => " + string(bodyContent))
|
|
||||||
}
|
|
||||||
input = bytes.NewBuffer(bodyContent)
|
|
||||||
}
|
|
||||||
|
|
||||||
req, err := http.NewRequest("POST", actionURL, input)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
a.setupRequest(req)
|
|
||||||
req.Header.Set("Content-Type", "application/json")
|
|
||||||
req.Header.Set("Content-Length", "0")
|
|
||||||
|
|
||||||
resp, err := a.Client.Do(req)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
defer resp.Body.Close()
|
|
||||||
|
|
||||||
if resp.StatusCode >= 300 {
|
|
||||||
return newAPIError(resp, actionURL)
|
|
||||||
}
|
|
||||||
|
|
||||||
byteContent, err := ioutil.ReadAll(resp.Body)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
if debug {
|
|
||||||
fmt.Println("Response <= " + string(byteContent))
|
|
||||||
}
|
|
||||||
|
|
||||||
return json.Unmarshal(byteContent, respObject)
|
|
||||||
}
|
|
4
vendor/github.com/rancher/norman/controller/generic_controller.go
generated
vendored
4
vendor/github.com/rancher/norman/controller/generic_controller.go
generated
vendored
@ -9,7 +9,7 @@ import (
|
|||||||
|
|
||||||
"github.com/juju/ratelimit"
|
"github.com/juju/ratelimit"
|
||||||
errors2 "github.com/pkg/errors"
|
errors2 "github.com/pkg/errors"
|
||||||
"github.com/rancher/norman/clientbase"
|
"github.com/rancher/norman/objectclient"
|
||||||
"github.com/rancher/norman/types"
|
"github.com/rancher/norman/types"
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
@ -40,7 +40,7 @@ type GenericController interface {
|
|||||||
type Backend interface {
|
type Backend interface {
|
||||||
List(opts metav1.ListOptions) (runtime.Object, error)
|
List(opts metav1.ListOptions) (runtime.Object, error)
|
||||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||||
ObjectFactory() clientbase.ObjectFactory
|
ObjectFactory() objectclient.ObjectFactory
|
||||||
}
|
}
|
||||||
|
|
||||||
type handlerDef struct {
|
type handlerDef struct {
|
||||||
|
6
vendor/github.com/rancher/norman/lifecycle/object.go
generated
vendored
6
vendor/github.com/rancher/norman/lifecycle/object.go
generated
vendored
@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"reflect"
|
"reflect"
|
||||||
|
|
||||||
"github.com/rancher/norman/clientbase"
|
"github.com/rancher/norman/objectclient"
|
||||||
"github.com/rancher/norman/types/slice"
|
"github.com/rancher/norman/types/slice"
|
||||||
"k8s.io/apimachinery/pkg/api/meta"
|
"k8s.io/apimachinery/pkg/api/meta"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
@ -27,10 +27,10 @@ type objectLifecycleAdapter struct {
|
|||||||
name string
|
name string
|
||||||
clusterScoped bool
|
clusterScoped bool
|
||||||
lifecycle ObjectLifecycle
|
lifecycle ObjectLifecycle
|
||||||
objectClient *clientbase.ObjectClient
|
objectClient *objectclient.ObjectClient
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewObjectLifecycleAdapter(name string, clusterScoped bool, lifecycle ObjectLifecycle, objectClient *clientbase.ObjectClient) func(key string, obj runtime.Object) error {
|
func NewObjectLifecycleAdapter(name string, clusterScoped bool, lifecycle ObjectLifecycle, objectClient *objectclient.ObjectClient) func(key string, obj runtime.Object) error {
|
||||||
o := objectLifecycleAdapter{
|
o := objectLifecycleAdapter{
|
||||||
name: name,
|
name: name,
|
||||||
clusterScoped: clusterScoped,
|
clusterScoped: clusterScoped,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package clientbase
|
package objectclient
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
21
vendor/github.com/rancher/norman/types/reflection.go
generated
vendored
21
vendor/github.com/rancher/norman/types/reflection.go
generated
vendored
@ -2,24 +2,20 @@ package types
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"net/http"
|
||||||
"reflect"
|
"reflect"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"net/http"
|
|
||||||
|
|
||||||
"github.com/rancher/norman/types/convert"
|
"github.com/rancher/norman/types/convert"
|
||||||
"github.com/rancher/norman/types/definition"
|
"github.com/rancher/norman/types/definition"
|
||||||
"github.com/rancher/norman/types/slice"
|
"github.com/rancher/norman/types/slice"
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
namespacedType = reflect.TypeOf(Namespaced{})
|
namespacedType = reflect.TypeOf(Namespaced{})
|
||||||
resourceType = reflect.TypeOf(Resource{})
|
resourceType = reflect.TypeOf(Resource{})
|
||||||
typeType = reflect.TypeOf(metav1.TypeMeta{})
|
|
||||||
metaType = reflect.TypeOf(metav1.ObjectMeta{})
|
|
||||||
blacklistNames = map[string]bool{
|
blacklistNames = map[string]bool{
|
||||||
"links": true,
|
"links": true,
|
||||||
"actions": true,
|
"actions": true,
|
||||||
@ -194,6 +190,16 @@ func jsonName(f reflect.StructField) string {
|
|||||||
return strings.SplitN(f.Tag.Get("json"), ",", 2)[0]
|
return strings.SplitN(f.Tag.Get("json"), ",", 2)[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func k8sType(field reflect.StructField) bool {
|
||||||
|
return field.Type.Name() == "TypeMeta" &&
|
||||||
|
strings.HasSuffix(field.Type.PkgPath(), "k8s.io/apimachinery/pkg/apis/meta/v1")
|
||||||
|
}
|
||||||
|
|
||||||
|
func k8sObject(field reflect.StructField) bool {
|
||||||
|
return field.Type.Name() == "ObjectMeta" &&
|
||||||
|
strings.HasSuffix(field.Type.PkgPath(), "k8s.io/apimachinery/pkg/apis/meta/v1")
|
||||||
|
}
|
||||||
|
|
||||||
func (s *Schemas) readFields(schema *Schema, t reflect.Type) error {
|
func (s *Schemas) readFields(schema *Schema, t reflect.Type) error {
|
||||||
if t == resourceType {
|
if t == resourceType {
|
||||||
schema.CollectionMethods = []string{"GET", "POST"}
|
schema.CollectionMethods = []string{"GET", "POST"}
|
||||||
@ -212,16 +218,15 @@ func (s *Schemas) readFields(schema *Schema, t reflect.Type) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
jsonName := jsonName(field)
|
jsonName := jsonName(field)
|
||||||
|
|
||||||
if jsonName == "-" {
|
if jsonName == "-" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if field.Anonymous && jsonName == "" && field.Type == typeType {
|
if field.Anonymous && jsonName == "" && k8sType(field) {
|
||||||
hasType = true
|
hasType = true
|
||||||
}
|
}
|
||||||
|
|
||||||
if field.Anonymous && jsonName == "metadata" && field.Type == metaType {
|
if field.Anonymous && jsonName == "metadata" && k8sObject(field) {
|
||||||
hasMeta = true
|
hasMeta = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
vendor/github.com/rancher/types/apis/management.cattle.io/v3/rke_types.go
generated
vendored
2
vendor/github.com/rancher/types/apis/management.cattle.io/v3/rke_types.go
generated
vendored
@ -281,6 +281,8 @@ type Process struct {
|
|||||||
Env []string `json:"env,omitempty"`
|
Env []string `json:"env,omitempty"`
|
||||||
// Process docker image
|
// Process docker image
|
||||||
Image string `json:"image,omitempty"`
|
Image string `json:"image,omitempty"`
|
||||||
|
//AuthConfig for image private registry
|
||||||
|
ImageRegistryAuthConfig string `json:"imageRegistryAuthConfig,omitempty"`
|
||||||
// Process docker image VolumesFrom
|
// Process docker image VolumesFrom
|
||||||
VolumesFrom []string `json:"volumesFrom,omitempty"`
|
VolumesFrom []string `json:"volumesFrom,omitempty"`
|
||||||
// Process docker container bind mounts
|
// Process docker container bind mounts
|
||||||
|
@ -3,8 +3,8 @@ package v3
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/rancher/norman/clientbase"
|
|
||||||
"github.com/rancher/norman/controller"
|
"github.com/rancher/norman/controller"
|
||||||
|
"github.com/rancher/norman/objectclient"
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/labels"
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
@ -52,7 +52,7 @@ type AuthConfigController interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type AuthConfigInterface interface {
|
type AuthConfigInterface interface {
|
||||||
ObjectClient() *clientbase.ObjectClient
|
ObjectClient() *objectclient.ObjectClient
|
||||||
Create(*AuthConfig) (*AuthConfig, error)
|
Create(*AuthConfig) (*AuthConfig, error)
|
||||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*AuthConfig, error)
|
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*AuthConfig, error)
|
||||||
Get(name string, opts metav1.GetOptions) (*AuthConfig, error)
|
Get(name string, opts metav1.GetOptions) (*AuthConfig, error)
|
||||||
@ -177,11 +177,11 @@ func (s *authConfigClient) Controller() AuthConfigController {
|
|||||||
type authConfigClient struct {
|
type authConfigClient struct {
|
||||||
client *Client
|
client *Client
|
||||||
ns string
|
ns string
|
||||||
objectClient *clientbase.ObjectClient
|
objectClient *objectclient.ObjectClient
|
||||||
controller AuthConfigController
|
controller AuthConfigController
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *authConfigClient) ObjectClient() *clientbase.ObjectClient {
|
func (s *authConfigClient) ObjectClient() *objectclient.ObjectClient {
|
||||||
return s.objectClient
|
return s.objectClient
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ package v3
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/rancher/norman/clientbase"
|
|
||||||
"github.com/rancher/norman/controller"
|
"github.com/rancher/norman/controller"
|
||||||
|
"github.com/rancher/norman/objectclient"
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/labels"
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
@ -52,7 +52,7 @@ type CatalogController interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type CatalogInterface interface {
|
type CatalogInterface interface {
|
||||||
ObjectClient() *clientbase.ObjectClient
|
ObjectClient() *objectclient.ObjectClient
|
||||||
Create(*Catalog) (*Catalog, error)
|
Create(*Catalog) (*Catalog, error)
|
||||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Catalog, error)
|
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Catalog, error)
|
||||||
Get(name string, opts metav1.GetOptions) (*Catalog, error)
|
Get(name string, opts metav1.GetOptions) (*Catalog, error)
|
||||||
@ -177,11 +177,11 @@ func (s *catalogClient) Controller() CatalogController {
|
|||||||
type catalogClient struct {
|
type catalogClient struct {
|
||||||
client *Client
|
client *Client
|
||||||
ns string
|
ns string
|
||||||
objectClient *clientbase.ObjectClient
|
objectClient *objectclient.ObjectClient
|
||||||
controller CatalogController
|
controller CatalogController
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *catalogClient) ObjectClient() *clientbase.ObjectClient {
|
func (s *catalogClient) ObjectClient() *objectclient.ObjectClient {
|
||||||
return s.objectClient
|
return s.objectClient
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ package v3
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/rancher/norman/clientbase"
|
|
||||||
"github.com/rancher/norman/controller"
|
"github.com/rancher/norman/controller"
|
||||||
|
"github.com/rancher/norman/objectclient"
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/labels"
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
@ -53,7 +53,7 @@ type ClusterAlertController interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ClusterAlertInterface interface {
|
type ClusterAlertInterface interface {
|
||||||
ObjectClient() *clientbase.ObjectClient
|
ObjectClient() *objectclient.ObjectClient
|
||||||
Create(*ClusterAlert) (*ClusterAlert, error)
|
Create(*ClusterAlert) (*ClusterAlert, error)
|
||||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ClusterAlert, error)
|
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ClusterAlert, error)
|
||||||
Get(name string, opts metav1.GetOptions) (*ClusterAlert, error)
|
Get(name string, opts metav1.GetOptions) (*ClusterAlert, error)
|
||||||
@ -178,11 +178,11 @@ func (s *clusterAlertClient) Controller() ClusterAlertController {
|
|||||||
type clusterAlertClient struct {
|
type clusterAlertClient struct {
|
||||||
client *Client
|
client *Client
|
||||||
ns string
|
ns string
|
||||||
objectClient *clientbase.ObjectClient
|
objectClient *objectclient.ObjectClient
|
||||||
controller ClusterAlertController
|
controller ClusterAlertController
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *clusterAlertClient) ObjectClient() *clientbase.ObjectClient {
|
func (s *clusterAlertClient) ObjectClient() *objectclient.ObjectClient {
|
||||||
return s.objectClient
|
return s.objectClient
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ package v3
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/rancher/norman/clientbase"
|
|
||||||
"github.com/rancher/norman/controller"
|
"github.com/rancher/norman/controller"
|
||||||
|
"github.com/rancher/norman/objectclient"
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/labels"
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
@ -53,7 +53,7 @@ type ClusterComposeConfigController interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ClusterComposeConfigInterface interface {
|
type ClusterComposeConfigInterface interface {
|
||||||
ObjectClient() *clientbase.ObjectClient
|
ObjectClient() *objectclient.ObjectClient
|
||||||
Create(*ClusterComposeConfig) (*ClusterComposeConfig, error)
|
Create(*ClusterComposeConfig) (*ClusterComposeConfig, error)
|
||||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ClusterComposeConfig, error)
|
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ClusterComposeConfig, error)
|
||||||
Get(name string, opts metav1.GetOptions) (*ClusterComposeConfig, error)
|
Get(name string, opts metav1.GetOptions) (*ClusterComposeConfig, error)
|
||||||
@ -178,11 +178,11 @@ func (s *clusterComposeConfigClient) Controller() ClusterComposeConfigController
|
|||||||
type clusterComposeConfigClient struct {
|
type clusterComposeConfigClient struct {
|
||||||
client *Client
|
client *Client
|
||||||
ns string
|
ns string
|
||||||
objectClient *clientbase.ObjectClient
|
objectClient *objectclient.ObjectClient
|
||||||
controller ClusterComposeConfigController
|
controller ClusterComposeConfigController
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *clusterComposeConfigClient) ObjectClient() *clientbase.ObjectClient {
|
func (s *clusterComposeConfigClient) ObjectClient() *objectclient.ObjectClient {
|
||||||
return s.objectClient
|
return s.objectClient
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ package v3
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/rancher/norman/clientbase"
|
|
||||||
"github.com/rancher/norman/controller"
|
"github.com/rancher/norman/controller"
|
||||||
|
"github.com/rancher/norman/objectclient"
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/labels"
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
@ -52,7 +52,7 @@ type ClusterController interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ClusterInterface interface {
|
type ClusterInterface interface {
|
||||||
ObjectClient() *clientbase.ObjectClient
|
ObjectClient() *objectclient.ObjectClient
|
||||||
Create(*Cluster) (*Cluster, error)
|
Create(*Cluster) (*Cluster, error)
|
||||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Cluster, error)
|
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Cluster, error)
|
||||||
Get(name string, opts metav1.GetOptions) (*Cluster, error)
|
Get(name string, opts metav1.GetOptions) (*Cluster, error)
|
||||||
@ -177,11 +177,11 @@ func (s *clusterClient) Controller() ClusterController {
|
|||||||
type clusterClient struct {
|
type clusterClient struct {
|
||||||
client *Client
|
client *Client
|
||||||
ns string
|
ns string
|
||||||
objectClient *clientbase.ObjectClient
|
objectClient *objectclient.ObjectClient
|
||||||
controller ClusterController
|
controller ClusterController
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *clusterClient) ObjectClient() *clientbase.ObjectClient {
|
func (s *clusterClient) ObjectClient() *objectclient.ObjectClient {
|
||||||
return s.objectClient
|
return s.objectClient
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ package v3
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/rancher/norman/clientbase"
|
|
||||||
"github.com/rancher/norman/controller"
|
"github.com/rancher/norman/controller"
|
||||||
|
"github.com/rancher/norman/objectclient"
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/labels"
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
@ -53,7 +53,7 @@ type ClusterEventController interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ClusterEventInterface interface {
|
type ClusterEventInterface interface {
|
||||||
ObjectClient() *clientbase.ObjectClient
|
ObjectClient() *objectclient.ObjectClient
|
||||||
Create(*ClusterEvent) (*ClusterEvent, error)
|
Create(*ClusterEvent) (*ClusterEvent, error)
|
||||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ClusterEvent, error)
|
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ClusterEvent, error)
|
||||||
Get(name string, opts metav1.GetOptions) (*ClusterEvent, error)
|
Get(name string, opts metav1.GetOptions) (*ClusterEvent, error)
|
||||||
@ -178,11 +178,11 @@ func (s *clusterEventClient) Controller() ClusterEventController {
|
|||||||
type clusterEventClient struct {
|
type clusterEventClient struct {
|
||||||
client *Client
|
client *Client
|
||||||
ns string
|
ns string
|
||||||
objectClient *clientbase.ObjectClient
|
objectClient *objectclient.ObjectClient
|
||||||
controller ClusterEventController
|
controller ClusterEventController
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *clusterEventClient) ObjectClient() *clientbase.ObjectClient {
|
func (s *clusterEventClient) ObjectClient() *objectclient.ObjectClient {
|
||||||
return s.objectClient
|
return s.objectClient
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ package v3
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/rancher/norman/clientbase"
|
|
||||||
"github.com/rancher/norman/controller"
|
"github.com/rancher/norman/controller"
|
||||||
|
"github.com/rancher/norman/objectclient"
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/labels"
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
@ -53,7 +53,7 @@ type ClusterLoggingController interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ClusterLoggingInterface interface {
|
type ClusterLoggingInterface interface {
|
||||||
ObjectClient() *clientbase.ObjectClient
|
ObjectClient() *objectclient.ObjectClient
|
||||||
Create(*ClusterLogging) (*ClusterLogging, error)
|
Create(*ClusterLogging) (*ClusterLogging, error)
|
||||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ClusterLogging, error)
|
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ClusterLogging, error)
|
||||||
Get(name string, opts metav1.GetOptions) (*ClusterLogging, error)
|
Get(name string, opts metav1.GetOptions) (*ClusterLogging, error)
|
||||||
@ -178,11 +178,11 @@ func (s *clusterLoggingClient) Controller() ClusterLoggingController {
|
|||||||
type clusterLoggingClient struct {
|
type clusterLoggingClient struct {
|
||||||
client *Client
|
client *Client
|
||||||
ns string
|
ns string
|
||||||
objectClient *clientbase.ObjectClient
|
objectClient *objectclient.ObjectClient
|
||||||
controller ClusterLoggingController
|
controller ClusterLoggingController
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *clusterLoggingClient) ObjectClient() *clientbase.ObjectClient {
|
func (s *clusterLoggingClient) ObjectClient() *objectclient.ObjectClient {
|
||||||
return s.objectClient
|
return s.objectClient
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ package v3
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/rancher/norman/clientbase"
|
|
||||||
"github.com/rancher/norman/controller"
|
"github.com/rancher/norman/controller"
|
||||||
|
"github.com/rancher/norman/objectclient"
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/labels"
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
@ -53,7 +53,7 @@ type ClusterPipelineController interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ClusterPipelineInterface interface {
|
type ClusterPipelineInterface interface {
|
||||||
ObjectClient() *clientbase.ObjectClient
|
ObjectClient() *objectclient.ObjectClient
|
||||||
Create(*ClusterPipeline) (*ClusterPipeline, error)
|
Create(*ClusterPipeline) (*ClusterPipeline, error)
|
||||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ClusterPipeline, error)
|
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ClusterPipeline, error)
|
||||||
Get(name string, opts metav1.GetOptions) (*ClusterPipeline, error)
|
Get(name string, opts metav1.GetOptions) (*ClusterPipeline, error)
|
||||||
@ -178,11 +178,11 @@ func (s *clusterPipelineClient) Controller() ClusterPipelineController {
|
|||||||
type clusterPipelineClient struct {
|
type clusterPipelineClient struct {
|
||||||
client *Client
|
client *Client
|
||||||
ns string
|
ns string
|
||||||
objectClient *clientbase.ObjectClient
|
objectClient *objectclient.ObjectClient
|
||||||
controller ClusterPipelineController
|
controller ClusterPipelineController
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *clusterPipelineClient) ObjectClient() *clientbase.ObjectClient {
|
func (s *clusterPipelineClient) ObjectClient() *objectclient.ObjectClient {
|
||||||
return s.objectClient
|
return s.objectClient
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ package v3
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/rancher/norman/clientbase"
|
|
||||||
"github.com/rancher/norman/controller"
|
"github.com/rancher/norman/controller"
|
||||||
|
"github.com/rancher/norman/objectclient"
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/labels"
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
@ -53,7 +53,7 @@ type ClusterRegistrationTokenController interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ClusterRegistrationTokenInterface interface {
|
type ClusterRegistrationTokenInterface interface {
|
||||||
ObjectClient() *clientbase.ObjectClient
|
ObjectClient() *objectclient.ObjectClient
|
||||||
Create(*ClusterRegistrationToken) (*ClusterRegistrationToken, error)
|
Create(*ClusterRegistrationToken) (*ClusterRegistrationToken, error)
|
||||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ClusterRegistrationToken, error)
|
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ClusterRegistrationToken, error)
|
||||||
Get(name string, opts metav1.GetOptions) (*ClusterRegistrationToken, error)
|
Get(name string, opts metav1.GetOptions) (*ClusterRegistrationToken, error)
|
||||||
@ -178,11 +178,11 @@ func (s *clusterRegistrationTokenClient) Controller() ClusterRegistrationTokenCo
|
|||||||
type clusterRegistrationTokenClient struct {
|
type clusterRegistrationTokenClient struct {
|
||||||
client *Client
|
client *Client
|
||||||
ns string
|
ns string
|
||||||
objectClient *clientbase.ObjectClient
|
objectClient *objectclient.ObjectClient
|
||||||
controller ClusterRegistrationTokenController
|
controller ClusterRegistrationTokenController
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *clusterRegistrationTokenClient) ObjectClient() *clientbase.ObjectClient {
|
func (s *clusterRegistrationTokenClient) ObjectClient() *objectclient.ObjectClient {
|
||||||
return s.objectClient
|
return s.objectClient
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ package v3
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/rancher/norman/clientbase"
|
|
||||||
"github.com/rancher/norman/controller"
|
"github.com/rancher/norman/controller"
|
||||||
|
"github.com/rancher/norman/objectclient"
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/labels"
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
@ -53,7 +53,7 @@ type ClusterRoleTemplateBindingController interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ClusterRoleTemplateBindingInterface interface {
|
type ClusterRoleTemplateBindingInterface interface {
|
||||||
ObjectClient() *clientbase.ObjectClient
|
ObjectClient() *objectclient.ObjectClient
|
||||||
Create(*ClusterRoleTemplateBinding) (*ClusterRoleTemplateBinding, error)
|
Create(*ClusterRoleTemplateBinding) (*ClusterRoleTemplateBinding, error)
|
||||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ClusterRoleTemplateBinding, error)
|
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ClusterRoleTemplateBinding, error)
|
||||||
Get(name string, opts metav1.GetOptions) (*ClusterRoleTemplateBinding, error)
|
Get(name string, opts metav1.GetOptions) (*ClusterRoleTemplateBinding, error)
|
||||||
@ -178,11 +178,11 @@ func (s *clusterRoleTemplateBindingClient) Controller() ClusterRoleTemplateBindi
|
|||||||
type clusterRoleTemplateBindingClient struct {
|
type clusterRoleTemplateBindingClient struct {
|
||||||
client *Client
|
client *Client
|
||||||
ns string
|
ns string
|
||||||
objectClient *clientbase.ObjectClient
|
objectClient *objectclient.ObjectClient
|
||||||
controller ClusterRoleTemplateBindingController
|
controller ClusterRoleTemplateBindingController
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *clusterRoleTemplateBindingClient) ObjectClient() *clientbase.ObjectClient {
|
func (s *clusterRoleTemplateBindingClient) ObjectClient() *objectclient.ObjectClient {
|
||||||
return s.objectClient
|
return s.objectClient
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ package v3
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/rancher/norman/clientbase"
|
|
||||||
"github.com/rancher/norman/controller"
|
"github.com/rancher/norman/controller"
|
||||||
|
"github.com/rancher/norman/objectclient"
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/labels"
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
@ -52,7 +52,7 @@ type DynamicSchemaController interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type DynamicSchemaInterface interface {
|
type DynamicSchemaInterface interface {
|
||||||
ObjectClient() *clientbase.ObjectClient
|
ObjectClient() *objectclient.ObjectClient
|
||||||
Create(*DynamicSchema) (*DynamicSchema, error)
|
Create(*DynamicSchema) (*DynamicSchema, error)
|
||||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*DynamicSchema, error)
|
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*DynamicSchema, error)
|
||||||
Get(name string, opts metav1.GetOptions) (*DynamicSchema, error)
|
Get(name string, opts metav1.GetOptions) (*DynamicSchema, error)
|
||||||
@ -177,11 +177,11 @@ func (s *dynamicSchemaClient) Controller() DynamicSchemaController {
|
|||||||
type dynamicSchemaClient struct {
|
type dynamicSchemaClient struct {
|
||||||
client *Client
|
client *Client
|
||||||
ns string
|
ns string
|
||||||
objectClient *clientbase.ObjectClient
|
objectClient *objectclient.ObjectClient
|
||||||
controller DynamicSchemaController
|
controller DynamicSchemaController
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *dynamicSchemaClient) ObjectClient() *clientbase.ObjectClient {
|
func (s *dynamicSchemaClient) ObjectClient() *objectclient.ObjectClient {
|
||||||
return s.objectClient
|
return s.objectClient
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ package v3
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/rancher/norman/clientbase"
|
|
||||||
"github.com/rancher/norman/controller"
|
"github.com/rancher/norman/controller"
|
||||||
|
"github.com/rancher/norman/objectclient"
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/labels"
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
@ -52,7 +52,7 @@ type GlobalComposeConfigController interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type GlobalComposeConfigInterface interface {
|
type GlobalComposeConfigInterface interface {
|
||||||
ObjectClient() *clientbase.ObjectClient
|
ObjectClient() *objectclient.ObjectClient
|
||||||
Create(*GlobalComposeConfig) (*GlobalComposeConfig, error)
|
Create(*GlobalComposeConfig) (*GlobalComposeConfig, error)
|
||||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*GlobalComposeConfig, error)
|
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*GlobalComposeConfig, error)
|
||||||
Get(name string, opts metav1.GetOptions) (*GlobalComposeConfig, error)
|
Get(name string, opts metav1.GetOptions) (*GlobalComposeConfig, error)
|
||||||
@ -177,11 +177,11 @@ func (s *globalComposeConfigClient) Controller() GlobalComposeConfigController {
|
|||||||
type globalComposeConfigClient struct {
|
type globalComposeConfigClient struct {
|
||||||
client *Client
|
client *Client
|
||||||
ns string
|
ns string
|
||||||
objectClient *clientbase.ObjectClient
|
objectClient *objectclient.ObjectClient
|
||||||
controller GlobalComposeConfigController
|
controller GlobalComposeConfigController
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *globalComposeConfigClient) ObjectClient() *clientbase.ObjectClient {
|
func (s *globalComposeConfigClient) ObjectClient() *objectclient.ObjectClient {
|
||||||
return s.objectClient
|
return s.objectClient
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ package v3
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/rancher/norman/clientbase"
|
|
||||||
"github.com/rancher/norman/controller"
|
"github.com/rancher/norman/controller"
|
||||||
|
"github.com/rancher/norman/objectclient"
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/labels"
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
@ -52,7 +52,7 @@ type GlobalRoleBindingController interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type GlobalRoleBindingInterface interface {
|
type GlobalRoleBindingInterface interface {
|
||||||
ObjectClient() *clientbase.ObjectClient
|
ObjectClient() *objectclient.ObjectClient
|
||||||
Create(*GlobalRoleBinding) (*GlobalRoleBinding, error)
|
Create(*GlobalRoleBinding) (*GlobalRoleBinding, error)
|
||||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*GlobalRoleBinding, error)
|
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*GlobalRoleBinding, error)
|
||||||
Get(name string, opts metav1.GetOptions) (*GlobalRoleBinding, error)
|
Get(name string, opts metav1.GetOptions) (*GlobalRoleBinding, error)
|
||||||
@ -177,11 +177,11 @@ func (s *globalRoleBindingClient) Controller() GlobalRoleBindingController {
|
|||||||
type globalRoleBindingClient struct {
|
type globalRoleBindingClient struct {
|
||||||
client *Client
|
client *Client
|
||||||
ns string
|
ns string
|
||||||
objectClient *clientbase.ObjectClient
|
objectClient *objectclient.ObjectClient
|
||||||
controller GlobalRoleBindingController
|
controller GlobalRoleBindingController
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *globalRoleBindingClient) ObjectClient() *clientbase.ObjectClient {
|
func (s *globalRoleBindingClient) ObjectClient() *objectclient.ObjectClient {
|
||||||
return s.objectClient
|
return s.objectClient
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ package v3
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/rancher/norman/clientbase"
|
|
||||||
"github.com/rancher/norman/controller"
|
"github.com/rancher/norman/controller"
|
||||||
|
"github.com/rancher/norman/objectclient"
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/labels"
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
@ -52,7 +52,7 @@ type GlobalRoleController interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type GlobalRoleInterface interface {
|
type GlobalRoleInterface interface {
|
||||||
ObjectClient() *clientbase.ObjectClient
|
ObjectClient() *objectclient.ObjectClient
|
||||||
Create(*GlobalRole) (*GlobalRole, error)
|
Create(*GlobalRole) (*GlobalRole, error)
|
||||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*GlobalRole, error)
|
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*GlobalRole, error)
|
||||||
Get(name string, opts metav1.GetOptions) (*GlobalRole, error)
|
Get(name string, opts metav1.GetOptions) (*GlobalRole, error)
|
||||||
@ -177,11 +177,11 @@ func (s *globalRoleClient) Controller() GlobalRoleController {
|
|||||||
type globalRoleClient struct {
|
type globalRoleClient struct {
|
||||||
client *Client
|
client *Client
|
||||||
ns string
|
ns string
|
||||||
objectClient *clientbase.ObjectClient
|
objectClient *objectclient.ObjectClient
|
||||||
controller GlobalRoleController
|
controller GlobalRoleController
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *globalRoleClient) ObjectClient() *clientbase.ObjectClient {
|
func (s *globalRoleClient) ObjectClient() *objectclient.ObjectClient {
|
||||||
return s.objectClient
|
return s.objectClient
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ package v3
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/rancher/norman/clientbase"
|
|
||||||
"github.com/rancher/norman/controller"
|
"github.com/rancher/norman/controller"
|
||||||
|
"github.com/rancher/norman/objectclient"
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/labels"
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
@ -52,7 +52,7 @@ type GroupController interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type GroupInterface interface {
|
type GroupInterface interface {
|
||||||
ObjectClient() *clientbase.ObjectClient
|
ObjectClient() *objectclient.ObjectClient
|
||||||
Create(*Group) (*Group, error)
|
Create(*Group) (*Group, error)
|
||||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Group, error)
|
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Group, error)
|
||||||
Get(name string, opts metav1.GetOptions) (*Group, error)
|
Get(name string, opts metav1.GetOptions) (*Group, error)
|
||||||
@ -177,11 +177,11 @@ func (s *groupClient) Controller() GroupController {
|
|||||||
type groupClient struct {
|
type groupClient struct {
|
||||||
client *Client
|
client *Client
|
||||||
ns string
|
ns string
|
||||||
objectClient *clientbase.ObjectClient
|
objectClient *objectclient.ObjectClient
|
||||||
controller GroupController
|
controller GroupController
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *groupClient) ObjectClient() *clientbase.ObjectClient {
|
func (s *groupClient) ObjectClient() *objectclient.ObjectClient {
|
||||||
return s.objectClient
|
return s.objectClient
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ package v3
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/rancher/norman/clientbase"
|
|
||||||
"github.com/rancher/norman/controller"
|
"github.com/rancher/norman/controller"
|
||||||
|
"github.com/rancher/norman/objectclient"
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/labels"
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
@ -52,7 +52,7 @@ type GroupMemberController interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type GroupMemberInterface interface {
|
type GroupMemberInterface interface {
|
||||||
ObjectClient() *clientbase.ObjectClient
|
ObjectClient() *objectclient.ObjectClient
|
||||||
Create(*GroupMember) (*GroupMember, error)
|
Create(*GroupMember) (*GroupMember, error)
|
||||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*GroupMember, error)
|
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*GroupMember, error)
|
||||||
Get(name string, opts metav1.GetOptions) (*GroupMember, error)
|
Get(name string, opts metav1.GetOptions) (*GroupMember, error)
|
||||||
@ -177,11 +177,11 @@ func (s *groupMemberClient) Controller() GroupMemberController {
|
|||||||
type groupMemberClient struct {
|
type groupMemberClient struct {
|
||||||
client *Client
|
client *Client
|
||||||
ns string
|
ns string
|
||||||
objectClient *clientbase.ObjectClient
|
objectClient *objectclient.ObjectClient
|
||||||
controller GroupMemberController
|
controller GroupMemberController
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *groupMemberClient) ObjectClient() *clientbase.ObjectClient {
|
func (s *groupMemberClient) ObjectClient() *objectclient.ObjectClient {
|
||||||
return s.objectClient
|
return s.objectClient
|
||||||
}
|
}
|
||||||
|
|
||||||
|
86
vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_k8s_client.go
generated
vendored
86
vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_k8s_client.go
generated
vendored
@ -4,8 +4,8 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/rancher/norman/clientbase"
|
|
||||||
"github.com/rancher/norman/controller"
|
"github.com/rancher/norman/controller"
|
||||||
|
"github.com/rancher/norman/objectclient"
|
||||||
"github.com/rancher/norman/restwatch"
|
"github.com/rancher/norman/restwatch"
|
||||||
"k8s.io/client-go/dynamic"
|
"k8s.io/client-go/dynamic"
|
||||||
"k8s.io/client-go/rest"
|
"k8s.io/client-go/rest"
|
||||||
@ -184,7 +184,7 @@ type NodePoolsGetter interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) NodePools(namespace string) NodePoolInterface {
|
func (c *Client) NodePools(namespace string) NodePoolInterface {
|
||||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &NodePoolResource, NodePoolGroupVersionKind, nodePoolFactory{})
|
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &NodePoolResource, NodePoolGroupVersionKind, nodePoolFactory{})
|
||||||
return &nodePoolClient{
|
return &nodePoolClient{
|
||||||
ns: namespace,
|
ns: namespace,
|
||||||
client: c,
|
client: c,
|
||||||
@ -197,7 +197,7 @@ type NodesGetter interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) Nodes(namespace string) NodeInterface {
|
func (c *Client) Nodes(namespace string) NodeInterface {
|
||||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &NodeResource, NodeGroupVersionKind, nodeFactory{})
|
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &NodeResource, NodeGroupVersionKind, nodeFactory{})
|
||||||
return &nodeClient{
|
return &nodeClient{
|
||||||
ns: namespace,
|
ns: namespace,
|
||||||
client: c,
|
client: c,
|
||||||
@ -210,7 +210,7 @@ type NodeDriversGetter interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) NodeDrivers(namespace string) NodeDriverInterface {
|
func (c *Client) NodeDrivers(namespace string) NodeDriverInterface {
|
||||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &NodeDriverResource, NodeDriverGroupVersionKind, nodeDriverFactory{})
|
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &NodeDriverResource, NodeDriverGroupVersionKind, nodeDriverFactory{})
|
||||||
return &nodeDriverClient{
|
return &nodeDriverClient{
|
||||||
ns: namespace,
|
ns: namespace,
|
||||||
client: c,
|
client: c,
|
||||||
@ -223,7 +223,7 @@ type NodeTemplatesGetter interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) NodeTemplates(namespace string) NodeTemplateInterface {
|
func (c *Client) NodeTemplates(namespace string) NodeTemplateInterface {
|
||||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &NodeTemplateResource, NodeTemplateGroupVersionKind, nodeTemplateFactory{})
|
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &NodeTemplateResource, NodeTemplateGroupVersionKind, nodeTemplateFactory{})
|
||||||
return &nodeTemplateClient{
|
return &nodeTemplateClient{
|
||||||
ns: namespace,
|
ns: namespace,
|
||||||
client: c,
|
client: c,
|
||||||
@ -236,7 +236,7 @@ type ProjectsGetter interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) Projects(namespace string) ProjectInterface {
|
func (c *Client) Projects(namespace string) ProjectInterface {
|
||||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &ProjectResource, ProjectGroupVersionKind, projectFactory{})
|
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &ProjectResource, ProjectGroupVersionKind, projectFactory{})
|
||||||
return &projectClient{
|
return &projectClient{
|
||||||
ns: namespace,
|
ns: namespace,
|
||||||
client: c,
|
client: c,
|
||||||
@ -249,7 +249,7 @@ type GlobalRolesGetter interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) GlobalRoles(namespace string) GlobalRoleInterface {
|
func (c *Client) GlobalRoles(namespace string) GlobalRoleInterface {
|
||||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &GlobalRoleResource, GlobalRoleGroupVersionKind, globalRoleFactory{})
|
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &GlobalRoleResource, GlobalRoleGroupVersionKind, globalRoleFactory{})
|
||||||
return &globalRoleClient{
|
return &globalRoleClient{
|
||||||
ns: namespace,
|
ns: namespace,
|
||||||
client: c,
|
client: c,
|
||||||
@ -262,7 +262,7 @@ type GlobalRoleBindingsGetter interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) GlobalRoleBindings(namespace string) GlobalRoleBindingInterface {
|
func (c *Client) GlobalRoleBindings(namespace string) GlobalRoleBindingInterface {
|
||||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &GlobalRoleBindingResource, GlobalRoleBindingGroupVersionKind, globalRoleBindingFactory{})
|
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &GlobalRoleBindingResource, GlobalRoleBindingGroupVersionKind, globalRoleBindingFactory{})
|
||||||
return &globalRoleBindingClient{
|
return &globalRoleBindingClient{
|
||||||
ns: namespace,
|
ns: namespace,
|
||||||
client: c,
|
client: c,
|
||||||
@ -275,7 +275,7 @@ type RoleTemplatesGetter interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) RoleTemplates(namespace string) RoleTemplateInterface {
|
func (c *Client) RoleTemplates(namespace string) RoleTemplateInterface {
|
||||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &RoleTemplateResource, RoleTemplateGroupVersionKind, roleTemplateFactory{})
|
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &RoleTemplateResource, RoleTemplateGroupVersionKind, roleTemplateFactory{})
|
||||||
return &roleTemplateClient{
|
return &roleTemplateClient{
|
||||||
ns: namespace,
|
ns: namespace,
|
||||||
client: c,
|
client: c,
|
||||||
@ -288,7 +288,7 @@ type PodSecurityPolicyTemplatesGetter interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) PodSecurityPolicyTemplates(namespace string) PodSecurityPolicyTemplateInterface {
|
func (c *Client) PodSecurityPolicyTemplates(namespace string) PodSecurityPolicyTemplateInterface {
|
||||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &PodSecurityPolicyTemplateResource, PodSecurityPolicyTemplateGroupVersionKind, podSecurityPolicyTemplateFactory{})
|
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &PodSecurityPolicyTemplateResource, PodSecurityPolicyTemplateGroupVersionKind, podSecurityPolicyTemplateFactory{})
|
||||||
return &podSecurityPolicyTemplateClient{
|
return &podSecurityPolicyTemplateClient{
|
||||||
ns: namespace,
|
ns: namespace,
|
||||||
client: c,
|
client: c,
|
||||||
@ -301,7 +301,7 @@ type PodSecurityPolicyTemplateProjectBindingsGetter interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) PodSecurityPolicyTemplateProjectBindings(namespace string) PodSecurityPolicyTemplateProjectBindingInterface {
|
func (c *Client) PodSecurityPolicyTemplateProjectBindings(namespace string) PodSecurityPolicyTemplateProjectBindingInterface {
|
||||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &PodSecurityPolicyTemplateProjectBindingResource, PodSecurityPolicyTemplateProjectBindingGroupVersionKind, podSecurityPolicyTemplateProjectBindingFactory{})
|
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &PodSecurityPolicyTemplateProjectBindingResource, PodSecurityPolicyTemplateProjectBindingGroupVersionKind, podSecurityPolicyTemplateProjectBindingFactory{})
|
||||||
return &podSecurityPolicyTemplateProjectBindingClient{
|
return &podSecurityPolicyTemplateProjectBindingClient{
|
||||||
ns: namespace,
|
ns: namespace,
|
||||||
client: c,
|
client: c,
|
||||||
@ -314,7 +314,7 @@ type ClusterRoleTemplateBindingsGetter interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) ClusterRoleTemplateBindings(namespace string) ClusterRoleTemplateBindingInterface {
|
func (c *Client) ClusterRoleTemplateBindings(namespace string) ClusterRoleTemplateBindingInterface {
|
||||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &ClusterRoleTemplateBindingResource, ClusterRoleTemplateBindingGroupVersionKind, clusterRoleTemplateBindingFactory{})
|
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &ClusterRoleTemplateBindingResource, ClusterRoleTemplateBindingGroupVersionKind, clusterRoleTemplateBindingFactory{})
|
||||||
return &clusterRoleTemplateBindingClient{
|
return &clusterRoleTemplateBindingClient{
|
||||||
ns: namespace,
|
ns: namespace,
|
||||||
client: c,
|
client: c,
|
||||||
@ -327,7 +327,7 @@ type ProjectRoleTemplateBindingsGetter interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) ProjectRoleTemplateBindings(namespace string) ProjectRoleTemplateBindingInterface {
|
func (c *Client) ProjectRoleTemplateBindings(namespace string) ProjectRoleTemplateBindingInterface {
|
||||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &ProjectRoleTemplateBindingResource, ProjectRoleTemplateBindingGroupVersionKind, projectRoleTemplateBindingFactory{})
|
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &ProjectRoleTemplateBindingResource, ProjectRoleTemplateBindingGroupVersionKind, projectRoleTemplateBindingFactory{})
|
||||||
return &projectRoleTemplateBindingClient{
|
return &projectRoleTemplateBindingClient{
|
||||||
ns: namespace,
|
ns: namespace,
|
||||||
client: c,
|
client: c,
|
||||||
@ -340,7 +340,7 @@ type ClustersGetter interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) Clusters(namespace string) ClusterInterface {
|
func (c *Client) Clusters(namespace string) ClusterInterface {
|
||||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &ClusterResource, ClusterGroupVersionKind, clusterFactory{})
|
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &ClusterResource, ClusterGroupVersionKind, clusterFactory{})
|
||||||
return &clusterClient{
|
return &clusterClient{
|
||||||
ns: namespace,
|
ns: namespace,
|
||||||
client: c,
|
client: c,
|
||||||
@ -353,7 +353,7 @@ type ClusterEventsGetter interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) ClusterEvents(namespace string) ClusterEventInterface {
|
func (c *Client) ClusterEvents(namespace string) ClusterEventInterface {
|
||||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &ClusterEventResource, ClusterEventGroupVersionKind, clusterEventFactory{})
|
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &ClusterEventResource, ClusterEventGroupVersionKind, clusterEventFactory{})
|
||||||
return &clusterEventClient{
|
return &clusterEventClient{
|
||||||
ns: namespace,
|
ns: namespace,
|
||||||
client: c,
|
client: c,
|
||||||
@ -366,7 +366,7 @@ type ClusterRegistrationTokensGetter interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) ClusterRegistrationTokens(namespace string) ClusterRegistrationTokenInterface {
|
func (c *Client) ClusterRegistrationTokens(namespace string) ClusterRegistrationTokenInterface {
|
||||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &ClusterRegistrationTokenResource, ClusterRegistrationTokenGroupVersionKind, clusterRegistrationTokenFactory{})
|
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &ClusterRegistrationTokenResource, ClusterRegistrationTokenGroupVersionKind, clusterRegistrationTokenFactory{})
|
||||||
return &clusterRegistrationTokenClient{
|
return &clusterRegistrationTokenClient{
|
||||||
ns: namespace,
|
ns: namespace,
|
||||||
client: c,
|
client: c,
|
||||||
@ -379,7 +379,7 @@ type CatalogsGetter interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) Catalogs(namespace string) CatalogInterface {
|
func (c *Client) Catalogs(namespace string) CatalogInterface {
|
||||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &CatalogResource, CatalogGroupVersionKind, catalogFactory{})
|
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &CatalogResource, CatalogGroupVersionKind, catalogFactory{})
|
||||||
return &catalogClient{
|
return &catalogClient{
|
||||||
ns: namespace,
|
ns: namespace,
|
||||||
client: c,
|
client: c,
|
||||||
@ -392,7 +392,7 @@ type TemplatesGetter interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) Templates(namespace string) TemplateInterface {
|
func (c *Client) Templates(namespace string) TemplateInterface {
|
||||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &TemplateResource, TemplateGroupVersionKind, templateFactory{})
|
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &TemplateResource, TemplateGroupVersionKind, templateFactory{})
|
||||||
return &templateClient{
|
return &templateClient{
|
||||||
ns: namespace,
|
ns: namespace,
|
||||||
client: c,
|
client: c,
|
||||||
@ -405,7 +405,7 @@ type TemplateVersionsGetter interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) TemplateVersions(namespace string) TemplateVersionInterface {
|
func (c *Client) TemplateVersions(namespace string) TemplateVersionInterface {
|
||||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &TemplateVersionResource, TemplateVersionGroupVersionKind, templateVersionFactory{})
|
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &TemplateVersionResource, TemplateVersionGroupVersionKind, templateVersionFactory{})
|
||||||
return &templateVersionClient{
|
return &templateVersionClient{
|
||||||
ns: namespace,
|
ns: namespace,
|
||||||
client: c,
|
client: c,
|
||||||
@ -418,7 +418,7 @@ type GroupsGetter interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) Groups(namespace string) GroupInterface {
|
func (c *Client) Groups(namespace string) GroupInterface {
|
||||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &GroupResource, GroupGroupVersionKind, groupFactory{})
|
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &GroupResource, GroupGroupVersionKind, groupFactory{})
|
||||||
return &groupClient{
|
return &groupClient{
|
||||||
ns: namespace,
|
ns: namespace,
|
||||||
client: c,
|
client: c,
|
||||||
@ -431,7 +431,7 @@ type GroupMembersGetter interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) GroupMembers(namespace string) GroupMemberInterface {
|
func (c *Client) GroupMembers(namespace string) GroupMemberInterface {
|
||||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &GroupMemberResource, GroupMemberGroupVersionKind, groupMemberFactory{})
|
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &GroupMemberResource, GroupMemberGroupVersionKind, groupMemberFactory{})
|
||||||
return &groupMemberClient{
|
return &groupMemberClient{
|
||||||
ns: namespace,
|
ns: namespace,
|
||||||
client: c,
|
client: c,
|
||||||
@ -444,7 +444,7 @@ type PrincipalsGetter interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) Principals(namespace string) PrincipalInterface {
|
func (c *Client) Principals(namespace string) PrincipalInterface {
|
||||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &PrincipalResource, PrincipalGroupVersionKind, principalFactory{})
|
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &PrincipalResource, PrincipalGroupVersionKind, principalFactory{})
|
||||||
return &principalClient{
|
return &principalClient{
|
||||||
ns: namespace,
|
ns: namespace,
|
||||||
client: c,
|
client: c,
|
||||||
@ -457,7 +457,7 @@ type UsersGetter interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) Users(namespace string) UserInterface {
|
func (c *Client) Users(namespace string) UserInterface {
|
||||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &UserResource, UserGroupVersionKind, userFactory{})
|
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &UserResource, UserGroupVersionKind, userFactory{})
|
||||||
return &userClient{
|
return &userClient{
|
||||||
ns: namespace,
|
ns: namespace,
|
||||||
client: c,
|
client: c,
|
||||||
@ -470,7 +470,7 @@ type AuthConfigsGetter interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) AuthConfigs(namespace string) AuthConfigInterface {
|
func (c *Client) AuthConfigs(namespace string) AuthConfigInterface {
|
||||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &AuthConfigResource, AuthConfigGroupVersionKind, authConfigFactory{})
|
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &AuthConfigResource, AuthConfigGroupVersionKind, authConfigFactory{})
|
||||||
return &authConfigClient{
|
return &authConfigClient{
|
||||||
ns: namespace,
|
ns: namespace,
|
||||||
client: c,
|
client: c,
|
||||||
@ -483,7 +483,7 @@ type TokensGetter interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) Tokens(namespace string) TokenInterface {
|
func (c *Client) Tokens(namespace string) TokenInterface {
|
||||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &TokenResource, TokenGroupVersionKind, tokenFactory{})
|
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &TokenResource, TokenGroupVersionKind, tokenFactory{})
|
||||||
return &tokenClient{
|
return &tokenClient{
|
||||||
ns: namespace,
|
ns: namespace,
|
||||||
client: c,
|
client: c,
|
||||||
@ -496,7 +496,7 @@ type DynamicSchemasGetter interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) DynamicSchemas(namespace string) DynamicSchemaInterface {
|
func (c *Client) DynamicSchemas(namespace string) DynamicSchemaInterface {
|
||||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &DynamicSchemaResource, DynamicSchemaGroupVersionKind, dynamicSchemaFactory{})
|
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &DynamicSchemaResource, DynamicSchemaGroupVersionKind, dynamicSchemaFactory{})
|
||||||
return &dynamicSchemaClient{
|
return &dynamicSchemaClient{
|
||||||
ns: namespace,
|
ns: namespace,
|
||||||
client: c,
|
client: c,
|
||||||
@ -509,7 +509,7 @@ type PreferencesGetter interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) Preferences(namespace string) PreferenceInterface {
|
func (c *Client) Preferences(namespace string) PreferenceInterface {
|
||||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &PreferenceResource, PreferenceGroupVersionKind, preferenceFactory{})
|
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &PreferenceResource, PreferenceGroupVersionKind, preferenceFactory{})
|
||||||
return &preferenceClient{
|
return &preferenceClient{
|
||||||
ns: namespace,
|
ns: namespace,
|
||||||
client: c,
|
client: c,
|
||||||
@ -522,7 +522,7 @@ type ProjectNetworkPoliciesGetter interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) ProjectNetworkPolicies(namespace string) ProjectNetworkPolicyInterface {
|
func (c *Client) ProjectNetworkPolicies(namespace string) ProjectNetworkPolicyInterface {
|
||||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &ProjectNetworkPolicyResource, ProjectNetworkPolicyGroupVersionKind, projectNetworkPolicyFactory{})
|
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &ProjectNetworkPolicyResource, ProjectNetworkPolicyGroupVersionKind, projectNetworkPolicyFactory{})
|
||||||
return &projectNetworkPolicyClient{
|
return &projectNetworkPolicyClient{
|
||||||
ns: namespace,
|
ns: namespace,
|
||||||
client: c,
|
client: c,
|
||||||
@ -535,7 +535,7 @@ type ClusterLoggingsGetter interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) ClusterLoggings(namespace string) ClusterLoggingInterface {
|
func (c *Client) ClusterLoggings(namespace string) ClusterLoggingInterface {
|
||||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &ClusterLoggingResource, ClusterLoggingGroupVersionKind, clusterLoggingFactory{})
|
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &ClusterLoggingResource, ClusterLoggingGroupVersionKind, clusterLoggingFactory{})
|
||||||
return &clusterLoggingClient{
|
return &clusterLoggingClient{
|
||||||
ns: namespace,
|
ns: namespace,
|
||||||
client: c,
|
client: c,
|
||||||
@ -548,7 +548,7 @@ type ProjectLoggingsGetter interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) ProjectLoggings(namespace string) ProjectLoggingInterface {
|
func (c *Client) ProjectLoggings(namespace string) ProjectLoggingInterface {
|
||||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &ProjectLoggingResource, ProjectLoggingGroupVersionKind, projectLoggingFactory{})
|
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &ProjectLoggingResource, ProjectLoggingGroupVersionKind, projectLoggingFactory{})
|
||||||
return &projectLoggingClient{
|
return &projectLoggingClient{
|
||||||
ns: namespace,
|
ns: namespace,
|
||||||
client: c,
|
client: c,
|
||||||
@ -561,7 +561,7 @@ type ListenConfigsGetter interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) ListenConfigs(namespace string) ListenConfigInterface {
|
func (c *Client) ListenConfigs(namespace string) ListenConfigInterface {
|
||||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &ListenConfigResource, ListenConfigGroupVersionKind, listenConfigFactory{})
|
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &ListenConfigResource, ListenConfigGroupVersionKind, listenConfigFactory{})
|
||||||
return &listenConfigClient{
|
return &listenConfigClient{
|
||||||
ns: namespace,
|
ns: namespace,
|
||||||
client: c,
|
client: c,
|
||||||
@ -574,7 +574,7 @@ type SettingsGetter interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) Settings(namespace string) SettingInterface {
|
func (c *Client) Settings(namespace string) SettingInterface {
|
||||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &SettingResource, SettingGroupVersionKind, settingFactory{})
|
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &SettingResource, SettingGroupVersionKind, settingFactory{})
|
||||||
return &settingClient{
|
return &settingClient{
|
||||||
ns: namespace,
|
ns: namespace,
|
||||||
client: c,
|
client: c,
|
||||||
@ -587,7 +587,7 @@ type NotifiersGetter interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) Notifiers(namespace string) NotifierInterface {
|
func (c *Client) Notifiers(namespace string) NotifierInterface {
|
||||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &NotifierResource, NotifierGroupVersionKind, notifierFactory{})
|
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &NotifierResource, NotifierGroupVersionKind, notifierFactory{})
|
||||||
return ¬ifierClient{
|
return ¬ifierClient{
|
||||||
ns: namespace,
|
ns: namespace,
|
||||||
client: c,
|
client: c,
|
||||||
@ -600,7 +600,7 @@ type ClusterAlertsGetter interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) ClusterAlerts(namespace string) ClusterAlertInterface {
|
func (c *Client) ClusterAlerts(namespace string) ClusterAlertInterface {
|
||||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &ClusterAlertResource, ClusterAlertGroupVersionKind, clusterAlertFactory{})
|
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &ClusterAlertResource, ClusterAlertGroupVersionKind, clusterAlertFactory{})
|
||||||
return &clusterAlertClient{
|
return &clusterAlertClient{
|
||||||
ns: namespace,
|
ns: namespace,
|
||||||
client: c,
|
client: c,
|
||||||
@ -613,7 +613,7 @@ type ProjectAlertsGetter interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) ProjectAlerts(namespace string) ProjectAlertInterface {
|
func (c *Client) ProjectAlerts(namespace string) ProjectAlertInterface {
|
||||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &ProjectAlertResource, ProjectAlertGroupVersionKind, projectAlertFactory{})
|
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &ProjectAlertResource, ProjectAlertGroupVersionKind, projectAlertFactory{})
|
||||||
return &projectAlertClient{
|
return &projectAlertClient{
|
||||||
ns: namespace,
|
ns: namespace,
|
||||||
client: c,
|
client: c,
|
||||||
@ -626,7 +626,7 @@ type ClusterPipelinesGetter interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) ClusterPipelines(namespace string) ClusterPipelineInterface {
|
func (c *Client) ClusterPipelines(namespace string) ClusterPipelineInterface {
|
||||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &ClusterPipelineResource, ClusterPipelineGroupVersionKind, clusterPipelineFactory{})
|
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &ClusterPipelineResource, ClusterPipelineGroupVersionKind, clusterPipelineFactory{})
|
||||||
return &clusterPipelineClient{
|
return &clusterPipelineClient{
|
||||||
ns: namespace,
|
ns: namespace,
|
||||||
client: c,
|
client: c,
|
||||||
@ -639,7 +639,7 @@ type SourceCodeCredentialsGetter interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) SourceCodeCredentials(namespace string) SourceCodeCredentialInterface {
|
func (c *Client) SourceCodeCredentials(namespace string) SourceCodeCredentialInterface {
|
||||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &SourceCodeCredentialResource, SourceCodeCredentialGroupVersionKind, sourceCodeCredentialFactory{})
|
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &SourceCodeCredentialResource, SourceCodeCredentialGroupVersionKind, sourceCodeCredentialFactory{})
|
||||||
return &sourceCodeCredentialClient{
|
return &sourceCodeCredentialClient{
|
||||||
ns: namespace,
|
ns: namespace,
|
||||||
client: c,
|
client: c,
|
||||||
@ -652,7 +652,7 @@ type PipelinesGetter interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) Pipelines(namespace string) PipelineInterface {
|
func (c *Client) Pipelines(namespace string) PipelineInterface {
|
||||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &PipelineResource, PipelineGroupVersionKind, pipelineFactory{})
|
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &PipelineResource, PipelineGroupVersionKind, pipelineFactory{})
|
||||||
return &pipelineClient{
|
return &pipelineClient{
|
||||||
ns: namespace,
|
ns: namespace,
|
||||||
client: c,
|
client: c,
|
||||||
@ -665,7 +665,7 @@ type PipelineExecutionsGetter interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) PipelineExecutions(namespace string) PipelineExecutionInterface {
|
func (c *Client) PipelineExecutions(namespace string) PipelineExecutionInterface {
|
||||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &PipelineExecutionResource, PipelineExecutionGroupVersionKind, pipelineExecutionFactory{})
|
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &PipelineExecutionResource, PipelineExecutionGroupVersionKind, pipelineExecutionFactory{})
|
||||||
return &pipelineExecutionClient{
|
return &pipelineExecutionClient{
|
||||||
ns: namespace,
|
ns: namespace,
|
||||||
client: c,
|
client: c,
|
||||||
@ -678,7 +678,7 @@ type PipelineExecutionLogsGetter interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) PipelineExecutionLogs(namespace string) PipelineExecutionLogInterface {
|
func (c *Client) PipelineExecutionLogs(namespace string) PipelineExecutionLogInterface {
|
||||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &PipelineExecutionLogResource, PipelineExecutionLogGroupVersionKind, pipelineExecutionLogFactory{})
|
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &PipelineExecutionLogResource, PipelineExecutionLogGroupVersionKind, pipelineExecutionLogFactory{})
|
||||||
return &pipelineExecutionLogClient{
|
return &pipelineExecutionLogClient{
|
||||||
ns: namespace,
|
ns: namespace,
|
||||||
client: c,
|
client: c,
|
||||||
@ -691,7 +691,7 @@ type SourceCodeRepositoriesGetter interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) SourceCodeRepositories(namespace string) SourceCodeRepositoryInterface {
|
func (c *Client) SourceCodeRepositories(namespace string) SourceCodeRepositoryInterface {
|
||||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &SourceCodeRepositoryResource, SourceCodeRepositoryGroupVersionKind, sourceCodeRepositoryFactory{})
|
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &SourceCodeRepositoryResource, SourceCodeRepositoryGroupVersionKind, sourceCodeRepositoryFactory{})
|
||||||
return &sourceCodeRepositoryClient{
|
return &sourceCodeRepositoryClient{
|
||||||
ns: namespace,
|
ns: namespace,
|
||||||
client: c,
|
client: c,
|
||||||
@ -704,7 +704,7 @@ type GlobalComposeConfigsGetter interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) GlobalComposeConfigs(namespace string) GlobalComposeConfigInterface {
|
func (c *Client) GlobalComposeConfigs(namespace string) GlobalComposeConfigInterface {
|
||||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &GlobalComposeConfigResource, GlobalComposeConfigGroupVersionKind, globalComposeConfigFactory{})
|
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &GlobalComposeConfigResource, GlobalComposeConfigGroupVersionKind, globalComposeConfigFactory{})
|
||||||
return &globalComposeConfigClient{
|
return &globalComposeConfigClient{
|
||||||
ns: namespace,
|
ns: namespace,
|
||||||
client: c,
|
client: c,
|
||||||
@ -717,7 +717,7 @@ type ClusterComposeConfigsGetter interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) ClusterComposeConfigs(namespace string) ClusterComposeConfigInterface {
|
func (c *Client) ClusterComposeConfigs(namespace string) ClusterComposeConfigInterface {
|
||||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &ClusterComposeConfigResource, ClusterComposeConfigGroupVersionKind, clusterComposeConfigFactory{})
|
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &ClusterComposeConfigResource, ClusterComposeConfigGroupVersionKind, clusterComposeConfigFactory{})
|
||||||
return &clusterComposeConfigClient{
|
return &clusterComposeConfigClient{
|
||||||
ns: namespace,
|
ns: namespace,
|
||||||
client: c,
|
client: c,
|
||||||
|
@ -3,8 +3,8 @@ package v3
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/rancher/norman/clientbase"
|
|
||||||
"github.com/rancher/norman/controller"
|
"github.com/rancher/norman/controller"
|
||||||
|
"github.com/rancher/norman/objectclient"
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/labels"
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
@ -52,7 +52,7 @@ type ListenConfigController interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ListenConfigInterface interface {
|
type ListenConfigInterface interface {
|
||||||
ObjectClient() *clientbase.ObjectClient
|
ObjectClient() *objectclient.ObjectClient
|
||||||
Create(*ListenConfig) (*ListenConfig, error)
|
Create(*ListenConfig) (*ListenConfig, error)
|
||||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ListenConfig, error)
|
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ListenConfig, error)
|
||||||
Get(name string, opts metav1.GetOptions) (*ListenConfig, error)
|
Get(name string, opts metav1.GetOptions) (*ListenConfig, error)
|
||||||
@ -177,11 +177,11 @@ func (s *listenConfigClient) Controller() ListenConfigController {
|
|||||||
type listenConfigClient struct {
|
type listenConfigClient struct {
|
||||||
client *Client
|
client *Client
|
||||||
ns string
|
ns string
|
||||||
objectClient *clientbase.ObjectClient
|
objectClient *objectclient.ObjectClient
|
||||||
controller ListenConfigController
|
controller ListenConfigController
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *listenConfigClient) ObjectClient() *clientbase.ObjectClient {
|
func (s *listenConfigClient) ObjectClient() *objectclient.ObjectClient {
|
||||||
return s.objectClient
|
return s.objectClient
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ package v3
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/rancher/norman/clientbase"
|
|
||||||
"github.com/rancher/norman/controller"
|
"github.com/rancher/norman/controller"
|
||||||
|
"github.com/rancher/norman/objectclient"
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/labels"
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
@ -53,7 +53,7 @@ type NodeController interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type NodeInterface interface {
|
type NodeInterface interface {
|
||||||
ObjectClient() *clientbase.ObjectClient
|
ObjectClient() *objectclient.ObjectClient
|
||||||
Create(*Node) (*Node, error)
|
Create(*Node) (*Node, error)
|
||||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Node, error)
|
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Node, error)
|
||||||
Get(name string, opts metav1.GetOptions) (*Node, error)
|
Get(name string, opts metav1.GetOptions) (*Node, error)
|
||||||
@ -178,11 +178,11 @@ func (s *nodeClient) Controller() NodeController {
|
|||||||
type nodeClient struct {
|
type nodeClient struct {
|
||||||
client *Client
|
client *Client
|
||||||
ns string
|
ns string
|
||||||
objectClient *clientbase.ObjectClient
|
objectClient *objectclient.ObjectClient
|
||||||
controller NodeController
|
controller NodeController
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *nodeClient) ObjectClient() *clientbase.ObjectClient {
|
func (s *nodeClient) ObjectClient() *objectclient.ObjectClient {
|
||||||
return s.objectClient
|
return s.objectClient
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ package v3
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/rancher/norman/clientbase"
|
|
||||||
"github.com/rancher/norman/controller"
|
"github.com/rancher/norman/controller"
|
||||||
|
"github.com/rancher/norman/objectclient"
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/labels"
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
@ -52,7 +52,7 @@ type NodeDriverController interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type NodeDriverInterface interface {
|
type NodeDriverInterface interface {
|
||||||
ObjectClient() *clientbase.ObjectClient
|
ObjectClient() *objectclient.ObjectClient
|
||||||
Create(*NodeDriver) (*NodeDriver, error)
|
Create(*NodeDriver) (*NodeDriver, error)
|
||||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*NodeDriver, error)
|
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*NodeDriver, error)
|
||||||
Get(name string, opts metav1.GetOptions) (*NodeDriver, error)
|
Get(name string, opts metav1.GetOptions) (*NodeDriver, error)
|
||||||
@ -177,11 +177,11 @@ func (s *nodeDriverClient) Controller() NodeDriverController {
|
|||||||
type nodeDriverClient struct {
|
type nodeDriverClient struct {
|
||||||
client *Client
|
client *Client
|
||||||
ns string
|
ns string
|
||||||
objectClient *clientbase.ObjectClient
|
objectClient *objectclient.ObjectClient
|
||||||
controller NodeDriverController
|
controller NodeDriverController
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *nodeDriverClient) ObjectClient() *clientbase.ObjectClient {
|
func (s *nodeDriverClient) ObjectClient() *objectclient.ObjectClient {
|
||||||
return s.objectClient
|
return s.objectClient
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ package v3
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/rancher/norman/clientbase"
|
|
||||||
"github.com/rancher/norman/controller"
|
"github.com/rancher/norman/controller"
|
||||||
|
"github.com/rancher/norman/objectclient"
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/labels"
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
@ -53,7 +53,7 @@ type NodePoolController interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type NodePoolInterface interface {
|
type NodePoolInterface interface {
|
||||||
ObjectClient() *clientbase.ObjectClient
|
ObjectClient() *objectclient.ObjectClient
|
||||||
Create(*NodePool) (*NodePool, error)
|
Create(*NodePool) (*NodePool, error)
|
||||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*NodePool, error)
|
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*NodePool, error)
|
||||||
Get(name string, opts metav1.GetOptions) (*NodePool, error)
|
Get(name string, opts metav1.GetOptions) (*NodePool, error)
|
||||||
@ -178,11 +178,11 @@ func (s *nodePoolClient) Controller() NodePoolController {
|
|||||||
type nodePoolClient struct {
|
type nodePoolClient struct {
|
||||||
client *Client
|
client *Client
|
||||||
ns string
|
ns string
|
||||||
objectClient *clientbase.ObjectClient
|
objectClient *objectclient.ObjectClient
|
||||||
controller NodePoolController
|
controller NodePoolController
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *nodePoolClient) ObjectClient() *clientbase.ObjectClient {
|
func (s *nodePoolClient) ObjectClient() *objectclient.ObjectClient {
|
||||||
return s.objectClient
|
return s.objectClient
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ package v3
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/rancher/norman/clientbase"
|
|
||||||
"github.com/rancher/norman/controller"
|
"github.com/rancher/norman/controller"
|
||||||
|
"github.com/rancher/norman/objectclient"
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/labels"
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
@ -53,7 +53,7 @@ type NodeTemplateController interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type NodeTemplateInterface interface {
|
type NodeTemplateInterface interface {
|
||||||
ObjectClient() *clientbase.ObjectClient
|
ObjectClient() *objectclient.ObjectClient
|
||||||
Create(*NodeTemplate) (*NodeTemplate, error)
|
Create(*NodeTemplate) (*NodeTemplate, error)
|
||||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*NodeTemplate, error)
|
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*NodeTemplate, error)
|
||||||
Get(name string, opts metav1.GetOptions) (*NodeTemplate, error)
|
Get(name string, opts metav1.GetOptions) (*NodeTemplate, error)
|
||||||
@ -178,11 +178,11 @@ func (s *nodeTemplateClient) Controller() NodeTemplateController {
|
|||||||
type nodeTemplateClient struct {
|
type nodeTemplateClient struct {
|
||||||
client *Client
|
client *Client
|
||||||
ns string
|
ns string
|
||||||
objectClient *clientbase.ObjectClient
|
objectClient *objectclient.ObjectClient
|
||||||
controller NodeTemplateController
|
controller NodeTemplateController
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *nodeTemplateClient) ObjectClient() *clientbase.ObjectClient {
|
func (s *nodeTemplateClient) ObjectClient() *objectclient.ObjectClient {
|
||||||
return s.objectClient
|
return s.objectClient
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ package v3
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/rancher/norman/clientbase"
|
|
||||||
"github.com/rancher/norman/controller"
|
"github.com/rancher/norman/controller"
|
||||||
|
"github.com/rancher/norman/objectclient"
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/labels"
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
@ -53,7 +53,7 @@ type NotifierController interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type NotifierInterface interface {
|
type NotifierInterface interface {
|
||||||
ObjectClient() *clientbase.ObjectClient
|
ObjectClient() *objectclient.ObjectClient
|
||||||
Create(*Notifier) (*Notifier, error)
|
Create(*Notifier) (*Notifier, error)
|
||||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Notifier, error)
|
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Notifier, error)
|
||||||
Get(name string, opts metav1.GetOptions) (*Notifier, error)
|
Get(name string, opts metav1.GetOptions) (*Notifier, error)
|
||||||
@ -178,11 +178,11 @@ func (s *notifierClient) Controller() NotifierController {
|
|||||||
type notifierClient struct {
|
type notifierClient struct {
|
||||||
client *Client
|
client *Client
|
||||||
ns string
|
ns string
|
||||||
objectClient *clientbase.ObjectClient
|
objectClient *objectclient.ObjectClient
|
||||||
controller NotifierController
|
controller NotifierController
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *notifierClient) ObjectClient() *clientbase.ObjectClient {
|
func (s *notifierClient) ObjectClient() *objectclient.ObjectClient {
|
||||||
return s.objectClient
|
return s.objectClient
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ package v3
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/rancher/norman/clientbase"
|
|
||||||
"github.com/rancher/norman/controller"
|
"github.com/rancher/norman/controller"
|
||||||
|
"github.com/rancher/norman/objectclient"
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/labels"
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
@ -53,7 +53,7 @@ type PipelineController interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type PipelineInterface interface {
|
type PipelineInterface interface {
|
||||||
ObjectClient() *clientbase.ObjectClient
|
ObjectClient() *objectclient.ObjectClient
|
||||||
Create(*Pipeline) (*Pipeline, error)
|
Create(*Pipeline) (*Pipeline, error)
|
||||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Pipeline, error)
|
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Pipeline, error)
|
||||||
Get(name string, opts metav1.GetOptions) (*Pipeline, error)
|
Get(name string, opts metav1.GetOptions) (*Pipeline, error)
|
||||||
@ -178,11 +178,11 @@ func (s *pipelineClient) Controller() PipelineController {
|
|||||||
type pipelineClient struct {
|
type pipelineClient struct {
|
||||||
client *Client
|
client *Client
|
||||||
ns string
|
ns string
|
||||||
objectClient *clientbase.ObjectClient
|
objectClient *objectclient.ObjectClient
|
||||||
controller PipelineController
|
controller PipelineController
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *pipelineClient) ObjectClient() *clientbase.ObjectClient {
|
func (s *pipelineClient) ObjectClient() *objectclient.ObjectClient {
|
||||||
return s.objectClient
|
return s.objectClient
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ package v3
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/rancher/norman/clientbase"
|
|
||||||
"github.com/rancher/norman/controller"
|
"github.com/rancher/norman/controller"
|
||||||
|
"github.com/rancher/norman/objectclient"
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/labels"
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
@ -53,7 +53,7 @@ type PipelineExecutionController interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type PipelineExecutionInterface interface {
|
type PipelineExecutionInterface interface {
|
||||||
ObjectClient() *clientbase.ObjectClient
|
ObjectClient() *objectclient.ObjectClient
|
||||||
Create(*PipelineExecution) (*PipelineExecution, error)
|
Create(*PipelineExecution) (*PipelineExecution, error)
|
||||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*PipelineExecution, error)
|
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*PipelineExecution, error)
|
||||||
Get(name string, opts metav1.GetOptions) (*PipelineExecution, error)
|
Get(name string, opts metav1.GetOptions) (*PipelineExecution, error)
|
||||||
@ -178,11 +178,11 @@ func (s *pipelineExecutionClient) Controller() PipelineExecutionController {
|
|||||||
type pipelineExecutionClient struct {
|
type pipelineExecutionClient struct {
|
||||||
client *Client
|
client *Client
|
||||||
ns string
|
ns string
|
||||||
objectClient *clientbase.ObjectClient
|
objectClient *objectclient.ObjectClient
|
||||||
controller PipelineExecutionController
|
controller PipelineExecutionController
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *pipelineExecutionClient) ObjectClient() *clientbase.ObjectClient {
|
func (s *pipelineExecutionClient) ObjectClient() *objectclient.ObjectClient {
|
||||||
return s.objectClient
|
return s.objectClient
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ package v3
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/rancher/norman/clientbase"
|
|
||||||
"github.com/rancher/norman/controller"
|
"github.com/rancher/norman/controller"
|
||||||
|
"github.com/rancher/norman/objectclient"
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/labels"
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
@ -53,7 +53,7 @@ type PipelineExecutionLogController interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type PipelineExecutionLogInterface interface {
|
type PipelineExecutionLogInterface interface {
|
||||||
ObjectClient() *clientbase.ObjectClient
|
ObjectClient() *objectclient.ObjectClient
|
||||||
Create(*PipelineExecutionLog) (*PipelineExecutionLog, error)
|
Create(*PipelineExecutionLog) (*PipelineExecutionLog, error)
|
||||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*PipelineExecutionLog, error)
|
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*PipelineExecutionLog, error)
|
||||||
Get(name string, opts metav1.GetOptions) (*PipelineExecutionLog, error)
|
Get(name string, opts metav1.GetOptions) (*PipelineExecutionLog, error)
|
||||||
@ -178,11 +178,11 @@ func (s *pipelineExecutionLogClient) Controller() PipelineExecutionLogController
|
|||||||
type pipelineExecutionLogClient struct {
|
type pipelineExecutionLogClient struct {
|
||||||
client *Client
|
client *Client
|
||||||
ns string
|
ns string
|
||||||
objectClient *clientbase.ObjectClient
|
objectClient *objectclient.ObjectClient
|
||||||
controller PipelineExecutionLogController
|
controller PipelineExecutionLogController
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *pipelineExecutionLogClient) ObjectClient() *clientbase.ObjectClient {
|
func (s *pipelineExecutionLogClient) ObjectClient() *objectclient.ObjectClient {
|
||||||
return s.objectClient
|
return s.objectClient
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ package v3
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/rancher/norman/clientbase"
|
|
||||||
"github.com/rancher/norman/controller"
|
"github.com/rancher/norman/controller"
|
||||||
|
"github.com/rancher/norman/objectclient"
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/labels"
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
@ -52,7 +52,7 @@ type PodSecurityPolicyTemplateController interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type PodSecurityPolicyTemplateInterface interface {
|
type PodSecurityPolicyTemplateInterface interface {
|
||||||
ObjectClient() *clientbase.ObjectClient
|
ObjectClient() *objectclient.ObjectClient
|
||||||
Create(*PodSecurityPolicyTemplate) (*PodSecurityPolicyTemplate, error)
|
Create(*PodSecurityPolicyTemplate) (*PodSecurityPolicyTemplate, error)
|
||||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*PodSecurityPolicyTemplate, error)
|
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*PodSecurityPolicyTemplate, error)
|
||||||
Get(name string, opts metav1.GetOptions) (*PodSecurityPolicyTemplate, error)
|
Get(name string, opts metav1.GetOptions) (*PodSecurityPolicyTemplate, error)
|
||||||
@ -177,11 +177,11 @@ func (s *podSecurityPolicyTemplateClient) Controller() PodSecurityPolicyTemplate
|
|||||||
type podSecurityPolicyTemplateClient struct {
|
type podSecurityPolicyTemplateClient struct {
|
||||||
client *Client
|
client *Client
|
||||||
ns string
|
ns string
|
||||||
objectClient *clientbase.ObjectClient
|
objectClient *objectclient.ObjectClient
|
||||||
controller PodSecurityPolicyTemplateController
|
controller PodSecurityPolicyTemplateController
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *podSecurityPolicyTemplateClient) ObjectClient() *clientbase.ObjectClient {
|
func (s *podSecurityPolicyTemplateClient) ObjectClient() *objectclient.ObjectClient {
|
||||||
return s.objectClient
|
return s.objectClient
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ package v3
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/rancher/norman/clientbase"
|
|
||||||
"github.com/rancher/norman/controller"
|
"github.com/rancher/norman/controller"
|
||||||
|
"github.com/rancher/norman/objectclient"
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/labels"
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
@ -53,7 +53,7 @@ type PodSecurityPolicyTemplateProjectBindingController interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type PodSecurityPolicyTemplateProjectBindingInterface interface {
|
type PodSecurityPolicyTemplateProjectBindingInterface interface {
|
||||||
ObjectClient() *clientbase.ObjectClient
|
ObjectClient() *objectclient.ObjectClient
|
||||||
Create(*PodSecurityPolicyTemplateProjectBinding) (*PodSecurityPolicyTemplateProjectBinding, error)
|
Create(*PodSecurityPolicyTemplateProjectBinding) (*PodSecurityPolicyTemplateProjectBinding, error)
|
||||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*PodSecurityPolicyTemplateProjectBinding, error)
|
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*PodSecurityPolicyTemplateProjectBinding, error)
|
||||||
Get(name string, opts metav1.GetOptions) (*PodSecurityPolicyTemplateProjectBinding, error)
|
Get(name string, opts metav1.GetOptions) (*PodSecurityPolicyTemplateProjectBinding, error)
|
||||||
@ -178,11 +178,11 @@ func (s *podSecurityPolicyTemplateProjectBindingClient) Controller() PodSecurity
|
|||||||
type podSecurityPolicyTemplateProjectBindingClient struct {
|
type podSecurityPolicyTemplateProjectBindingClient struct {
|
||||||
client *Client
|
client *Client
|
||||||
ns string
|
ns string
|
||||||
objectClient *clientbase.ObjectClient
|
objectClient *objectclient.ObjectClient
|
||||||
controller PodSecurityPolicyTemplateProjectBindingController
|
controller PodSecurityPolicyTemplateProjectBindingController
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *podSecurityPolicyTemplateProjectBindingClient) ObjectClient() *clientbase.ObjectClient {
|
func (s *podSecurityPolicyTemplateProjectBindingClient) ObjectClient() *objectclient.ObjectClient {
|
||||||
return s.objectClient
|
return s.objectClient
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ package v3
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/rancher/norman/clientbase"
|
|
||||||
"github.com/rancher/norman/controller"
|
"github.com/rancher/norman/controller"
|
||||||
|
"github.com/rancher/norman/objectclient"
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/labels"
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
@ -53,7 +53,7 @@ type PreferenceController interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type PreferenceInterface interface {
|
type PreferenceInterface interface {
|
||||||
ObjectClient() *clientbase.ObjectClient
|
ObjectClient() *objectclient.ObjectClient
|
||||||
Create(*Preference) (*Preference, error)
|
Create(*Preference) (*Preference, error)
|
||||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Preference, error)
|
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Preference, error)
|
||||||
Get(name string, opts metav1.GetOptions) (*Preference, error)
|
Get(name string, opts metav1.GetOptions) (*Preference, error)
|
||||||
@ -178,11 +178,11 @@ func (s *preferenceClient) Controller() PreferenceController {
|
|||||||
type preferenceClient struct {
|
type preferenceClient struct {
|
||||||
client *Client
|
client *Client
|
||||||
ns string
|
ns string
|
||||||
objectClient *clientbase.ObjectClient
|
objectClient *objectclient.ObjectClient
|
||||||
controller PreferenceController
|
controller PreferenceController
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *preferenceClient) ObjectClient() *clientbase.ObjectClient {
|
func (s *preferenceClient) ObjectClient() *objectclient.ObjectClient {
|
||||||
return s.objectClient
|
return s.objectClient
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ package v3
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/rancher/norman/clientbase"
|
|
||||||
"github.com/rancher/norman/controller"
|
"github.com/rancher/norman/controller"
|
||||||
|
"github.com/rancher/norman/objectclient"
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/labels"
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
@ -52,7 +52,7 @@ type PrincipalController interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type PrincipalInterface interface {
|
type PrincipalInterface interface {
|
||||||
ObjectClient() *clientbase.ObjectClient
|
ObjectClient() *objectclient.ObjectClient
|
||||||
Create(*Principal) (*Principal, error)
|
Create(*Principal) (*Principal, error)
|
||||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Principal, error)
|
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Principal, error)
|
||||||
Get(name string, opts metav1.GetOptions) (*Principal, error)
|
Get(name string, opts metav1.GetOptions) (*Principal, error)
|
||||||
@ -177,11 +177,11 @@ func (s *principalClient) Controller() PrincipalController {
|
|||||||
type principalClient struct {
|
type principalClient struct {
|
||||||
client *Client
|
client *Client
|
||||||
ns string
|
ns string
|
||||||
objectClient *clientbase.ObjectClient
|
objectClient *objectclient.ObjectClient
|
||||||
controller PrincipalController
|
controller PrincipalController
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *principalClient) ObjectClient() *clientbase.ObjectClient {
|
func (s *principalClient) ObjectClient() *objectclient.ObjectClient {
|
||||||
return s.objectClient
|
return s.objectClient
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ package v3
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/rancher/norman/clientbase"
|
|
||||||
"github.com/rancher/norman/controller"
|
"github.com/rancher/norman/controller"
|
||||||
|
"github.com/rancher/norman/objectclient"
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/labels"
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
@ -53,7 +53,7 @@ type ProjectAlertController interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ProjectAlertInterface interface {
|
type ProjectAlertInterface interface {
|
||||||
ObjectClient() *clientbase.ObjectClient
|
ObjectClient() *objectclient.ObjectClient
|
||||||
Create(*ProjectAlert) (*ProjectAlert, error)
|
Create(*ProjectAlert) (*ProjectAlert, error)
|
||||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ProjectAlert, error)
|
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ProjectAlert, error)
|
||||||
Get(name string, opts metav1.GetOptions) (*ProjectAlert, error)
|
Get(name string, opts metav1.GetOptions) (*ProjectAlert, error)
|
||||||
@ -178,11 +178,11 @@ func (s *projectAlertClient) Controller() ProjectAlertController {
|
|||||||
type projectAlertClient struct {
|
type projectAlertClient struct {
|
||||||
client *Client
|
client *Client
|
||||||
ns string
|
ns string
|
||||||
objectClient *clientbase.ObjectClient
|
objectClient *objectclient.ObjectClient
|
||||||
controller ProjectAlertController
|
controller ProjectAlertController
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *projectAlertClient) ObjectClient() *clientbase.ObjectClient {
|
func (s *projectAlertClient) ObjectClient() *objectclient.ObjectClient {
|
||||||
return s.objectClient
|
return s.objectClient
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ package v3
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/rancher/norman/clientbase"
|
|
||||||
"github.com/rancher/norman/controller"
|
"github.com/rancher/norman/controller"
|
||||||
|
"github.com/rancher/norman/objectclient"
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/labels"
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
@ -53,7 +53,7 @@ type ProjectController interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ProjectInterface interface {
|
type ProjectInterface interface {
|
||||||
ObjectClient() *clientbase.ObjectClient
|
ObjectClient() *objectclient.ObjectClient
|
||||||
Create(*Project) (*Project, error)
|
Create(*Project) (*Project, error)
|
||||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Project, error)
|
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Project, error)
|
||||||
Get(name string, opts metav1.GetOptions) (*Project, error)
|
Get(name string, opts metav1.GetOptions) (*Project, error)
|
||||||
@ -178,11 +178,11 @@ func (s *projectClient) Controller() ProjectController {
|
|||||||
type projectClient struct {
|
type projectClient struct {
|
||||||
client *Client
|
client *Client
|
||||||
ns string
|
ns string
|
||||||
objectClient *clientbase.ObjectClient
|
objectClient *objectclient.ObjectClient
|
||||||
controller ProjectController
|
controller ProjectController
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *projectClient) ObjectClient() *clientbase.ObjectClient {
|
func (s *projectClient) ObjectClient() *objectclient.ObjectClient {
|
||||||
return s.objectClient
|
return s.objectClient
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ package v3
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/rancher/norman/clientbase"
|
|
||||||
"github.com/rancher/norman/controller"
|
"github.com/rancher/norman/controller"
|
||||||
|
"github.com/rancher/norman/objectclient"
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/labels"
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
@ -53,7 +53,7 @@ type ProjectLoggingController interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ProjectLoggingInterface interface {
|
type ProjectLoggingInterface interface {
|
||||||
ObjectClient() *clientbase.ObjectClient
|
ObjectClient() *objectclient.ObjectClient
|
||||||
Create(*ProjectLogging) (*ProjectLogging, error)
|
Create(*ProjectLogging) (*ProjectLogging, error)
|
||||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ProjectLogging, error)
|
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ProjectLogging, error)
|
||||||
Get(name string, opts metav1.GetOptions) (*ProjectLogging, error)
|
Get(name string, opts metav1.GetOptions) (*ProjectLogging, error)
|
||||||
@ -178,11 +178,11 @@ func (s *projectLoggingClient) Controller() ProjectLoggingController {
|
|||||||
type projectLoggingClient struct {
|
type projectLoggingClient struct {
|
||||||
client *Client
|
client *Client
|
||||||
ns string
|
ns string
|
||||||
objectClient *clientbase.ObjectClient
|
objectClient *objectclient.ObjectClient
|
||||||
controller ProjectLoggingController
|
controller ProjectLoggingController
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *projectLoggingClient) ObjectClient() *clientbase.ObjectClient {
|
func (s *projectLoggingClient) ObjectClient() *objectclient.ObjectClient {
|
||||||
return s.objectClient
|
return s.objectClient
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ package v3
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/rancher/norman/clientbase"
|
|
||||||
"github.com/rancher/norman/controller"
|
"github.com/rancher/norman/controller"
|
||||||
|
"github.com/rancher/norman/objectclient"
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/labels"
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
@ -53,7 +53,7 @@ type ProjectNetworkPolicyController interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ProjectNetworkPolicyInterface interface {
|
type ProjectNetworkPolicyInterface interface {
|
||||||
ObjectClient() *clientbase.ObjectClient
|
ObjectClient() *objectclient.ObjectClient
|
||||||
Create(*ProjectNetworkPolicy) (*ProjectNetworkPolicy, error)
|
Create(*ProjectNetworkPolicy) (*ProjectNetworkPolicy, error)
|
||||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ProjectNetworkPolicy, error)
|
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ProjectNetworkPolicy, error)
|
||||||
Get(name string, opts metav1.GetOptions) (*ProjectNetworkPolicy, error)
|
Get(name string, opts metav1.GetOptions) (*ProjectNetworkPolicy, error)
|
||||||
@ -178,11 +178,11 @@ func (s *projectNetworkPolicyClient) Controller() ProjectNetworkPolicyController
|
|||||||
type projectNetworkPolicyClient struct {
|
type projectNetworkPolicyClient struct {
|
||||||
client *Client
|
client *Client
|
||||||
ns string
|
ns string
|
||||||
objectClient *clientbase.ObjectClient
|
objectClient *objectclient.ObjectClient
|
||||||
controller ProjectNetworkPolicyController
|
controller ProjectNetworkPolicyController
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *projectNetworkPolicyClient) ObjectClient() *clientbase.ObjectClient {
|
func (s *projectNetworkPolicyClient) ObjectClient() *objectclient.ObjectClient {
|
||||||
return s.objectClient
|
return s.objectClient
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ package v3
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/rancher/norman/clientbase"
|
|
||||||
"github.com/rancher/norman/controller"
|
"github.com/rancher/norman/controller"
|
||||||
|
"github.com/rancher/norman/objectclient"
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/labels"
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
@ -53,7 +53,7 @@ type ProjectRoleTemplateBindingController interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ProjectRoleTemplateBindingInterface interface {
|
type ProjectRoleTemplateBindingInterface interface {
|
||||||
ObjectClient() *clientbase.ObjectClient
|
ObjectClient() *objectclient.ObjectClient
|
||||||
Create(*ProjectRoleTemplateBinding) (*ProjectRoleTemplateBinding, error)
|
Create(*ProjectRoleTemplateBinding) (*ProjectRoleTemplateBinding, error)
|
||||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ProjectRoleTemplateBinding, error)
|
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ProjectRoleTemplateBinding, error)
|
||||||
Get(name string, opts metav1.GetOptions) (*ProjectRoleTemplateBinding, error)
|
Get(name string, opts metav1.GetOptions) (*ProjectRoleTemplateBinding, error)
|
||||||
@ -178,11 +178,11 @@ func (s *projectRoleTemplateBindingClient) Controller() ProjectRoleTemplateBindi
|
|||||||
type projectRoleTemplateBindingClient struct {
|
type projectRoleTemplateBindingClient struct {
|
||||||
client *Client
|
client *Client
|
||||||
ns string
|
ns string
|
||||||
objectClient *clientbase.ObjectClient
|
objectClient *objectclient.ObjectClient
|
||||||
controller ProjectRoleTemplateBindingController
|
controller ProjectRoleTemplateBindingController
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *projectRoleTemplateBindingClient) ObjectClient() *clientbase.ObjectClient {
|
func (s *projectRoleTemplateBindingClient) ObjectClient() *objectclient.ObjectClient {
|
||||||
return s.objectClient
|
return s.objectClient
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ package v3
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/rancher/norman/clientbase"
|
|
||||||
"github.com/rancher/norman/controller"
|
"github.com/rancher/norman/controller"
|
||||||
|
"github.com/rancher/norman/objectclient"
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/labels"
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
@ -52,7 +52,7 @@ type RoleTemplateController interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type RoleTemplateInterface interface {
|
type RoleTemplateInterface interface {
|
||||||
ObjectClient() *clientbase.ObjectClient
|
ObjectClient() *objectclient.ObjectClient
|
||||||
Create(*RoleTemplate) (*RoleTemplate, error)
|
Create(*RoleTemplate) (*RoleTemplate, error)
|
||||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*RoleTemplate, error)
|
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*RoleTemplate, error)
|
||||||
Get(name string, opts metav1.GetOptions) (*RoleTemplate, error)
|
Get(name string, opts metav1.GetOptions) (*RoleTemplate, error)
|
||||||
@ -177,11 +177,11 @@ func (s *roleTemplateClient) Controller() RoleTemplateController {
|
|||||||
type roleTemplateClient struct {
|
type roleTemplateClient struct {
|
||||||
client *Client
|
client *Client
|
||||||
ns string
|
ns string
|
||||||
objectClient *clientbase.ObjectClient
|
objectClient *objectclient.ObjectClient
|
||||||
controller RoleTemplateController
|
controller RoleTemplateController
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *roleTemplateClient) ObjectClient() *clientbase.ObjectClient {
|
func (s *roleTemplateClient) ObjectClient() *objectclient.ObjectClient {
|
||||||
return s.objectClient
|
return s.objectClient
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ package v3
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/rancher/norman/clientbase"
|
|
||||||
"github.com/rancher/norman/controller"
|
"github.com/rancher/norman/controller"
|
||||||
|
"github.com/rancher/norman/objectclient"
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/labels"
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
@ -52,7 +52,7 @@ type SettingController interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type SettingInterface interface {
|
type SettingInterface interface {
|
||||||
ObjectClient() *clientbase.ObjectClient
|
ObjectClient() *objectclient.ObjectClient
|
||||||
Create(*Setting) (*Setting, error)
|
Create(*Setting) (*Setting, error)
|
||||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Setting, error)
|
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Setting, error)
|
||||||
Get(name string, opts metav1.GetOptions) (*Setting, error)
|
Get(name string, opts metav1.GetOptions) (*Setting, error)
|
||||||
@ -177,11 +177,11 @@ func (s *settingClient) Controller() SettingController {
|
|||||||
type settingClient struct {
|
type settingClient struct {
|
||||||
client *Client
|
client *Client
|
||||||
ns string
|
ns string
|
||||||
objectClient *clientbase.ObjectClient
|
objectClient *objectclient.ObjectClient
|
||||||
controller SettingController
|
controller SettingController
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *settingClient) ObjectClient() *clientbase.ObjectClient {
|
func (s *settingClient) ObjectClient() *objectclient.ObjectClient {
|
||||||
return s.objectClient
|
return s.objectClient
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ package v3
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/rancher/norman/clientbase"
|
|
||||||
"github.com/rancher/norman/controller"
|
"github.com/rancher/norman/controller"
|
||||||
|
"github.com/rancher/norman/objectclient"
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/labels"
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
@ -53,7 +53,7 @@ type SourceCodeCredentialController interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type SourceCodeCredentialInterface interface {
|
type SourceCodeCredentialInterface interface {
|
||||||
ObjectClient() *clientbase.ObjectClient
|
ObjectClient() *objectclient.ObjectClient
|
||||||
Create(*SourceCodeCredential) (*SourceCodeCredential, error)
|
Create(*SourceCodeCredential) (*SourceCodeCredential, error)
|
||||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*SourceCodeCredential, error)
|
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*SourceCodeCredential, error)
|
||||||
Get(name string, opts metav1.GetOptions) (*SourceCodeCredential, error)
|
Get(name string, opts metav1.GetOptions) (*SourceCodeCredential, error)
|
||||||
@ -178,11 +178,11 @@ func (s *sourceCodeCredentialClient) Controller() SourceCodeCredentialController
|
|||||||
type sourceCodeCredentialClient struct {
|
type sourceCodeCredentialClient struct {
|
||||||
client *Client
|
client *Client
|
||||||
ns string
|
ns string
|
||||||
objectClient *clientbase.ObjectClient
|
objectClient *objectclient.ObjectClient
|
||||||
controller SourceCodeCredentialController
|
controller SourceCodeCredentialController
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *sourceCodeCredentialClient) ObjectClient() *clientbase.ObjectClient {
|
func (s *sourceCodeCredentialClient) ObjectClient() *objectclient.ObjectClient {
|
||||||
return s.objectClient
|
return s.objectClient
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ package v3
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/rancher/norman/clientbase"
|
|
||||||
"github.com/rancher/norman/controller"
|
"github.com/rancher/norman/controller"
|
||||||
|
"github.com/rancher/norman/objectclient"
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/labels"
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
@ -53,7 +53,7 @@ type SourceCodeRepositoryController interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type SourceCodeRepositoryInterface interface {
|
type SourceCodeRepositoryInterface interface {
|
||||||
ObjectClient() *clientbase.ObjectClient
|
ObjectClient() *objectclient.ObjectClient
|
||||||
Create(*SourceCodeRepository) (*SourceCodeRepository, error)
|
Create(*SourceCodeRepository) (*SourceCodeRepository, error)
|
||||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*SourceCodeRepository, error)
|
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*SourceCodeRepository, error)
|
||||||
Get(name string, opts metav1.GetOptions) (*SourceCodeRepository, error)
|
Get(name string, opts metav1.GetOptions) (*SourceCodeRepository, error)
|
||||||
@ -178,11 +178,11 @@ func (s *sourceCodeRepositoryClient) Controller() SourceCodeRepositoryController
|
|||||||
type sourceCodeRepositoryClient struct {
|
type sourceCodeRepositoryClient struct {
|
||||||
client *Client
|
client *Client
|
||||||
ns string
|
ns string
|
||||||
objectClient *clientbase.ObjectClient
|
objectClient *objectclient.ObjectClient
|
||||||
controller SourceCodeRepositoryController
|
controller SourceCodeRepositoryController
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *sourceCodeRepositoryClient) ObjectClient() *clientbase.ObjectClient {
|
func (s *sourceCodeRepositoryClient) ObjectClient() *objectclient.ObjectClient {
|
||||||
return s.objectClient
|
return s.objectClient
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ package v3
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/rancher/norman/clientbase"
|
|
||||||
"github.com/rancher/norman/controller"
|
"github.com/rancher/norman/controller"
|
||||||
|
"github.com/rancher/norman/objectclient"
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/labels"
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
@ -52,7 +52,7 @@ type TemplateController interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type TemplateInterface interface {
|
type TemplateInterface interface {
|
||||||
ObjectClient() *clientbase.ObjectClient
|
ObjectClient() *objectclient.ObjectClient
|
||||||
Create(*Template) (*Template, error)
|
Create(*Template) (*Template, error)
|
||||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Template, error)
|
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Template, error)
|
||||||
Get(name string, opts metav1.GetOptions) (*Template, error)
|
Get(name string, opts metav1.GetOptions) (*Template, error)
|
||||||
@ -177,11 +177,11 @@ func (s *templateClient) Controller() TemplateController {
|
|||||||
type templateClient struct {
|
type templateClient struct {
|
||||||
client *Client
|
client *Client
|
||||||
ns string
|
ns string
|
||||||
objectClient *clientbase.ObjectClient
|
objectClient *objectclient.ObjectClient
|
||||||
controller TemplateController
|
controller TemplateController
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *templateClient) ObjectClient() *clientbase.ObjectClient {
|
func (s *templateClient) ObjectClient() *objectclient.ObjectClient {
|
||||||
return s.objectClient
|
return s.objectClient
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ package v3
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/rancher/norman/clientbase"
|
|
||||||
"github.com/rancher/norman/controller"
|
"github.com/rancher/norman/controller"
|
||||||
|
"github.com/rancher/norman/objectclient"
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/labels"
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
@ -52,7 +52,7 @@ type TemplateVersionController interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type TemplateVersionInterface interface {
|
type TemplateVersionInterface interface {
|
||||||
ObjectClient() *clientbase.ObjectClient
|
ObjectClient() *objectclient.ObjectClient
|
||||||
Create(*TemplateVersion) (*TemplateVersion, error)
|
Create(*TemplateVersion) (*TemplateVersion, error)
|
||||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*TemplateVersion, error)
|
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*TemplateVersion, error)
|
||||||
Get(name string, opts metav1.GetOptions) (*TemplateVersion, error)
|
Get(name string, opts metav1.GetOptions) (*TemplateVersion, error)
|
||||||
@ -177,11 +177,11 @@ func (s *templateVersionClient) Controller() TemplateVersionController {
|
|||||||
type templateVersionClient struct {
|
type templateVersionClient struct {
|
||||||
client *Client
|
client *Client
|
||||||
ns string
|
ns string
|
||||||
objectClient *clientbase.ObjectClient
|
objectClient *objectclient.ObjectClient
|
||||||
controller TemplateVersionController
|
controller TemplateVersionController
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *templateVersionClient) ObjectClient() *clientbase.ObjectClient {
|
func (s *templateVersionClient) ObjectClient() *objectclient.ObjectClient {
|
||||||
return s.objectClient
|
return s.objectClient
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ package v3
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/rancher/norman/clientbase"
|
|
||||||
"github.com/rancher/norman/controller"
|
"github.com/rancher/norman/controller"
|
||||||
|
"github.com/rancher/norman/objectclient"
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/labels"
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
@ -52,7 +52,7 @@ type TokenController interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type TokenInterface interface {
|
type TokenInterface interface {
|
||||||
ObjectClient() *clientbase.ObjectClient
|
ObjectClient() *objectclient.ObjectClient
|
||||||
Create(*Token) (*Token, error)
|
Create(*Token) (*Token, error)
|
||||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Token, error)
|
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Token, error)
|
||||||
Get(name string, opts metav1.GetOptions) (*Token, error)
|
Get(name string, opts metav1.GetOptions) (*Token, error)
|
||||||
@ -177,11 +177,11 @@ func (s *tokenClient) Controller() TokenController {
|
|||||||
type tokenClient struct {
|
type tokenClient struct {
|
||||||
client *Client
|
client *Client
|
||||||
ns string
|
ns string
|
||||||
objectClient *clientbase.ObjectClient
|
objectClient *objectclient.ObjectClient
|
||||||
controller TokenController
|
controller TokenController
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *tokenClient) ObjectClient() *clientbase.ObjectClient {
|
func (s *tokenClient) ObjectClient() *objectclient.ObjectClient {
|
||||||
return s.objectClient
|
return s.objectClient
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ package v3
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/rancher/norman/clientbase"
|
|
||||||
"github.com/rancher/norman/controller"
|
"github.com/rancher/norman/controller"
|
||||||
|
"github.com/rancher/norman/objectclient"
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/labels"
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
@ -52,7 +52,7 @@ type UserController interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type UserInterface interface {
|
type UserInterface interface {
|
||||||
ObjectClient() *clientbase.ObjectClient
|
ObjectClient() *objectclient.ObjectClient
|
||||||
Create(*User) (*User, error)
|
Create(*User) (*User, error)
|
||||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*User, error)
|
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*User, error)
|
||||||
Get(name string, opts metav1.GetOptions) (*User, error)
|
Get(name string, opts metav1.GetOptions) (*User, error)
|
||||||
@ -177,11 +177,11 @@ func (s *userClient) Controller() UserController {
|
|||||||
type userClient struct {
|
type userClient struct {
|
||||||
client *Client
|
client *Client
|
||||||
ns string
|
ns string
|
||||||
objectClient *clientbase.ObjectClient
|
objectClient *objectclient.ObjectClient
|
||||||
controller UserController
|
controller UserController
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *userClient) ObjectClient() *clientbase.ObjectClient {
|
func (s *userClient) ObjectClient() *objectclient.ObjectClient {
|
||||||
return s.objectClient
|
return s.objectClient
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
vendor/github.com/rancher/types/vendor.conf
generated
vendored
2
vendor/github.com/rancher/types/vendor.conf
generated
vendored
@ -5,4 +5,4 @@ k8s.io/kubernetes v1.8.3
|
|||||||
bitbucket.org/ww/goautoneg a547fc61f48d567d5b4ec6f8aee5573d8efce11d https://github.com/rancher/goautoneg.git
|
bitbucket.org/ww/goautoneg a547fc61f48d567d5b4ec6f8aee5573d8efce11d https://github.com/rancher/goautoneg.git
|
||||||
golang.org/x/sync fd80eb99c8f653c847d294a001bdf2a3a6f768f5
|
golang.org/x/sync fd80eb99c8f653c847d294a001bdf2a3a6f768f5
|
||||||
|
|
||||||
github.com/rancher/norman 510ed570d2e29a00e6bc1bcd18bdcad6c6860a13
|
github.com/rancher/norman ff60298f31f081b06d198815b4c178a578664f7d
|
||||||
|
Loading…
Reference in New Issue
Block a user