From f5bf069e1b232bf72e6f6a219c9d2e6b3e74f548 Mon Sep 17 00:00:00 2001 From: Matt Moore Date: Tue, 17 Aug 2021 13:32:52 -0700 Subject: [PATCH] Rework the way eventing-rabbitmq does Rabbit codegen Today we rerun codegen for the Rabbit clients to get injection, but because they use kubebuilder their layout is a bit strange. There's a hack to temporarily copy the api types into the right structure, and then undo it, which is a bit fragile (if codegen references that package, then it won't build!). We also try to contort so that we can use their existing client/informer/lister codegen, which isn't really necessary. With this change, we instead permanently copy the types into a suitable structure under `third_party/pkg/apis` and generate all of the clients we need under `third_party/pkg/client`. This is a slight superset of what Istio and Contour are already doing (we don't need to copy those types), and feels a bit simpler (and less fragile) than what we are currently doing. /kind cleanup --- go.mod | 1 + hack/update-codegen.sh | 39 +- hack/update-deps.sh | 4 +- pkg/reconciler/broker/broker.go | 6 +- pkg/reconciler/broker/broker_test.go | 4 +- pkg/reconciler/broker/controller.go | 8 +- pkg/reconciler/broker/controller_test.go | 8 +- pkg/reconciler/broker/resources/exchange.go | 2 +- .../broker/resources/exchange_test.go | 2 +- pkg/reconciler/testing/factory.go | 2 +- pkg/reconciler/testing/listers.go | 6 +- pkg/reconciler/trigger/controller.go | 8 +- pkg/reconciler/trigger/controller_test.go | 8 +- pkg/reconciler/trigger/resources/binding.go | 2 +- .../trigger/resources/binding_test.go | 2 +- pkg/reconciler/trigger/resources/queue.go | 2 +- .../trigger/resources/queue_test.go | 2 +- pkg/reconciler/trigger/trigger.go | 6 +- pkg/reconciler/trigger/trigger_test.go | 4 +- .../triggerstandalone/controller_test.go | 6 +- .../rabbitmq.com/v1beta1/binding_types.go | 81 ++ .../apis/rabbitmq.com/v1beta1/conditions.go | 44 + .../rabbitmq.com/v1beta1/exchange_types.go | 79 ++ .../rabbitmq.com/v1beta1/groupversion_info.go | 45 + .../rabbitmq.com/v1beta1/permission_types.go | 77 ++ .../apis/rabbitmq.com/v1beta1/policy_types.go | 81 ++ .../apis/rabbitmq.com/v1beta1/queue_types.go | 90 ++ .../v1beta1/schemareplication_types.go | 71 ++ .../apis/rabbitmq.com/v1beta1/user_types.go | 89 ++ .../apis/rabbitmq.com/v1beta1/vhost_types.go | 69 ++ .../v1beta1/zz_generated.deepcopy.go | 882 ++++++++++++++++++ .../client/clientset/versioned/clientset.go | 96 ++ .../pkg/client/clientset/versioned/doc.go | 19 + .../versioned/fake/clientset_generated.go | 81 ++ .../client/clientset/versioned/fake/doc.go | 19 + .../clientset/versioned/fake/register.go | 55 ++ .../client/clientset/versioned/scheme/doc.go | 19 + .../clientset/versioned/scheme/register.go | 55 ++ .../typed/rabbitmq.com/v1beta1/binding.go | 194 ++++ .../typed/rabbitmq.com/v1beta1/doc.go | 19 + .../typed/rabbitmq.com/v1beta1/exchange.go | 194 ++++ .../typed/rabbitmq.com/v1beta1/fake/doc.go | 19 + .../rabbitmq.com/v1beta1/fake/fake_binding.go | 141 +++ .../v1beta1/fake/fake_exchange.go | 141 +++ .../v1beta1/fake/fake_permission.go | 141 +++ .../rabbitmq.com/v1beta1/fake/fake_policy.go | 141 +++ .../rabbitmq.com/v1beta1/fake/fake_queue.go | 141 +++ .../v1beta1/fake/fake_rabbitmq.com_client.go | 67 ++ .../v1beta1/fake/fake_schemareplication.go | 141 +++ .../rabbitmq.com/v1beta1/fake/fake_user.go | 141 +++ .../rabbitmq.com/v1beta1/fake/fake_vhost.go | 141 +++ .../v1beta1/generated_expansion.go | 34 + .../typed/rabbitmq.com/v1beta1/permission.go | 194 ++++ .../typed/rabbitmq.com/v1beta1/policy.go | 194 ++++ .../typed/rabbitmq.com/v1beta1/queue.go | 194 ++++ .../v1beta1/rabbitmq.com_client.go | 123 +++ .../rabbitmq.com/v1beta1/schemareplication.go | 194 ++++ .../typed/rabbitmq.com/v1beta1/user.go | 194 ++++ .../typed/rabbitmq.com/v1beta1/vhost.go | 194 ++++ .../informers/externalversions/factory.go | 179 ++++ .../informers/externalversions/generic.go | 75 ++ .../internalinterfaces/factory_interfaces.go | 39 + .../rabbitmq.com/interface.go | 45 + .../rabbitmq.com/v1beta1/binding.go | 89 ++ .../rabbitmq.com/v1beta1/exchange.go | 89 ++ .../rabbitmq.com/v1beta1/interface.go | 93 ++ .../rabbitmq.com/v1beta1/permission.go | 89 ++ .../rabbitmq.com/v1beta1/policy.go | 89 ++ .../rabbitmq.com/v1beta1/queue.go | 89 ++ .../rabbitmq.com/v1beta1/schemareplication.go | 89 ++ .../rabbitmq.com/v1beta1/user.go | 89 ++ .../rabbitmq.com/v1beta1/vhost.go | 89 ++ .../pkg/client/injection/client/client.go | 56 ++ .../pkg/client/injection/client/fake/fake.go | 56 ++ .../injection/informers/factory/factory.go | 55 ++ .../injection/informers/factory/fake/fake.go | 44 + .../filtered/fake/fake_filtered_factory.go | 58 ++ .../factory/filtered/filtered_factory.go | 76 ++ .../rabbitmq.com/v1beta1/binding/binding.go | 51 + .../rabbitmq.com/v1beta1/binding/fake/fake.go | 39 + .../v1beta1/binding/filtered/binding.go | 64 ++ .../v1beta1/binding/filtered/fake/fake.go | 51 + .../rabbitmq.com/v1beta1/exchange/exchange.go | 51 + .../v1beta1/exchange/fake/fake.go | 39 + .../v1beta1/exchange/filtered/exchange.go | 64 ++ .../v1beta1/exchange/filtered/fake/fake.go | 51 + .../v1beta1/permission/fake/fake.go | 39 + .../v1beta1/permission/filtered/fake/fake.go | 51 + .../v1beta1/permission/filtered/permission.go | 64 ++ .../v1beta1/permission/permission.go | 51 + .../rabbitmq.com/v1beta1/policy/fake/fake.go | 39 + .../v1beta1/policy/filtered/fake/fake.go | 51 + .../v1beta1/policy/filtered/policy.go | 64 ++ .../rabbitmq.com/v1beta1/policy/policy.go | 51 + .../rabbitmq.com/v1beta1/queue/fake/fake.go | 39 + .../v1beta1/queue/filtered/fake/fake.go | 51 + .../v1beta1/queue/filtered/queue.go | 64 ++ .../rabbitmq.com/v1beta1/queue/queue.go | 51 + .../v1beta1/schemareplication/fake/fake.go | 39 + .../schemareplication/filtered/fake/fake.go | 51 + .../filtered/schemareplication.go | 64 ++ .../schemareplication/schemareplication.go | 51 + .../rabbitmq.com/v1beta1/user/fake/fake.go | 39 + .../v1beta1/user/filtered/fake/fake.go | 51 + .../v1beta1/user/filtered/user.go | 64 ++ .../rabbitmq.com/v1beta1/user/user.go | 51 + .../rabbitmq.com/v1beta1/vhost/fake/fake.go | 39 + .../v1beta1/vhost/filtered/fake/fake.go | 51 + .../v1beta1/vhost/filtered/vhost.go | 64 ++ .../rabbitmq.com/v1beta1/vhost/vhost.go | 51 + .../listers/rabbitmq.com/v1beta1/binding.go | 98 ++ .../listers/rabbitmq.com/v1beta1/exchange.go | 98 ++ .../v1beta1/expansion_generated.go | 82 ++ .../rabbitmq.com/v1beta1/permission.go | 98 ++ .../listers/rabbitmq.com/v1beta1/policy.go | 98 ++ .../listers/rabbitmq.com/v1beta1/queue.go | 98 ++ .../rabbitmq.com/v1beta1/schemareplication.go | 98 ++ .../listers/rabbitmq.com/v1beta1/user.go | 98 ++ .../listers/rabbitmq.com/v1beta1/vhost.go | 98 ++ vendor/modules.txt | 1 + 120 files changed, 8950 insertions(+), 61 deletions(-) create mode 100644 third_party/pkg/apis/rabbitmq.com/v1beta1/binding_types.go create mode 100644 third_party/pkg/apis/rabbitmq.com/v1beta1/conditions.go create mode 100644 third_party/pkg/apis/rabbitmq.com/v1beta1/exchange_types.go create mode 100644 third_party/pkg/apis/rabbitmq.com/v1beta1/groupversion_info.go create mode 100644 third_party/pkg/apis/rabbitmq.com/v1beta1/permission_types.go create mode 100644 third_party/pkg/apis/rabbitmq.com/v1beta1/policy_types.go create mode 100644 third_party/pkg/apis/rabbitmq.com/v1beta1/queue_types.go create mode 100644 third_party/pkg/apis/rabbitmq.com/v1beta1/schemareplication_types.go create mode 100644 third_party/pkg/apis/rabbitmq.com/v1beta1/user_types.go create mode 100644 third_party/pkg/apis/rabbitmq.com/v1beta1/vhost_types.go create mode 100644 third_party/pkg/apis/rabbitmq.com/v1beta1/zz_generated.deepcopy.go create mode 100644 third_party/pkg/client/clientset/versioned/clientset.go create mode 100644 third_party/pkg/client/clientset/versioned/doc.go create mode 100644 third_party/pkg/client/clientset/versioned/fake/clientset_generated.go create mode 100644 third_party/pkg/client/clientset/versioned/fake/doc.go create mode 100644 third_party/pkg/client/clientset/versioned/fake/register.go create mode 100644 third_party/pkg/client/clientset/versioned/scheme/doc.go create mode 100644 third_party/pkg/client/clientset/versioned/scheme/register.go create mode 100644 third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/binding.go create mode 100644 third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/doc.go create mode 100644 third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/exchange.go create mode 100644 third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/fake/doc.go create mode 100644 third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/fake/fake_binding.go create mode 100644 third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/fake/fake_exchange.go create mode 100644 third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/fake/fake_permission.go create mode 100644 third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/fake/fake_policy.go create mode 100644 third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/fake/fake_queue.go create mode 100644 third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/fake/fake_rabbitmq.com_client.go create mode 100644 third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/fake/fake_schemareplication.go create mode 100644 third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/fake/fake_user.go create mode 100644 third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/fake/fake_vhost.go create mode 100644 third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/generated_expansion.go create mode 100644 third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/permission.go create mode 100644 third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/policy.go create mode 100644 third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/queue.go create mode 100644 third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/rabbitmq.com_client.go create mode 100644 third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/schemareplication.go create mode 100644 third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/user.go create mode 100644 third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/vhost.go create mode 100644 third_party/pkg/client/informers/externalversions/factory.go create mode 100644 third_party/pkg/client/informers/externalversions/generic.go create mode 100644 third_party/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go create mode 100644 third_party/pkg/client/informers/externalversions/rabbitmq.com/interface.go create mode 100644 third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1/binding.go create mode 100644 third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1/exchange.go create mode 100644 third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1/interface.go create mode 100644 third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1/permission.go create mode 100644 third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1/policy.go create mode 100644 third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1/queue.go create mode 100644 third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1/schemareplication.go create mode 100644 third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1/user.go create mode 100644 third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1/vhost.go create mode 100644 third_party/pkg/client/injection/client/client.go create mode 100644 third_party/pkg/client/injection/client/fake/fake.go create mode 100644 third_party/pkg/client/injection/informers/factory/factory.go create mode 100644 third_party/pkg/client/injection/informers/factory/fake/fake.go create mode 100644 third_party/pkg/client/injection/informers/factory/filtered/fake/fake_filtered_factory.go create mode 100644 third_party/pkg/client/injection/informers/factory/filtered/filtered_factory.go create mode 100644 third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/binding/binding.go create mode 100644 third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/binding/fake/fake.go create mode 100644 third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/binding/filtered/binding.go create mode 100644 third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/binding/filtered/fake/fake.go create mode 100644 third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/exchange/exchange.go create mode 100644 third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/exchange/fake/fake.go create mode 100644 third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/exchange/filtered/exchange.go create mode 100644 third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/exchange/filtered/fake/fake.go create mode 100644 third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/permission/fake/fake.go create mode 100644 third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/permission/filtered/fake/fake.go create mode 100644 third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/permission/filtered/permission.go create mode 100644 third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/permission/permission.go create mode 100644 third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/policy/fake/fake.go create mode 100644 third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/policy/filtered/fake/fake.go create mode 100644 third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/policy/filtered/policy.go create mode 100644 third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/policy/policy.go create mode 100644 third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/queue/fake/fake.go create mode 100644 third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/queue/filtered/fake/fake.go create mode 100644 third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/queue/filtered/queue.go create mode 100644 third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/queue/queue.go create mode 100644 third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/schemareplication/fake/fake.go create mode 100644 third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/schemareplication/filtered/fake/fake.go create mode 100644 third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/schemareplication/filtered/schemareplication.go create mode 100644 third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/schemareplication/schemareplication.go create mode 100644 third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/user/fake/fake.go create mode 100644 third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/user/filtered/fake/fake.go create mode 100644 third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/user/filtered/user.go create mode 100644 third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/user/user.go create mode 100644 third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/vhost/fake/fake.go create mode 100644 third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/vhost/filtered/fake/fake.go create mode 100644 third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/vhost/filtered/vhost.go create mode 100644 third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/vhost/vhost.go create mode 100644 third_party/pkg/client/listers/rabbitmq.com/v1beta1/binding.go create mode 100644 third_party/pkg/client/listers/rabbitmq.com/v1beta1/exchange.go create mode 100644 third_party/pkg/client/listers/rabbitmq.com/v1beta1/expansion_generated.go create mode 100644 third_party/pkg/client/listers/rabbitmq.com/v1beta1/permission.go create mode 100644 third_party/pkg/client/listers/rabbitmq.com/v1beta1/policy.go create mode 100644 third_party/pkg/client/listers/rabbitmq.com/v1beta1/queue.go create mode 100644 third_party/pkg/client/listers/rabbitmq.com/v1beta1/schemareplication.go create mode 100644 third_party/pkg/client/listers/rabbitmq.com/v1beta1/user.go create mode 100644 third_party/pkg/client/listers/rabbitmq.com/v1beta1/vhost.go diff --git a/go.mod b/go.mod index 118e783061..c48f12a722 100644 --- a/go.mod +++ b/go.mod @@ -35,6 +35,7 @@ require ( knative.dev/hack v0.0.0-20210622141627-e28525d8d260 knative.dev/pkg v0.0.0-20210803160015-21eb4c167cc5 knative.dev/reconciler-test v0.0.0-20210803183715-b61cc77c06f6 + sigs.k8s.io/controller-runtime v0.8.3 ) replace ( diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh index 17deab8117..2b90bc167a 100755 --- a/hack/update-codegen.sh +++ b/hack/update-codegen.sh @@ -25,6 +25,15 @@ export GOFLAGS=-mod= echo "=== Update Codegen for $MODULE_NAME" +# RabbitMQ uses Kubebuilder +# Kubebuilder project layout has API under 'api/v1beta1', ie. 'github.com/rabbitmq/messaging-topology-operator/api/v1beta1' +# client-go codegen expects group name (rabbitmq.com) in the path, ie. 'github.com/rabbitmq/messaging-topology-operator/api/rabbitmq.com/v1beta1' +# Because there's no way how to modify any of these settings, to enable client codegen, +# we need to reorganize things a little bit (copy to 'third_party/api/rabbitmq.com/v1beta1') +rm -rf ${REPO_ROOT_DIR}/third_party/pkg/apis/rabbitmq.com +mkdir -p ${REPO_ROOT_DIR}/third_party/pkg/apis/rabbitmq.com +cp -R "${REPO_ROOT_DIR}/vendor/github.com/rabbitmq/messaging-topology-operator/api/v1beta1" ${REPO_ROOT_DIR}/third_party/pkg/apis/rabbitmq.com + group "Kubernetes Codegen" # generate the code with: @@ -42,6 +51,12 @@ ${CODEGEN_PKG}/generate-groups.sh "deepcopy" \ "duck:v1beta1" \ --go-header-file ${REPO_ROOT_DIR}/hack/boilerplate/boilerplate.go.txt +# Generate our own client (otherwise injection won't work) +${CODEGEN_PKG}/generate-groups.sh "client,informer,lister" \ + knative.dev/eventing-rabbitmq/third_party/pkg/client knative.dev/eventing-rabbitmq/third_party/pkg/apis \ + "rabbitmq.com:v1beta1" \ + --go-header-file ${REPO_ROOT_DIR}/hack/boilerplate/boilerplate.go.txt + group "Knative Codegen" # Knative Injection @@ -52,26 +67,10 @@ ${KNATIVE_CODEGEN_PKG}/hack/generate-knative.sh "injection" \ group "RabbitMQ Codegen" -# RabbitMQ uses Kubebuilder -# Kubebuilder project layout has API under 'api/v1beta1', ie. 'github.com/rabbitmq/messaging-topology-operator/api/v1beta1' -# client-go codegen expects group name (rabbitmq.com) in the path, ie. 'github.com/rabbitmq/messaging-topology-operator/api/rabbitmq.com/v1beta1' -# Because there's no way how to modify any of these settings, to enable client codegen, -# we need to hack things a little bit (in vendor move temporarily api directory in 'api/rabbitmq.com/v1beta1') -rm -rf ${REPO_ROOT_DIR}/vendor/github.com/rabbitmq/messaging-topology-operator/api/rabbitmq.com -mkdir ${REPO_ROOT_DIR}/vendor/github.com/rabbitmq/messaging-topology-operator/api/rabbitmq.com -cp -R "${REPO_ROOT_DIR}/vendor/github.com/rabbitmq/messaging-topology-operator/api/v1beta1/" ${REPO_ROOT_DIR}/vendor/github.com/rabbitmq/messaging-topology-operator/api/rabbitmq.com/v1beta1 - -OUTPUT_PKG="knative.dev/eventing-rabbitmq/pkg/client/injection/rabbitmq.com" \ -VERSIONED_CLIENTSET_PKG="github.com/rabbitmq/messaging-topology-operator/pkg/generated/clientset/versioned" \ -EXTERNAL_INFORMER_PKG="github.com/rabbitmq/messaging-topology-operator/pkg/generated/informers/externalversions" \ - ${KNATIVE_CODEGEN_PKG}/hack/generate-knative.sh "injection" \ - github.com/rabbitmq/messaging-topology-operator/rabbitmq.com \ - github.com/rabbitmq/messaging-topology-operator/api \ - "rabbitmq.com:v1beta1" \ - --go-header-file ${REPO_ROOT_DIR}/hack/boilerplate/boilerplate.go.txt \ - -mv ${REPO_ROOT_DIR}/vendor/github.com/rabbitmq/messaging-topology-operator/api/rabbitmq.com/v1beta1 ${REPO_ROOT_DIR}/vendor/github.com/rabbitmq/messaging-topology-operator/api/v1beta1 -rm -rf ${REPO_ROOT_DIR}/vendor/github.com/rabbitmq/messaging-topology-operator/api/rabbitmq.com +${KNATIVE_CODEGEN_PKG}/hack/generate-knative.sh "injection" \ + knative.dev/eventing-rabbitmq/third_party/pkg/client knative.dev/eventing-rabbitmq/third_party/pkg/apis \ + "rabbitmq.com:v1beta1" \ + --go-header-file ${REPO_ROOT_DIR}/hack/boilerplate/boilerplate.go.txt group "Update deps post-codegen" diff --git a/hack/update-deps.sh b/hack/update-deps.sh index cde59a65fb..0f5b721b7d 100755 --- a/hack/update-deps.sh +++ b/hack/update-deps.sh @@ -22,8 +22,8 @@ source $(dirname "$0")/../vendor/knative.dev/hack/library.sh go_update_deps "$@" -rm -rf $(find third_party/ -name '*.mod') -rm -rf $(find third_party/ -name '*.go') +rm -rf $(find third_party/VENDOR-LICENSE/ -name '*.mod') +rm -rf $(find third_party/VENDOR-LICENSE/ -name '*.go') # Remove the _webhook.go files that cause (unnecessarily) controller-runtime # to get pulled in, which in turn causes issues with double-defining 'kubeconfig' diff --git a/pkg/reconciler/broker/broker.go b/pkg/reconciler/broker/broker.go index 0845ee38d7..b2ec51f02f 100644 --- a/pkg/reconciler/broker/broker.go +++ b/pkg/reconciler/broker/broker.go @@ -35,12 +35,12 @@ import ( "knative.dev/pkg/logging" "knative.dev/pkg/network" - "github.com/rabbitmq/messaging-topology-operator/api/v1beta1" - rabbitclientset "github.com/rabbitmq/messaging-topology-operator/pkg/generated/clientset/versioned" - rabbitlisters "github.com/rabbitmq/messaging-topology-operator/pkg/generated/listers/rabbitmq.com/v1beta1" naming "knative.dev/eventing-rabbitmq/pkg/rabbitmqnaming" "knative.dev/eventing-rabbitmq/pkg/reconciler/broker/resources" triggerresources "knative.dev/eventing-rabbitmq/pkg/reconciler/trigger/resources" + "knative.dev/eventing-rabbitmq/third_party/pkg/apis/rabbitmq.com/v1beta1" + rabbitclientset "knative.dev/eventing-rabbitmq/third_party/pkg/client/clientset/versioned" + rabbitlisters "knative.dev/eventing-rabbitmq/third_party/pkg/client/listers/rabbitmq.com/v1beta1" eventingv1 "knative.dev/eventing/pkg/apis/eventing/v1" clientset "knative.dev/eventing/pkg/client/clientset/versioned" brokerreconciler "knative.dev/eventing/pkg/client/injection/reconciler/eventing/v1/broker" diff --git a/pkg/reconciler/broker/broker_test.go b/pkg/reconciler/broker/broker_test.go index 58f17632aa..138bba5dc0 100644 --- a/pkg/reconciler/broker/broker_test.go +++ b/pkg/reconciler/broker/broker_test.go @@ -30,12 +30,12 @@ import ( "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/kubernetes/scheme" - rabbitv1beta1 "github.com/rabbitmq/messaging-topology-operator/api/v1beta1" clientgotesting "k8s.io/client-go/testing" rabbitmqduck "knative.dev/eventing-rabbitmq/pkg/apis/duck/v1beta1" rabbitduck "knative.dev/eventing-rabbitmq/pkg/client/injection/ducks/duck/v1beta1/rabbit" - fakerabbitclient "knative.dev/eventing-rabbitmq/pkg/client/injection/rabbitmq.com/client/fake" "knative.dev/eventing-rabbitmq/pkg/reconciler/broker/resources" + rabbitv1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/apis/rabbitmq.com/v1beta1" + fakerabbitclient "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/client/fake" eventingduckv1 "knative.dev/eventing/pkg/apis/duck/v1" "knative.dev/eventing/pkg/apis/eventing" eventingv1 "knative.dev/eventing/pkg/apis/eventing/v1" diff --git a/pkg/reconciler/broker/controller.go b/pkg/reconciler/broker/controller.go index ce10243aa7..d71314b6bb 100644 --- a/pkg/reconciler/broker/controller.go +++ b/pkg/reconciler/broker/controller.go @@ -21,7 +21,7 @@ import ( "log" "knative.dev/eventing-rabbitmq/pkg/client/injection/ducks/duck/v1beta1/rabbit" - rabbitmqclient "knative.dev/eventing-rabbitmq/pkg/client/injection/rabbitmq.com/client" + rabbitmqclient "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/client" eventingclient "knative.dev/eventing/pkg/client/injection/client" "github.com/kelseyhightower/envconfig" @@ -31,9 +31,9 @@ import ( "knative.dev/eventing/pkg/apis/eventing" eventingv1 "knative.dev/eventing/pkg/apis/eventing/v1" - bindinginformer "knative.dev/eventing-rabbitmq/pkg/client/injection/rabbitmq.com/informers/rabbitmq.com/v1beta1/binding" - exchangeinformer "knative.dev/eventing-rabbitmq/pkg/client/injection/rabbitmq.com/informers/rabbitmq.com/v1beta1/exchange" - queueinformer "knative.dev/eventing-rabbitmq/pkg/client/injection/rabbitmq.com/informers/rabbitmq.com/v1beta1/queue" + bindinginformer "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/binding" + exchangeinformer "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/exchange" + queueinformer "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/queue" brokerinformer "knative.dev/eventing/pkg/client/injection/informers/eventing/v1/broker" brokerreconciler "knative.dev/eventing/pkg/client/injection/reconciler/eventing/v1/broker" "knative.dev/eventing/pkg/duck" diff --git a/pkg/reconciler/broker/controller_test.go b/pkg/reconciler/broker/controller_test.go index 7373a30091..48a4058e47 100644 --- a/pkg/reconciler/broker/controller_test.go +++ b/pkg/reconciler/broker/controller_test.go @@ -25,10 +25,10 @@ import ( // Fake injection informers _ "knative.dev/eventing-rabbitmq/pkg/client/injection/ducks/duck/v1beta1/rabbit/fake" - _ "knative.dev/eventing-rabbitmq/pkg/client/injection/rabbitmq.com/client/fake" - _ "knative.dev/eventing-rabbitmq/pkg/client/injection/rabbitmq.com/informers/rabbitmq.com/v1beta1/binding/fake" - _ "knative.dev/eventing-rabbitmq/pkg/client/injection/rabbitmq.com/informers/rabbitmq.com/v1beta1/exchange/fake" - _ "knative.dev/eventing-rabbitmq/pkg/client/injection/rabbitmq.com/informers/rabbitmq.com/v1beta1/queue/fake" + _ "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/client/fake" + _ "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/binding/fake" + _ "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/exchange/fake" + _ "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/queue/fake" _ "knative.dev/eventing/pkg/client/injection/informers/eventing/v1/broker/fake" _ "knative.dev/pkg/client/injection/ducks/duck/v1/addressable/fake" _ "knative.dev/pkg/client/injection/ducks/duck/v1/conditions/fake" diff --git a/pkg/reconciler/broker/resources/exchange.go b/pkg/reconciler/broker/resources/exchange.go index 9b9925a4b6..6b0f1dbb6e 100644 --- a/pkg/reconciler/broker/resources/exchange.go +++ b/pkg/reconciler/broker/resources/exchange.go @@ -25,7 +25,7 @@ import ( naming "knative.dev/eventing-rabbitmq/pkg/rabbitmqnaming" - rabbitv1beta1 "github.com/rabbitmq/messaging-topology-operator/api/v1beta1" + rabbitv1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/apis/rabbitmq.com/v1beta1" eventingv1 "knative.dev/eventing/pkg/apis/eventing/v1" ) diff --git a/pkg/reconciler/broker/resources/exchange_test.go b/pkg/reconciler/broker/resources/exchange_test.go index 848aea782c..ae4eae69df 100644 --- a/pkg/reconciler/broker/resources/exchange_test.go +++ b/pkg/reconciler/broker/resources/exchange_test.go @@ -4,10 +4,10 @@ import ( "context" "testing" - rabbitv1beta1 "github.com/rabbitmq/messaging-topology-operator/api/v1beta1" "k8s.io/apimachinery/pkg/api/equality" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "knative.dev/eventing-rabbitmq/pkg/reconciler/broker/resources" + rabbitv1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/apis/rabbitmq.com/v1beta1" eventingv1 "knative.dev/eventing/pkg/apis/eventing/v1" duckv1 "knative.dev/pkg/apis/duck/v1" ) diff --git a/pkg/reconciler/testing/factory.go b/pkg/reconciler/testing/factory.go index d566ef8a45..c4d23c3c3e 100644 --- a/pkg/reconciler/testing/factory.go +++ b/pkg/reconciler/testing/factory.go @@ -37,7 +37,7 @@ import ( "knative.dev/pkg/controller" "knative.dev/pkg/reconciler" - fakerabbitclient "knative.dev/eventing-rabbitmq/pkg/client/injection/rabbitmq.com/client/fake" + fakerabbitclient "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/client/fake" fakeeventingclient "knative.dev/eventing/pkg/client/injection/client/fake" fakekubeclient "knative.dev/pkg/client/injection/kube/client/fake" fakedynamicclient "knative.dev/pkg/injection/clients/dynamicclient/fake" diff --git a/pkg/reconciler/testing/listers.go b/pkg/reconciler/testing/listers.go index f94ae877bb..e0bbfe652e 100644 --- a/pkg/reconciler/testing/listers.go +++ b/pkg/reconciler/testing/listers.go @@ -45,9 +45,9 @@ import ( "knative.dev/pkg/reconciler/testing" rabbitclusterv1beta1 "github.com/rabbitmq/cluster-operator/api/v1beta1" - rabbitv1beta1 "github.com/rabbitmq/messaging-topology-operator/api/v1beta1" - fakerabbitclientset "github.com/rabbitmq/messaging-topology-operator/pkg/generated/clientset/versioned/fake" - rabbitlisters "github.com/rabbitmq/messaging-topology-operator/pkg/generated/listers/rabbitmq.com/v1beta1" + rabbitv1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/apis/rabbitmq.com/v1beta1" + fakerabbitclientset "knative.dev/eventing-rabbitmq/third_party/pkg/client/clientset/versioned/fake" + rabbitlisters "knative.dev/eventing-rabbitmq/third_party/pkg/client/listers/rabbitmq.com/v1beta1" ) var subscriberAddToScheme = func(scheme *runtime.Scheme) error { diff --git a/pkg/reconciler/trigger/controller.go b/pkg/reconciler/trigger/controller.go index 7a43fca014..50f6b4c37a 100644 --- a/pkg/reconciler/trigger/controller.go +++ b/pkg/reconciler/trigger/controller.go @@ -20,7 +20,7 @@ import ( "context" "log" - rabbitmqclient "knative.dev/eventing-rabbitmq/pkg/client/injection/rabbitmq.com/client" + rabbitmqclient "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/client" eventingclient "knative.dev/eventing/pkg/client/injection/client" kubeclient "knative.dev/pkg/client/injection/kube/client" "knative.dev/pkg/injection/clients/dynamicclient" @@ -32,8 +32,8 @@ import ( v1 "knative.dev/eventing/pkg/apis/eventing/v1" - bindinginformer "knative.dev/eventing-rabbitmq/pkg/client/injection/rabbitmq.com/informers/rabbitmq.com/v1beta1/binding" - exchangeinformer "knative.dev/eventing-rabbitmq/pkg/client/injection/rabbitmq.com/informers/rabbitmq.com/v1beta1/exchange" + bindinginformer "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/binding" + exchangeinformer "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/exchange" brokerinformer "knative.dev/eventing/pkg/client/injection/informers/eventing/v1/broker" triggerinformer "knative.dev/eventing/pkg/client/injection/informers/eventing/v1/trigger" brokerreconciler "knative.dev/eventing/pkg/client/injection/reconciler/eventing/v1/broker" @@ -43,7 +43,7 @@ import ( "knative.dev/pkg/client/injection/ducks/duck/v1/source" deploymentinformer "knative.dev/pkg/client/injection/kube/informers/apps/v1/deployment" - queueinformer "knative.dev/eventing-rabbitmq/pkg/client/injection/rabbitmq.com/informers/rabbitmq.com/v1beta1/queue" + queueinformer "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/queue" "knative.dev/pkg/configmap" "knative.dev/pkg/controller" diff --git a/pkg/reconciler/trigger/controller_test.go b/pkg/reconciler/trigger/controller_test.go index f121c2e1c3..4b43cd4efe 100644 --- a/pkg/reconciler/trigger/controller_test.go +++ b/pkg/reconciler/trigger/controller_test.go @@ -25,10 +25,10 @@ import ( // Fake injection informers _ "knative.dev/eventing-rabbitmq/pkg/client/injection/ducks/duck/v1beta1/rabbit/fake" - _ "knative.dev/eventing-rabbitmq/pkg/client/injection/rabbitmq.com/client/fake" - _ "knative.dev/eventing-rabbitmq/pkg/client/injection/rabbitmq.com/informers/rabbitmq.com/v1beta1/binding/fake" - _ "knative.dev/eventing-rabbitmq/pkg/client/injection/rabbitmq.com/informers/rabbitmq.com/v1beta1/exchange/fake" - _ "knative.dev/eventing-rabbitmq/pkg/client/injection/rabbitmq.com/informers/rabbitmq.com/v1beta1/queue/fake" + _ "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/client/fake" + _ "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/binding/fake" + _ "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/exchange/fake" + _ "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/queue/fake" _ "knative.dev/eventing/pkg/client/injection/informers/eventing/v1/broker/fake" _ "knative.dev/eventing/pkg/client/injection/informers/eventing/v1/trigger/fake" _ "knative.dev/pkg/client/injection/ducks/duck/v1/addressable/fake" diff --git a/pkg/reconciler/trigger/resources/binding.go b/pkg/reconciler/trigger/resources/binding.go index 596788072d..fbab273b05 100644 --- a/pkg/reconciler/trigger/resources/binding.go +++ b/pkg/reconciler/trigger/resources/binding.go @@ -21,10 +21,10 @@ import ( "encoding/json" "fmt" - rabbitv1beta1 "github.com/rabbitmq/messaging-topology-operator/api/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" naming "knative.dev/eventing-rabbitmq/pkg/rabbitmqnaming" + rabbitv1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/apis/rabbitmq.com/v1beta1" "knative.dev/pkg/kmeta" "knative.dev/eventing/pkg/apis/eventing" diff --git a/pkg/reconciler/trigger/resources/binding_test.go b/pkg/reconciler/trigger/resources/binding_test.go index 948e48dc9e..0761455296 100644 --- a/pkg/reconciler/trigger/resources/binding_test.go +++ b/pkg/reconciler/trigger/resources/binding_test.go @@ -21,11 +21,11 @@ import ( "encoding/json" "testing" - rabbitv1beta1 "github.com/rabbitmq/messaging-topology-operator/api/v1beta1" "k8s.io/apimachinery/pkg/api/equality" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "knative.dev/eventing-rabbitmq/pkg/reconciler/trigger/resources" + rabbitv1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/apis/rabbitmq.com/v1beta1" eventingduckv1 "knative.dev/eventing/pkg/apis/duck/v1" eventingv1 "knative.dev/eventing/pkg/apis/eventing/v1" "knative.dev/pkg/apis" diff --git a/pkg/reconciler/trigger/resources/queue.go b/pkg/reconciler/trigger/resources/queue.go index b4c9c42005..9483c544c8 100644 --- a/pkg/reconciler/trigger/resources/queue.go +++ b/pkg/reconciler/trigger/resources/queue.go @@ -19,10 +19,10 @@ package resources import ( "context" - rabbitv1beta1 "github.com/rabbitmq/messaging-topology-operator/api/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" naming "knative.dev/eventing-rabbitmq/pkg/rabbitmqnaming" + rabbitv1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/apis/rabbitmq.com/v1beta1" "knative.dev/eventing/pkg/apis/eventing" "knative.dev/pkg/kmeta" diff --git a/pkg/reconciler/trigger/resources/queue_test.go b/pkg/reconciler/trigger/resources/queue_test.go index 61136a4f5f..28952f8f5f 100644 --- a/pkg/reconciler/trigger/resources/queue_test.go +++ b/pkg/reconciler/trigger/resources/queue_test.go @@ -21,12 +21,12 @@ import ( "encoding/json" "testing" - rabbitv1beta1 "github.com/rabbitmq/messaging-topology-operator/api/v1beta1" "k8s.io/apimachinery/pkg/api/equality" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" naming "knative.dev/eventing-rabbitmq/pkg/rabbitmqnaming" "knative.dev/eventing-rabbitmq/pkg/reconciler/trigger/resources" + rabbitv1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/apis/rabbitmq.com/v1beta1" eventingv1 "knative.dev/eventing/pkg/apis/eventing/v1" ) diff --git a/pkg/reconciler/trigger/trigger.go b/pkg/reconciler/trigger/trigger.go index f04e9c2fe3..4ffa39d2dd 100644 --- a/pkg/reconciler/trigger/trigger.go +++ b/pkg/reconciler/trigger/trigger.go @@ -20,7 +20,6 @@ import ( "context" "fmt" - "github.com/rabbitmq/messaging-topology-operator/api/v1beta1" "go.uber.org/zap" v1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" @@ -30,14 +29,15 @@ import ( "k8s.io/client-go/dynamic" "k8s.io/client-go/kubernetes" appsv1listers "k8s.io/client-go/listers/apps/v1" + "knative.dev/eventing-rabbitmq/third_party/pkg/apis/rabbitmq.com/v1beta1" "knative.dev/pkg/apis" duckv1 "knative.dev/pkg/apis/duck/v1" "knative.dev/pkg/logging" - rabbitclientset "github.com/rabbitmq/messaging-topology-operator/pkg/generated/clientset/versioned" - rabbitlisters "github.com/rabbitmq/messaging-topology-operator/pkg/generated/listers/rabbitmq.com/v1beta1" naming "knative.dev/eventing-rabbitmq/pkg/rabbitmqnaming" "knative.dev/eventing-rabbitmq/pkg/reconciler/trigger/resources" + rabbitclientset "knative.dev/eventing-rabbitmq/third_party/pkg/client/clientset/versioned" + rabbitlisters "knative.dev/eventing-rabbitmq/third_party/pkg/client/listers/rabbitmq.com/v1beta1" eventingduckv1 "knative.dev/eventing/pkg/apis/duck/v1" "knative.dev/eventing/pkg/apis/eventing" eventingv1 "knative.dev/eventing/pkg/apis/eventing/v1" diff --git a/pkg/reconciler/trigger/trigger_test.go b/pkg/reconciler/trigger/trigger_test.go index 9191fbcdb2..a77c45a157 100644 --- a/pkg/reconciler/trigger/trigger_test.go +++ b/pkg/reconciler/trigger/trigger_test.go @@ -35,13 +35,13 @@ import ( "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/kubernetes/scheme" - rabbitv1beta1 "github.com/rabbitmq/messaging-topology-operator/api/v1beta1" clientgotesting "k8s.io/client-go/testing" rabbitduck "knative.dev/eventing-rabbitmq/pkg/client/injection/ducks/duck/v1beta1/rabbit" - fakerabbitclient "knative.dev/eventing-rabbitmq/pkg/client/injection/rabbitmq.com/client/fake" naming "knative.dev/eventing-rabbitmq/pkg/rabbitmqnaming" "knative.dev/eventing-rabbitmq/pkg/reconciler/broker" "knative.dev/eventing-rabbitmq/pkg/reconciler/trigger/resources" + rabbitv1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/apis/rabbitmq.com/v1beta1" + fakerabbitclient "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/client/fake" "knative.dev/eventing/pkg/apis/eventing" eventingv1 "knative.dev/eventing/pkg/apis/eventing/v1" sourcesv1beta2 "knative.dev/eventing/pkg/apis/sources/v1beta2" diff --git a/pkg/reconciler/triggerstandalone/controller_test.go b/pkg/reconciler/triggerstandalone/controller_test.go index dc1c730836..57f02d7924 100644 --- a/pkg/reconciler/triggerstandalone/controller_test.go +++ b/pkg/reconciler/triggerstandalone/controller_test.go @@ -25,9 +25,9 @@ import ( // Fake injection informers _ "knative.dev/eventing-rabbitmq/pkg/client/injection/ducks/duck/v1beta1/rabbit/fake" - _ "knative.dev/eventing-rabbitmq/pkg/client/injection/rabbitmq.com/client/fake" - _ "knative.dev/eventing-rabbitmq/pkg/client/injection/rabbitmq.com/informers/rabbitmq.com/v1beta1/binding/fake" - _ "knative.dev/eventing-rabbitmq/pkg/client/injection/rabbitmq.com/informers/rabbitmq.com/v1beta1/queue/fake" + _ "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/client/fake" + _ "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/binding/fake" + _ "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/queue/fake" _ "knative.dev/eventing/pkg/client/injection/informers/eventing/v1/broker/fake" _ "knative.dev/eventing/pkg/client/injection/informers/eventing/v1/trigger/fake" _ "knative.dev/pkg/client/injection/ducks/duck/v1/addressable/fake" diff --git a/third_party/pkg/apis/rabbitmq.com/v1beta1/binding_types.go b/third_party/pkg/apis/rabbitmq.com/v1beta1/binding_types.go new file mode 100644 index 0000000000..0eb09ab77a --- /dev/null +++ b/third_party/pkg/apis/rabbitmq.com/v1beta1/binding_types.go @@ -0,0 +1,81 @@ +/* +RabbitMQ Messaging Topology Kubernetes Operator +Copyright 2021 VMware, Inc. + +This product is licensed to you under the Mozilla Public License 2.0 license (the "License"). You may not use this product except in compliance with the Mozilla 2.0 License. + +This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. +*/ + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +// BindingSpec defines the desired state of Binding +type BindingSpec struct { + // Default to vhost '/' + // +kubebuilder:default:=/ + Vhost string `json:"vhost,omitempty"` + // +kubebuilder:validation:Optional + Source string `json:"source,omitempty"` + // +kubebuilder:validation:Optional + Destination string `json:"destination,omitempty"` + // +kubebuilder:validation:Optional + // +kubebuilder:validation:Enum=exchange;queue + DestinationType string `json:"destinationType,omitempty"` + // +kubebuilder:validation:Optional + RoutingKey string `json:"routingKey,omitempty"` + // +kubebuilder:validation:Type=object + // +kubebuilder:pruning:PreserveUnknownFields + Arguments *runtime.RawExtension `json:"arguments,omitempty"` + // Reference to the RabbitmqCluster that the binding will be created in. + // Required property. + // +kubebuilder:validation:Required + RabbitmqClusterReference RabbitmqClusterReference `json:"rabbitmqClusterReference"` +} + +// BindingStatus defines the observed state of Binding +type BindingStatus struct { + // observedGeneration is the most recent successful generation observed for this Binding. It corresponds to the + // Binding's generation, which is updated on mutation by the API Server. + ObservedGeneration int64 `json:"observedGeneration,omitempty"` + Conditions []Condition `json:"conditions,omitempty"` +} + +// +genclient +// +kubebuilder:object:root=true +// +kubebuilder:resource:categories=all +// +kubebuilder:subresource:status + +// Binding is the Schema for the bindings API +type Binding struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec BindingSpec `json:"spec,omitempty"` + Status BindingStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// BindingList contains a list of Binding +type BindingList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []Binding `json:"items"` +} + +func (b *Binding) GroupResource() schema.GroupResource { + return schema.GroupResource{ + Group: b.GroupVersionKind().Group, + Resource: b.GroupVersionKind().Kind, + } +} + +func init() { + SchemeBuilder.Register(&Binding{}, &BindingList{}) +} diff --git a/third_party/pkg/apis/rabbitmq.com/v1beta1/conditions.go b/third_party/pkg/apis/rabbitmq.com/v1beta1/conditions.go new file mode 100644 index 0000000000..e28980d5d1 --- /dev/null +++ b/third_party/pkg/apis/rabbitmq.com/v1beta1/conditions.go @@ -0,0 +1,44 @@ +package v1beta1 + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +const ready ConditionType = "Ready" + +type ConditionType string + +type Condition struct { + // Type indicates the scope of RabbitmqCluster status addressed by the condition. + Type ConditionType `json:"type"` + // True, False, or Unknown + Status corev1.ConditionStatus `json:"status"` + // The last time this Condition type changed. + LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"` + // One word, camel-case reason for current status of the condition. + Reason string `json:"reason,omitempty"` + // Full text reason for current status of the condition. + Message string `json:"message,omitempty"` +} + +// Ready indicates that the last Create/Update operator on the CR was successful. +func Ready() Condition { + return Condition{ + Type: ready, + Status: corev1.ConditionTrue, + LastTransitionTime: metav1.Now(), + Reason: "SuccessfulCreateOrUpdate", + } +} + +// NotReady indicates that the last Create/Update operator on the CR failed. +func NotReady(msg string) Condition { + return Condition{ + Type: ready, + Status: corev1.ConditionFalse, + LastTransitionTime: metav1.Now(), + Reason: "FailedCreateOrUpdate", + Message: msg, + } +} diff --git a/third_party/pkg/apis/rabbitmq.com/v1beta1/exchange_types.go b/third_party/pkg/apis/rabbitmq.com/v1beta1/exchange_types.go new file mode 100644 index 0000000000..56642df32d --- /dev/null +++ b/third_party/pkg/apis/rabbitmq.com/v1beta1/exchange_types.go @@ -0,0 +1,79 @@ +/* +RabbitMQ Messaging Topology Kubernetes Operator +Copyright 2021 VMware, Inc. + +This product is licensed to you under the Mozilla Public License 2.0 license (the "License"). You may not use this product except in compliance with the Mozilla 2.0 License. + +This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. +*/ + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +// ExchangeSpec defines the desired state of Exchange +type ExchangeSpec struct { + // +kubebuilder:validation:Required + Name string `json:"name"` + // Default to vhost '/' + // +kubebuilder:default:=/ + Vhost string `json:"vhost,omitempty"` + // +kubebuilder:validation:Enum=direct;fanout;headers;topic + // +kubebuilder:default:=direct + Type string `json:"type,omitempty"` + Durable bool `json:"durable,omitempty"` + AutoDelete bool `json:"autoDelete,omitempty"` + // +kubebuilder:validation:Type=object + // +kubebuilder:pruning:PreserveUnknownFields + Arguments *runtime.RawExtension `json:"arguments,omitempty"` + // Reference to the RabbitmqCluster that the exchange will be created in. + // Required property. + // +kubebuilder:validation:Required + RabbitmqClusterReference RabbitmqClusterReference `json:"rabbitmqClusterReference"` +} + +// ExchangeStatus defines the observed state of Exchange +type ExchangeStatus struct { + // observedGeneration is the most recent successful generation observed for this Exchange. It corresponds to the + // Exchange's generation, which is updated on mutation by the API Server. + ObservedGeneration int64 `json:"observedGeneration,omitempty"` + Conditions []Condition `json:"conditions,omitempty"` +} + +// +genclient +// +kubebuilder:object:root=true +// +kubebuilder:resource:categories=all +// +kubebuilder:subresource:status + +// Exchange is the Schema for the exchanges API +type Exchange struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec ExchangeSpec `json:"spec,omitempty"` + Status ExchangeStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// ExchangeList contains a list of Exchange +type ExchangeList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []Exchange `json:"items"` +} + +func (e *Exchange) GroupResource() schema.GroupResource { + return schema.GroupResource{ + Group: e.GroupVersionKind().Group, + Resource: e.GroupVersionKind().Kind, + } +} + +func init() { + SchemeBuilder.Register(&Exchange{}, &ExchangeList{}) +} diff --git a/third_party/pkg/apis/rabbitmq.com/v1beta1/groupversion_info.go b/third_party/pkg/apis/rabbitmq.com/v1beta1/groupversion_info.go new file mode 100644 index 0000000000..88edce7527 --- /dev/null +++ b/third_party/pkg/apis/rabbitmq.com/v1beta1/groupversion_info.go @@ -0,0 +1,45 @@ +/* +RabbitMQ Messaging Topology Kubernetes Operator +Copyright 2021 VMware, Inc. + +This product is licensed to you under the Mozilla Public License 2.0 license (the "License"). You may not use this product except in compliance with the Mozilla 2.0 License. + +This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. +*/ + +// Package v1beta1 contains API Schema definitions for the rabbitmq.com v1beta1 API group +// +kubebuilder:object:generate=true +// +groupName=rabbitmq.com +package v1beta1 + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/scheme" +) + +var ( + // GroupVersion is group version used to register these objects + GroupVersion = schema.GroupVersion{Group: "rabbitmq.com", Version: "v1beta1"} + + // SchemeGroupVersion is group version used to register these objects + // added for generated clientset + SchemeGroupVersion = GroupVersion + + // SchemeBuilder is used to add go types to the GroupVersionKind scheme + SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} + + // AddToScheme adds the types in this group-version to the given scheme. + AddToScheme = SchemeBuilder.AddToScheme +) + +// Kind takes an unqualified kind and returns back a Group qualified GroupKind +// added for generated clientset +func Kind(kind string) schema.GroupKind { + return GroupVersion.WithKind(kind).GroupKind() +} + +// Resource takes an unqualified resource and returns a Group qualified GroupResource +// added for generated clientset +func Resource(resource string) schema.GroupResource { + return GroupVersion.WithResource(resource).GroupResource() +} diff --git a/third_party/pkg/apis/rabbitmq.com/v1beta1/permission_types.go b/third_party/pkg/apis/rabbitmq.com/v1beta1/permission_types.go new file mode 100644 index 0000000000..29c9cc7385 --- /dev/null +++ b/third_party/pkg/apis/rabbitmq.com/v1beta1/permission_types.go @@ -0,0 +1,77 @@ +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +// PermissionSpec defines the desired state of Permission +type PermissionSpec struct { + // Name of an existing user; required property. + // +kubebuilder:validation:Required + User string `json:"user"` + // Name of an existing vhost; required property. + // +kubebuilder:validation:Required + Vhost string `json:"vhost"` + // Permissions to grant to the user in the specific vhost; required property. + // See RabbitMQ doc for more information: https://www.rabbitmq.com/access-control.html#user-management + // +kubebuilder:validation:Required + Permissions VhostPermissions `json:"permissions"` + // Reference to the RabbitmqCluster that both the provided user and vhost are. + // Required property. + // +kubebuilder:validation:Required + RabbitmqClusterReference RabbitmqClusterReference `json:"rabbitmqClusterReference"` +} + +// Set of RabbitMQ permissions: configure, read and write. +// By not setting a property (configure/write/read), it result in an empty string which does not not match any permission. +type VhostPermissions struct { + // +kubebuilder:validation:Optional + Configure string `json:"configure,omitempty"` + // +kubebuilder:validation:Optional + Write string `json:"write,omitempty"` + // +kubebuilder:validation:Optional + Read string `json:"read,omitempty"` +} + +// PermissionStatus defines the observed state of Permission +type PermissionStatus struct { + // observedGeneration is the most recent successful generation observed for this Permission. It corresponds to the + // Permission's generation, which is updated on mutation by the API Server. + ObservedGeneration int64 `json:"observedGeneration,omitempty"` + Conditions []Condition `json:"conditions,omitempty"` +} + +// +genclient +// +kubebuilder:object:root=true +// +kubebuilder:resource:categories=all +// +kubebuilder:subresource:status + +// Permission is the Schema for the permissions API +type Permission struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec PermissionSpec `json:"spec,omitempty"` + Status PermissionStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// PermissionList contains a list of Permission +type PermissionList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []Permission `json:"items"` +} + +func (p *Permission) GroupResource() schema.GroupResource { + return schema.GroupResource{ + Group: p.GroupVersionKind().Group, + Resource: p.GroupVersionKind().Kind, + } +} + +func init() { + SchemeBuilder.Register(&Permission{}, &PermissionList{}) +} diff --git a/third_party/pkg/apis/rabbitmq.com/v1beta1/policy_types.go b/third_party/pkg/apis/rabbitmq.com/v1beta1/policy_types.go new file mode 100644 index 0000000000..2adba5b4da --- /dev/null +++ b/third_party/pkg/apis/rabbitmq.com/v1beta1/policy_types.go @@ -0,0 +1,81 @@ +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +// PolicySpec defines the desired state of Policy +// https://www.rabbitmq.com/parameters.html#policies +type PolicySpec struct { + // +kubebuilder:validation:Required + Name string `json:"name"` + // Default to vhost '/' + // +kubebuilder:default:=/ + Vhost string `json:"vhost,omitempty"` + // Regular expression pattern used to match queues and exchanges, e.g. "^amq.". + // Required property. + // +kubebuilder:validation:Required + Pattern string `json:"pattern"` + // What this policy applies to: 'queues', 'exchanges', or 'all'. + // Default to 'all'. + // +kubebuilder:validation:Enum=queues;exchanges;all + // +kubebuilder:default:=all + ApplyTo string `json:"applyTo,omitempty"` + // Default to '0'. + // In the event that more than one policy can match a given exchange or queue, the policy with the greatest priority applies. + // +kubebuilder:default:=0 + Priority int `json:"priority,omitempty"` + // Policy definition. Required property. + // +kubebuilder:validation:Type=object + // +kubebuilder:pruning:PreserveUnknownFields + // +kubebuilder:validation:Required + Definition *runtime.RawExtension `json:"definition"` + // Reference to the RabbitmqCluster that the exchange will be created in. + // Required property. + // +kubebuilder:validation:Required + RabbitmqClusterReference RabbitmqClusterReference `json:"rabbitmqClusterReference"` +} + +// PolicyStatus defines the observed state of Policy +type PolicyStatus struct { + // observedGeneration is the most recent successful generation observed for this Policy. It corresponds to the + // Policy's generation, which is updated on mutation by the API Server. + ObservedGeneration int64 `json:"observedGeneration,omitempty"` + Conditions []Condition `json:"conditions,omitempty"` +} + +// +genclient +// +kubebuilder:object:root=true +// +kubebuilder:resource:categories=all +// +kubebuilder:subresource:status + +// Policy is the Schema for the policies API +type Policy struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec PolicySpec `json:"spec,omitempty"` + Status PolicyStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// PolicyList contains a list of Policy +type PolicyList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []Policy `json:"items"` +} + +func (p *Policy) GroupResource() schema.GroupResource { + return schema.GroupResource{ + Group: p.GroupVersionKind().Group, + Resource: p.GroupVersionKind().Kind, + } +} + +func init() { + SchemeBuilder.Register(&Policy{}, &PolicyList{}) +} diff --git a/third_party/pkg/apis/rabbitmq.com/v1beta1/queue_types.go b/third_party/pkg/apis/rabbitmq.com/v1beta1/queue_types.go new file mode 100644 index 0000000000..f6b81d6362 --- /dev/null +++ b/third_party/pkg/apis/rabbitmq.com/v1beta1/queue_types.go @@ -0,0 +1,90 @@ +/* +RabbitMQ Messaging Topology Kubernetes Operator +Copyright 2021 VMware, Inc. + +This product is licensed to you under the Mozilla Public License 2.0 license (the "License"). You may not use this product except in compliance with the Mozilla 2.0 License. + +This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. +*/ + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +// using runtime.RawExtension to represent queue arguments +// interface{} is not currently supported by controller runtime +// recommendation is to use json.RawMessage or runtime.RawExtension to represent interface{} + +// QueueSpec defines the desired state of Queue +type QueueSpec struct { + // Name of the queue; required property + // +kubebuilder:validation:Required + Name string `json:"name"` + // Default to vhost '/' + // +kubebuilder:default:=/ + Vhost string `json:"vhost,omitempty"` + Type string `json:"type,omitempty"` + // When set to false queues does not survive server restart + Durable bool `json:"durable,omitempty"` + // when set to true, queues that has at least one consumer before, are deleted after last consumer unsubscribes + AutoDelete bool `json:"autoDelete,omitempty"` + // Queue arguments in the format of KEY: VALUE. e.g. x-delivery-limit: 10000 + // +kubebuilder:validation:Type=object + // +kubebuilder:pruning:PreserveUnknownFields + Arguments *runtime.RawExtension `json:"arguments,omitempty"` + // Reference to the RabbitmqCluster that the queue will be created in. + // Required property. + // +kubebuilder:validation:Required + RabbitmqClusterReference RabbitmqClusterReference `json:"rabbitmqClusterReference"` +} + +type RabbitmqClusterReference struct { + // +kubebuilder:validation:Required + Name string `json:"name"` +} + +// QueueStatus defines the observed state of Queue +type QueueStatus struct { + // observedGeneration is the most recent successful generation observed for this Queue. It corresponds to the + // Queue's generation, which is updated on mutation by the API Server. + ObservedGeneration int64 `json:"observedGeneration,omitempty"` + Conditions []Condition `json:"conditions,omitempty"` +} + +// +genclient +// +kubebuilder:object:root=true +// +kubebuilder:resource:categories=all +// +kubebuilder:subresource:status + +// Queue is the Schema for the queues API +type Queue struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec QueueSpec `json:"spec,omitempty"` + Status QueueStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// QueueList contains a list of Queue +type QueueList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []Queue `json:"items"` +} + +func (q *Queue) GroupResource() schema.GroupResource { + return schema.GroupResource{ + Group: q.GroupVersionKind().Group, + Resource: q.GroupVersionKind().Kind, + } +} + +func init() { + SchemeBuilder.Register(&Queue{}, &QueueList{}) +} diff --git a/third_party/pkg/apis/rabbitmq.com/v1beta1/schemareplication_types.go b/third_party/pkg/apis/rabbitmq.com/v1beta1/schemareplication_types.go new file mode 100644 index 0000000000..7c02651e69 --- /dev/null +++ b/third_party/pkg/apis/rabbitmq.com/v1beta1/schemareplication_types.go @@ -0,0 +1,71 @@ +/* +RabbitMQ Messaging Topology Kubernetes Operator +Copyright 2021 VMware, Inc. + +This product is licensed to you under the Mozilla Public License 2.0 license (the "License"). You may not use this product except in compliance with the Mozilla 2.0 License. + +This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. +*/ + +package v1beta1 + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +// SchemaReplicationSpec defines the desired state of SchemaReplication +type SchemaReplicationSpec struct { + // Reference to the RabbitmqCluster that schema replication would be set for. Must be an existing cluster. + // +kubebuilder:validation:Required + RabbitmqClusterReference RabbitmqClusterReference `json:"rabbitmqClusterReference"` + // Defines a Secret which contains credentials to be used for schema replication. + // The Secret must contain the keys `endpoints`, `username` and `password` in its Data field, or operator will error. + // `endpoints` should be one or multiple endpoints separated by ','. + // +kubebuilder:validation:Required + UpstreamSecret *corev1.LocalObjectReference `json:"upstreamSecret,omitempty"` +} + +// SchemaReplicationStatus defines the observed state of SchemaReplication +type SchemaReplicationStatus struct { + // observedGeneration is the most recent successful generation observed for this Queue. It corresponds to the + // Queue's generation, which is updated on mutation by the API Server. + ObservedGeneration int64 `json:"observedGeneration,omitempty"` + Conditions []Condition `json:"conditions,omitempty"` +} + +// +genclient +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status + +// SchemaReplication is the Schema for the schemareplications API +// This feature requires Tanzu RabbitMQ with schema replication plugin. +// For more information, see: https://tanzu.vmware.com/rabbitmq and https://www.rabbitmq.com/definitions-standby.html. +type SchemaReplication struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec SchemaReplicationSpec `json:"spec,omitempty"` + Status SchemaReplicationStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// SchemaReplicationList contains a list of SchemaReplication +type SchemaReplicationList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []SchemaReplication `json:"items"` +} + +func init() { + SchemeBuilder.Register(&SchemaReplication{}, &SchemaReplicationList{}) +} + +func (s *SchemaReplication) GroupResource() schema.GroupResource { + return schema.GroupResource{ + Group: s.GroupVersionKind().Group, + Resource: s.GroupVersionKind().Kind, + } +} diff --git a/third_party/pkg/apis/rabbitmq.com/v1beta1/user_types.go b/third_party/pkg/apis/rabbitmq.com/v1beta1/user_types.go new file mode 100644 index 0000000000..12481cc484 --- /dev/null +++ b/third_party/pkg/apis/rabbitmq.com/v1beta1/user_types.go @@ -0,0 +1,89 @@ +/* +RabbitMQ Messaging Topology Kubernetes Operator +Copyright 2021 VMware, Inc. + +This product is licensed to you under the Mozilla Public License 2.0 license (the "License"). You may not use this product except in compliance with the Mozilla 2.0 License. + +This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. +*/ + +package v1beta1 + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +// UserSpec defines the desired state of User. +type UserSpec struct { + // List of permissions tags to associate with the user. This determines the level of + // access to the RabbitMQ management UI granted to the user. Omitting this field will + // lead to a user than can still connect to the cluster through messaging protocols, + // but cannot perform any management actions. + // For more information, see https://www.rabbitmq.com/management.html#permissions. + Tags []UserTag `json:"tags,omitempty"` + // Reference to the RabbitmqCluster that the user will be created for. This cluster must + // exist for the User object to be created. + // +kubebuilder:validation:Required + RabbitmqClusterReference RabbitmqClusterReference `json:"rabbitmqClusterReference"` + // Defines a Secret used to pre-define the username and password set for this User. User objects created + // with this field set will not have randomly-generated credentials, and will instead import + // the username/password values from this Secret. + // The Secret must contain the keys `username` and `password` in its Data field, or the import will fail. + // Note that this import only occurs at creation time, and is ignored once a password has been set + // on a User. + ImportCredentialsSecret *corev1.LocalObjectReference `json:"importCredentialsSecret,omitempty"` +} + +// UserStatus defines the observed state of User. +type UserStatus struct { + // observedGeneration is the most recent successful generation observed for this User. It corresponds to the + // User's generation, which is updated on mutation by the API Server. + ObservedGeneration int64 `json:"observedGeneration,omitempty"` + Conditions []Condition `json:"conditions,omitempty"` + // Provides a reference to a Secret object containing the user credentials. + Credentials *corev1.LocalObjectReference `json:"credentials,omitempty"` +} + +// UserTag defines the level of access to the management UI allocated to the user. +// For more information, see https://www.rabbitmq.com/management.html#permissions. +// +kubebuilder:validation:Enum=management;policymaker;monitoring;administrator +type UserTag string + +// +genclient +// +kubebuilder:object:root=true +// +kubebuilder:resource:categories=all +// +kubebuilder:subresource:status + +// User is the Schema for the users API. +// +kubebuilder:subresource:status +type User struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + // Spec configures the desired state of the User object. + Spec UserSpec `json:"spec,omitempty"` + // Status exposes the observed state of the User object. + Status UserStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// UserList contains a list of Users. +type UserList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []User `json:"items"` +} + +func (u *User) GroupResource() schema.GroupResource { + return schema.GroupResource{ + Group: u.GroupVersionKind().Group, + Resource: u.GroupVersionKind().Kind, + } +} + +func init() { + SchemeBuilder.Register(&User{}, &UserList{}) +} diff --git a/third_party/pkg/apis/rabbitmq.com/v1beta1/vhost_types.go b/third_party/pkg/apis/rabbitmq.com/v1beta1/vhost_types.go new file mode 100644 index 0000000000..5e564179bf --- /dev/null +++ b/third_party/pkg/apis/rabbitmq.com/v1beta1/vhost_types.go @@ -0,0 +1,69 @@ +/* +RabbitMQ Messaging Topology Kubernetes Operator +Copyright 2021 VMware, Inc. + +This product is licensed to you under the Mozilla Public License 2.0 license (the "License"). You may not use this product except in compliance with the Mozilla 2.0 License. + +This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. +*/ + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +// VhostSpec defines the desired state of Vhost +type VhostSpec struct { + // Name of the vhost; see https://www.rabbitmq.com/vhosts.html. + // +kubebuilder:validation:Required + Name string `json:"name"` + Tracing bool `json:"tracing,omitempty"` + // Reference to the RabbitmqCluster that the vhost will be created in. + // Required property. + // +kubebuilder:validation:Required + RabbitmqClusterReference RabbitmqClusterReference `json:"rabbitmqClusterReference"` +} + +// VhostStatus defines the observed state of Vhost +type VhostStatus struct { + // observedGeneration is the most recent successful generation observed for this Vhost. It corresponds to the + // Vhost's generation, which is updated on mutation by the API Server. + ObservedGeneration int64 `json:"observedGeneration,omitempty"` + Conditions []Condition `json:"conditions,omitempty"` +} + +// +genclient +// +kubebuilder:object:root=true +// +kubebuilder:resource:categories=all +// +kubebuilder:subresource:status + +// Vhost is the Schema for the vhosts API +type Vhost struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec VhostSpec `json:"spec,omitempty"` + Status VhostStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// VhostList contains a list of Vhost +type VhostList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []Vhost `json:"items"` +} + +func (v *Vhost) GroupResource() schema.GroupResource { + return schema.GroupResource{ + Group: v.GroupVersionKind().Group, + Resource: v.GroupVersionKind().Kind, + } +} + +func init() { + SchemeBuilder.Register(&Vhost{}, &VhostList{}) +} diff --git a/third_party/pkg/apis/rabbitmq.com/v1beta1/zz_generated.deepcopy.go b/third_party/pkg/apis/rabbitmq.com/v1beta1/zz_generated.deepcopy.go new file mode 100644 index 0000000000..e8d5ea6499 --- /dev/null +++ b/third_party/pkg/apis/rabbitmq.com/v1beta1/zz_generated.deepcopy.go @@ -0,0 +1,882 @@ +// +build !ignore_autogenerated + +/* +RabbitMQ Messaging Topology Kubernetes Operator +Copyright 2021 VMware, Inc. + +This product is licensed to you under the Mozilla Public License 2.0 license (the "License"). You may not use this product except in compliance with the Mozilla 2.0 License. + +This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. +*/ + +// Code generated by controller-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Binding) DeepCopyInto(out *Binding) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Binding. +func (in *Binding) DeepCopy() *Binding { + if in == nil { + return nil + } + out := new(Binding) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Binding) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BindingList) DeepCopyInto(out *BindingList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Binding, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BindingList. +func (in *BindingList) DeepCopy() *BindingList { + if in == nil { + return nil + } + out := new(BindingList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *BindingList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BindingSpec) DeepCopyInto(out *BindingSpec) { + *out = *in + if in.Arguments != nil { + in, out := &in.Arguments, &out.Arguments + *out = new(runtime.RawExtension) + (*in).DeepCopyInto(*out) + } + out.RabbitmqClusterReference = in.RabbitmqClusterReference +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BindingSpec. +func (in *BindingSpec) DeepCopy() *BindingSpec { + if in == nil { + return nil + } + out := new(BindingSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BindingStatus) DeepCopyInto(out *BindingStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BindingStatus. +func (in *BindingStatus) DeepCopy() *BindingStatus { + if in == nil { + return nil + } + out := new(BindingStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Condition) DeepCopyInto(out *Condition) { + *out = *in + in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Condition. +func (in *Condition) DeepCopy() *Condition { + if in == nil { + return nil + } + out := new(Condition) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Exchange) DeepCopyInto(out *Exchange) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Exchange. +func (in *Exchange) DeepCopy() *Exchange { + if in == nil { + return nil + } + out := new(Exchange) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Exchange) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExchangeList) DeepCopyInto(out *ExchangeList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Exchange, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExchangeList. +func (in *ExchangeList) DeepCopy() *ExchangeList { + if in == nil { + return nil + } + out := new(ExchangeList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ExchangeList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExchangeSpec) DeepCopyInto(out *ExchangeSpec) { + *out = *in + if in.Arguments != nil { + in, out := &in.Arguments, &out.Arguments + *out = new(runtime.RawExtension) + (*in).DeepCopyInto(*out) + } + out.RabbitmqClusterReference = in.RabbitmqClusterReference +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExchangeSpec. +func (in *ExchangeSpec) DeepCopy() *ExchangeSpec { + if in == nil { + return nil + } + out := new(ExchangeSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExchangeStatus) DeepCopyInto(out *ExchangeStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExchangeStatus. +func (in *ExchangeStatus) DeepCopy() *ExchangeStatus { + if in == nil { + return nil + } + out := new(ExchangeStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Permission) DeepCopyInto(out *Permission) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Permission. +func (in *Permission) DeepCopy() *Permission { + if in == nil { + return nil + } + out := new(Permission) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Permission) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PermissionList) DeepCopyInto(out *PermissionList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Permission, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PermissionList. +func (in *PermissionList) DeepCopy() *PermissionList { + if in == nil { + return nil + } + out := new(PermissionList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PermissionList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PermissionSpec) DeepCopyInto(out *PermissionSpec) { + *out = *in + out.Permissions = in.Permissions + out.RabbitmqClusterReference = in.RabbitmqClusterReference +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PermissionSpec. +func (in *PermissionSpec) DeepCopy() *PermissionSpec { + if in == nil { + return nil + } + out := new(PermissionSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PermissionStatus) DeepCopyInto(out *PermissionStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PermissionStatus. +func (in *PermissionStatus) DeepCopy() *PermissionStatus { + if in == nil { + return nil + } + out := new(PermissionStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Policy) DeepCopyInto(out *Policy) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Policy. +func (in *Policy) DeepCopy() *Policy { + if in == nil { + return nil + } + out := new(Policy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Policy) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PolicyList) DeepCopyInto(out *PolicyList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Policy, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicyList. +func (in *PolicyList) DeepCopy() *PolicyList { + if in == nil { + return nil + } + out := new(PolicyList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PolicyList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PolicySpec) DeepCopyInto(out *PolicySpec) { + *out = *in + if in.Definition != nil { + in, out := &in.Definition, &out.Definition + *out = new(runtime.RawExtension) + (*in).DeepCopyInto(*out) + } + out.RabbitmqClusterReference = in.RabbitmqClusterReference +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicySpec. +func (in *PolicySpec) DeepCopy() *PolicySpec { + if in == nil { + return nil + } + out := new(PolicySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PolicyStatus) DeepCopyInto(out *PolicyStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicyStatus. +func (in *PolicyStatus) DeepCopy() *PolicyStatus { + if in == nil { + return nil + } + out := new(PolicyStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Queue) DeepCopyInto(out *Queue) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Queue. +func (in *Queue) DeepCopy() *Queue { + if in == nil { + return nil + } + out := new(Queue) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Queue) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *QueueList) DeepCopyInto(out *QueueList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Queue, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QueueList. +func (in *QueueList) DeepCopy() *QueueList { + if in == nil { + return nil + } + out := new(QueueList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *QueueList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *QueueSpec) DeepCopyInto(out *QueueSpec) { + *out = *in + if in.Arguments != nil { + in, out := &in.Arguments, &out.Arguments + *out = new(runtime.RawExtension) + (*in).DeepCopyInto(*out) + } + out.RabbitmqClusterReference = in.RabbitmqClusterReference +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QueueSpec. +func (in *QueueSpec) DeepCopy() *QueueSpec { + if in == nil { + return nil + } + out := new(QueueSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *QueueStatus) DeepCopyInto(out *QueueStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QueueStatus. +func (in *QueueStatus) DeepCopy() *QueueStatus { + if in == nil { + return nil + } + out := new(QueueStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RabbitmqClusterReference) DeepCopyInto(out *RabbitmqClusterReference) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RabbitmqClusterReference. +func (in *RabbitmqClusterReference) DeepCopy() *RabbitmqClusterReference { + if in == nil { + return nil + } + out := new(RabbitmqClusterReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SchemaReplication) DeepCopyInto(out *SchemaReplication) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SchemaReplication. +func (in *SchemaReplication) DeepCopy() *SchemaReplication { + if in == nil { + return nil + } + out := new(SchemaReplication) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *SchemaReplication) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SchemaReplicationList) DeepCopyInto(out *SchemaReplicationList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]SchemaReplication, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SchemaReplicationList. +func (in *SchemaReplicationList) DeepCopy() *SchemaReplicationList { + if in == nil { + return nil + } + out := new(SchemaReplicationList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *SchemaReplicationList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SchemaReplicationSpec) DeepCopyInto(out *SchemaReplicationSpec) { + *out = *in + out.RabbitmqClusterReference = in.RabbitmqClusterReference + if in.UpstreamSecret != nil { + in, out := &in.UpstreamSecret, &out.UpstreamSecret + *out = new(v1.LocalObjectReference) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SchemaReplicationSpec. +func (in *SchemaReplicationSpec) DeepCopy() *SchemaReplicationSpec { + if in == nil { + return nil + } + out := new(SchemaReplicationSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SchemaReplicationStatus) DeepCopyInto(out *SchemaReplicationStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SchemaReplicationStatus. +func (in *SchemaReplicationStatus) DeepCopy() *SchemaReplicationStatus { + if in == nil { + return nil + } + out := new(SchemaReplicationStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *User) DeepCopyInto(out *User) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new User. +func (in *User) DeepCopy() *User { + if in == nil { + return nil + } + out := new(User) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *User) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserList) DeepCopyInto(out *UserList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]User, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserList. +func (in *UserList) DeepCopy() *UserList { + if in == nil { + return nil + } + out := new(UserList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *UserList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserSpec) DeepCopyInto(out *UserSpec) { + *out = *in + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make([]UserTag, len(*in)) + copy(*out, *in) + } + out.RabbitmqClusterReference = in.RabbitmqClusterReference + if in.ImportCredentialsSecret != nil { + in, out := &in.ImportCredentialsSecret, &out.ImportCredentialsSecret + *out = new(v1.LocalObjectReference) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserSpec. +func (in *UserSpec) DeepCopy() *UserSpec { + if in == nil { + return nil + } + out := new(UserSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserStatus) DeepCopyInto(out *UserStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Credentials != nil { + in, out := &in.Credentials, &out.Credentials + *out = new(v1.LocalObjectReference) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserStatus. +func (in *UserStatus) DeepCopy() *UserStatus { + if in == nil { + return nil + } + out := new(UserStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Vhost) DeepCopyInto(out *Vhost) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Vhost. +func (in *Vhost) DeepCopy() *Vhost { + if in == nil { + return nil + } + out := new(Vhost) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Vhost) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VhostList) DeepCopyInto(out *VhostList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Vhost, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VhostList. +func (in *VhostList) DeepCopy() *VhostList { + if in == nil { + return nil + } + out := new(VhostList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VhostList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VhostPermissions) DeepCopyInto(out *VhostPermissions) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VhostPermissions. +func (in *VhostPermissions) DeepCopy() *VhostPermissions { + if in == nil { + return nil + } + out := new(VhostPermissions) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VhostSpec) DeepCopyInto(out *VhostSpec) { + *out = *in + out.RabbitmqClusterReference = in.RabbitmqClusterReference +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VhostSpec. +func (in *VhostSpec) DeepCopy() *VhostSpec { + if in == nil { + return nil + } + out := new(VhostSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VhostStatus) DeepCopyInto(out *VhostStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VhostStatus. +func (in *VhostStatus) DeepCopy() *VhostStatus { + if in == nil { + return nil + } + out := new(VhostStatus) + in.DeepCopyInto(out) + return out +} diff --git a/third_party/pkg/client/clientset/versioned/clientset.go b/third_party/pkg/client/clientset/versioned/clientset.go new file mode 100644 index 0000000000..38b30c08cf --- /dev/null +++ b/third_party/pkg/client/clientset/versioned/clientset.go @@ -0,0 +1,96 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package versioned + +import ( + "fmt" + + discovery "k8s.io/client-go/discovery" + rest "k8s.io/client-go/rest" + flowcontrol "k8s.io/client-go/util/flowcontrol" + rabbitmqv1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1" +) + +type Interface interface { + Discovery() discovery.DiscoveryInterface + RabbitmqV1beta1() rabbitmqv1beta1.RabbitmqV1beta1Interface +} + +// Clientset contains the clients for groups. Each group has exactly one +// version included in a Clientset. +type Clientset struct { + *discovery.DiscoveryClient + rabbitmqV1beta1 *rabbitmqv1beta1.RabbitmqV1beta1Client +} + +// RabbitmqV1beta1 retrieves the RabbitmqV1beta1Client +func (c *Clientset) RabbitmqV1beta1() rabbitmqv1beta1.RabbitmqV1beta1Interface { + return c.rabbitmqV1beta1 +} + +// Discovery retrieves the DiscoveryClient +func (c *Clientset) Discovery() discovery.DiscoveryInterface { + if c == nil { + return nil + } + return c.DiscoveryClient +} + +// NewForConfig creates a new Clientset for the given config. +// If config's RateLimiter is not set and QPS and Burst are acceptable, +// NewForConfig will generate a rate-limiter in configShallowCopy. +func NewForConfig(c *rest.Config) (*Clientset, error) { + configShallowCopy := *c + if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { + if configShallowCopy.Burst <= 0 { + return nil, fmt.Errorf("burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0") + } + configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) + } + var cs Clientset + var err error + cs.rabbitmqV1beta1, err = rabbitmqv1beta1.NewForConfig(&configShallowCopy) + if err != nil { + return nil, err + } + + cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy) + if err != nil { + return nil, err + } + return &cs, nil +} + +// NewForConfigOrDie creates a new Clientset for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *Clientset { + var cs Clientset + cs.rabbitmqV1beta1 = rabbitmqv1beta1.NewForConfigOrDie(c) + + cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) + return &cs +} + +// New creates a new Clientset for the given RESTClient. +func New(c rest.Interface) *Clientset { + var cs Clientset + cs.rabbitmqV1beta1 = rabbitmqv1beta1.New(c) + + cs.DiscoveryClient = discovery.NewDiscoveryClient(c) + return &cs +} diff --git a/third_party/pkg/client/clientset/versioned/doc.go b/third_party/pkg/client/clientset/versioned/doc.go new file mode 100644 index 0000000000..af79a9eec0 --- /dev/null +++ b/third_party/pkg/client/clientset/versioned/doc.go @@ -0,0 +1,19 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated clientset. +package versioned diff --git a/third_party/pkg/client/clientset/versioned/fake/clientset_generated.go b/third_party/pkg/client/clientset/versioned/fake/clientset_generated.go new file mode 100644 index 0000000000..cdafc00e71 --- /dev/null +++ b/third_party/pkg/client/clientset/versioned/fake/clientset_generated.go @@ -0,0 +1,81 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/discovery" + fakediscovery "k8s.io/client-go/discovery/fake" + "k8s.io/client-go/testing" + clientset "knative.dev/eventing-rabbitmq/third_party/pkg/client/clientset/versioned" + rabbitmqv1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1" + fakerabbitmqv1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/fake" +) + +// NewSimpleClientset returns a clientset that will respond with the provided objects. +// It's backed by a very simple object tracker that processes creates, updates and deletions as-is, +// without applying any validations and/or defaults. It shouldn't be considered a replacement +// for a real clientset and is mostly useful in simple unit tests. +func NewSimpleClientset(objects ...runtime.Object) *Clientset { + o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) + for _, obj := range objects { + if err := o.Add(obj); err != nil { + panic(err) + } + } + + cs := &Clientset{tracker: o} + cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} + cs.AddReactor("*", "*", testing.ObjectReaction(o)) + cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { + gvr := action.GetResource() + ns := action.GetNamespace() + watch, err := o.Watch(gvr, ns) + if err != nil { + return false, nil, err + } + return true, watch, nil + }) + + return cs +} + +// Clientset implements clientset.Interface. Meant to be embedded into a +// struct to get a default implementation. This makes faking out just the method +// you want to test easier. +type Clientset struct { + testing.Fake + discovery *fakediscovery.FakeDiscovery + tracker testing.ObjectTracker +} + +func (c *Clientset) Discovery() discovery.DiscoveryInterface { + return c.discovery +} + +func (c *Clientset) Tracker() testing.ObjectTracker { + return c.tracker +} + +var _ clientset.Interface = &Clientset{} + +// RabbitmqV1beta1 retrieves the RabbitmqV1beta1Client +func (c *Clientset) RabbitmqV1beta1() rabbitmqv1beta1.RabbitmqV1beta1Interface { + return &fakerabbitmqv1beta1.FakeRabbitmqV1beta1{Fake: &c.Fake} +} diff --git a/third_party/pkg/client/clientset/versioned/fake/doc.go b/third_party/pkg/client/clientset/versioned/fake/doc.go new file mode 100644 index 0000000000..ff6f2b02b9 --- /dev/null +++ b/third_party/pkg/client/clientset/versioned/fake/doc.go @@ -0,0 +1,19 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated fake clientset. +package fake diff --git a/third_party/pkg/client/clientset/versioned/fake/register.go b/third_party/pkg/client/clientset/versioned/fake/register.go new file mode 100644 index 0000000000..5f398db270 --- /dev/null +++ b/third_party/pkg/client/clientset/versioned/fake/register.go @@ -0,0 +1,55 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + serializer "k8s.io/apimachinery/pkg/runtime/serializer" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" + rabbitmqv1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/apis/rabbitmq.com/v1beta1" +) + +var scheme = runtime.NewScheme() +var codecs = serializer.NewCodecFactory(scheme) + +var localSchemeBuilder = runtime.SchemeBuilder{ + rabbitmqv1beta1.AddToScheme, +} + +// AddToScheme adds all types of this clientset into the given scheme. This allows composition +// of clientsets, like in: +// +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) +// +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// +// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types +// correctly. +var AddToScheme = localSchemeBuilder.AddToScheme + +func init() { + v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) + utilruntime.Must(AddToScheme(scheme)) +} diff --git a/third_party/pkg/client/clientset/versioned/scheme/doc.go b/third_party/pkg/client/clientset/versioned/scheme/doc.go new file mode 100644 index 0000000000..53d9b155f6 --- /dev/null +++ b/third_party/pkg/client/clientset/versioned/scheme/doc.go @@ -0,0 +1,19 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by client-gen. DO NOT EDIT. + +// This package contains the scheme of the automatically generated clientset. +package scheme diff --git a/third_party/pkg/client/clientset/versioned/scheme/register.go b/third_party/pkg/client/clientset/versioned/scheme/register.go new file mode 100644 index 0000000000..5abb2db82a --- /dev/null +++ b/third_party/pkg/client/clientset/versioned/scheme/register.go @@ -0,0 +1,55 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package scheme + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + serializer "k8s.io/apimachinery/pkg/runtime/serializer" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" + rabbitmqv1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/apis/rabbitmq.com/v1beta1" +) + +var Scheme = runtime.NewScheme() +var Codecs = serializer.NewCodecFactory(Scheme) +var ParameterCodec = runtime.NewParameterCodec(Scheme) +var localSchemeBuilder = runtime.SchemeBuilder{ + rabbitmqv1beta1.AddToScheme, +} + +// AddToScheme adds all types of this clientset into the given scheme. This allows composition +// of clientsets, like in: +// +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) +// +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// +// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types +// correctly. +var AddToScheme = localSchemeBuilder.AddToScheme + +func init() { + v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) + utilruntime.Must(AddToScheme(Scheme)) +} diff --git a/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/binding.go b/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/binding.go new file mode 100644 index 0000000000..9e3a52e3f2 --- /dev/null +++ b/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/binding.go @@ -0,0 +1,194 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + v1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/apis/rabbitmq.com/v1beta1" + scheme "knative.dev/eventing-rabbitmq/third_party/pkg/client/clientset/versioned/scheme" +) + +// BindingsGetter has a method to return a BindingInterface. +// A group's client should implement this interface. +type BindingsGetter interface { + Bindings(namespace string) BindingInterface +} + +// BindingInterface has methods to work with Binding resources. +type BindingInterface interface { + Create(ctx context.Context, binding *v1beta1.Binding, opts v1.CreateOptions) (*v1beta1.Binding, error) + Update(ctx context.Context, binding *v1beta1.Binding, opts v1.UpdateOptions) (*v1beta1.Binding, error) + UpdateStatus(ctx context.Context, binding *v1beta1.Binding, opts v1.UpdateOptions) (*v1beta1.Binding, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Binding, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.BindingList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Binding, err error) + BindingExpansion +} + +// bindings implements BindingInterface +type bindings struct { + client rest.Interface + ns string +} + +// newBindings returns a Bindings +func newBindings(c *RabbitmqV1beta1Client, namespace string) *bindings { + return &bindings{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the binding, and returns the corresponding binding object, and an error if there is any. +func (c *bindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Binding, err error) { + result = &v1beta1.Binding{} + err = c.client.Get(). + Namespace(c.ns). + Resource("bindings"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Bindings that match those selectors. +func (c *bindings) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.BindingList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.BindingList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("bindings"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested bindings. +func (c *bindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("bindings"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a binding and creates it. Returns the server's representation of the binding, and an error, if there is any. +func (c *bindings) Create(ctx context.Context, binding *v1beta1.Binding, opts v1.CreateOptions) (result *v1beta1.Binding, err error) { + result = &v1beta1.Binding{} + err = c.client.Post(). + Namespace(c.ns). + Resource("bindings"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(binding). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a binding and updates it. Returns the server's representation of the binding, and an error, if there is any. +func (c *bindings) Update(ctx context.Context, binding *v1beta1.Binding, opts v1.UpdateOptions) (result *v1beta1.Binding, err error) { + result = &v1beta1.Binding{} + err = c.client.Put(). + Namespace(c.ns). + Resource("bindings"). + Name(binding.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(binding). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *bindings) UpdateStatus(ctx context.Context, binding *v1beta1.Binding, opts v1.UpdateOptions) (result *v1beta1.Binding, err error) { + result = &v1beta1.Binding{} + err = c.client.Put(). + Namespace(c.ns). + Resource("bindings"). + Name(binding.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(binding). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the binding and deletes it. Returns an error if one occurs. +func (c *bindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("bindings"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *bindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("bindings"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched binding. +func (c *bindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Binding, err error) { + result = &v1beta1.Binding{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("bindings"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/doc.go b/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/doc.go new file mode 100644 index 0000000000..8e267fccb0 --- /dev/null +++ b/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/doc.go @@ -0,0 +1,19 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1beta1 diff --git a/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/exchange.go b/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/exchange.go new file mode 100644 index 0000000000..a74c4f7357 --- /dev/null +++ b/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/exchange.go @@ -0,0 +1,194 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + v1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/apis/rabbitmq.com/v1beta1" + scheme "knative.dev/eventing-rabbitmq/third_party/pkg/client/clientset/versioned/scheme" +) + +// ExchangesGetter has a method to return a ExchangeInterface. +// A group's client should implement this interface. +type ExchangesGetter interface { + Exchanges(namespace string) ExchangeInterface +} + +// ExchangeInterface has methods to work with Exchange resources. +type ExchangeInterface interface { + Create(ctx context.Context, exchange *v1beta1.Exchange, opts v1.CreateOptions) (*v1beta1.Exchange, error) + Update(ctx context.Context, exchange *v1beta1.Exchange, opts v1.UpdateOptions) (*v1beta1.Exchange, error) + UpdateStatus(ctx context.Context, exchange *v1beta1.Exchange, opts v1.UpdateOptions) (*v1beta1.Exchange, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Exchange, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ExchangeList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Exchange, err error) + ExchangeExpansion +} + +// exchanges implements ExchangeInterface +type exchanges struct { + client rest.Interface + ns string +} + +// newExchanges returns a Exchanges +func newExchanges(c *RabbitmqV1beta1Client, namespace string) *exchanges { + return &exchanges{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the exchange, and returns the corresponding exchange object, and an error if there is any. +func (c *exchanges) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Exchange, err error) { + result = &v1beta1.Exchange{} + err = c.client.Get(). + Namespace(c.ns). + Resource("exchanges"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Exchanges that match those selectors. +func (c *exchanges) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ExchangeList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.ExchangeList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("exchanges"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested exchanges. +func (c *exchanges) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("exchanges"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a exchange and creates it. Returns the server's representation of the exchange, and an error, if there is any. +func (c *exchanges) Create(ctx context.Context, exchange *v1beta1.Exchange, opts v1.CreateOptions) (result *v1beta1.Exchange, err error) { + result = &v1beta1.Exchange{} + err = c.client.Post(). + Namespace(c.ns). + Resource("exchanges"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(exchange). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a exchange and updates it. Returns the server's representation of the exchange, and an error, if there is any. +func (c *exchanges) Update(ctx context.Context, exchange *v1beta1.Exchange, opts v1.UpdateOptions) (result *v1beta1.Exchange, err error) { + result = &v1beta1.Exchange{} + err = c.client.Put(). + Namespace(c.ns). + Resource("exchanges"). + Name(exchange.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(exchange). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *exchanges) UpdateStatus(ctx context.Context, exchange *v1beta1.Exchange, opts v1.UpdateOptions) (result *v1beta1.Exchange, err error) { + result = &v1beta1.Exchange{} + err = c.client.Put(). + Namespace(c.ns). + Resource("exchanges"). + Name(exchange.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(exchange). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the exchange and deletes it. Returns an error if one occurs. +func (c *exchanges) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("exchanges"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *exchanges) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("exchanges"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched exchange. +func (c *exchanges) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Exchange, err error) { + result = &v1beta1.Exchange{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("exchanges"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/fake/doc.go b/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/fake/doc.go new file mode 100644 index 0000000000..bd5dce077b --- /dev/null +++ b/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/fake/doc.go @@ -0,0 +1,19 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/fake/fake_binding.go b/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/fake/fake_binding.go new file mode 100644 index 0000000000..b2723c3792 --- /dev/null +++ b/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/fake/fake_binding.go @@ -0,0 +1,141 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + v1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/apis/rabbitmq.com/v1beta1" +) + +// FakeBindings implements BindingInterface +type FakeBindings struct { + Fake *FakeRabbitmqV1beta1 + ns string +} + +var bindingsResource = schema.GroupVersionResource{Group: "rabbitmq.com", Version: "v1beta1", Resource: "bindings"} + +var bindingsKind = schema.GroupVersionKind{Group: "rabbitmq.com", Version: "v1beta1", Kind: "Binding"} + +// Get takes name of the binding, and returns the corresponding binding object, and an error if there is any. +func (c *FakeBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Binding, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(bindingsResource, c.ns, name), &v1beta1.Binding{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Binding), err +} + +// List takes label and field selectors, and returns the list of Bindings that match those selectors. +func (c *FakeBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.BindingList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(bindingsResource, bindingsKind, c.ns, opts), &v1beta1.BindingList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.BindingList{ListMeta: obj.(*v1beta1.BindingList).ListMeta} + for _, item := range obj.(*v1beta1.BindingList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested bindings. +func (c *FakeBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(bindingsResource, c.ns, opts)) + +} + +// Create takes the representation of a binding and creates it. Returns the server's representation of the binding, and an error, if there is any. +func (c *FakeBindings) Create(ctx context.Context, binding *v1beta1.Binding, opts v1.CreateOptions) (result *v1beta1.Binding, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(bindingsResource, c.ns, binding), &v1beta1.Binding{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Binding), err +} + +// Update takes the representation of a binding and updates it. Returns the server's representation of the binding, and an error, if there is any. +func (c *FakeBindings) Update(ctx context.Context, binding *v1beta1.Binding, opts v1.UpdateOptions) (result *v1beta1.Binding, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(bindingsResource, c.ns, binding), &v1beta1.Binding{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Binding), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeBindings) UpdateStatus(ctx context.Context, binding *v1beta1.Binding, opts v1.UpdateOptions) (*v1beta1.Binding, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(bindingsResource, "status", c.ns, binding), &v1beta1.Binding{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Binding), err +} + +// Delete takes name of the binding and deletes it. Returns an error if one occurs. +func (c *FakeBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(bindingsResource, c.ns, name), &v1beta1.Binding{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(bindingsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.BindingList{}) + return err +} + +// Patch applies the patch and returns the patched binding. +func (c *FakeBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Binding, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(bindingsResource, c.ns, name, pt, data, subresources...), &v1beta1.Binding{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Binding), err +} diff --git a/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/fake/fake_exchange.go b/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/fake/fake_exchange.go new file mode 100644 index 0000000000..a782be66dc --- /dev/null +++ b/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/fake/fake_exchange.go @@ -0,0 +1,141 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + v1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/apis/rabbitmq.com/v1beta1" +) + +// FakeExchanges implements ExchangeInterface +type FakeExchanges struct { + Fake *FakeRabbitmqV1beta1 + ns string +} + +var exchangesResource = schema.GroupVersionResource{Group: "rabbitmq.com", Version: "v1beta1", Resource: "exchanges"} + +var exchangesKind = schema.GroupVersionKind{Group: "rabbitmq.com", Version: "v1beta1", Kind: "Exchange"} + +// Get takes name of the exchange, and returns the corresponding exchange object, and an error if there is any. +func (c *FakeExchanges) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Exchange, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(exchangesResource, c.ns, name), &v1beta1.Exchange{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Exchange), err +} + +// List takes label and field selectors, and returns the list of Exchanges that match those selectors. +func (c *FakeExchanges) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ExchangeList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(exchangesResource, exchangesKind, c.ns, opts), &v1beta1.ExchangeList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.ExchangeList{ListMeta: obj.(*v1beta1.ExchangeList).ListMeta} + for _, item := range obj.(*v1beta1.ExchangeList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested exchanges. +func (c *FakeExchanges) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(exchangesResource, c.ns, opts)) + +} + +// Create takes the representation of a exchange and creates it. Returns the server's representation of the exchange, and an error, if there is any. +func (c *FakeExchanges) Create(ctx context.Context, exchange *v1beta1.Exchange, opts v1.CreateOptions) (result *v1beta1.Exchange, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(exchangesResource, c.ns, exchange), &v1beta1.Exchange{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Exchange), err +} + +// Update takes the representation of a exchange and updates it. Returns the server's representation of the exchange, and an error, if there is any. +func (c *FakeExchanges) Update(ctx context.Context, exchange *v1beta1.Exchange, opts v1.UpdateOptions) (result *v1beta1.Exchange, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(exchangesResource, c.ns, exchange), &v1beta1.Exchange{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Exchange), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeExchanges) UpdateStatus(ctx context.Context, exchange *v1beta1.Exchange, opts v1.UpdateOptions) (*v1beta1.Exchange, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(exchangesResource, "status", c.ns, exchange), &v1beta1.Exchange{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Exchange), err +} + +// Delete takes name of the exchange and deletes it. Returns an error if one occurs. +func (c *FakeExchanges) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(exchangesResource, c.ns, name), &v1beta1.Exchange{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeExchanges) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(exchangesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.ExchangeList{}) + return err +} + +// Patch applies the patch and returns the patched exchange. +func (c *FakeExchanges) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Exchange, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(exchangesResource, c.ns, name, pt, data, subresources...), &v1beta1.Exchange{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Exchange), err +} diff --git a/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/fake/fake_permission.go b/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/fake/fake_permission.go new file mode 100644 index 0000000000..b0879266fa --- /dev/null +++ b/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/fake/fake_permission.go @@ -0,0 +1,141 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + v1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/apis/rabbitmq.com/v1beta1" +) + +// FakePermissions implements PermissionInterface +type FakePermissions struct { + Fake *FakeRabbitmqV1beta1 + ns string +} + +var permissionsResource = schema.GroupVersionResource{Group: "rabbitmq.com", Version: "v1beta1", Resource: "permissions"} + +var permissionsKind = schema.GroupVersionKind{Group: "rabbitmq.com", Version: "v1beta1", Kind: "Permission"} + +// Get takes name of the permission, and returns the corresponding permission object, and an error if there is any. +func (c *FakePermissions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Permission, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(permissionsResource, c.ns, name), &v1beta1.Permission{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Permission), err +} + +// List takes label and field selectors, and returns the list of Permissions that match those selectors. +func (c *FakePermissions) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PermissionList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(permissionsResource, permissionsKind, c.ns, opts), &v1beta1.PermissionList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.PermissionList{ListMeta: obj.(*v1beta1.PermissionList).ListMeta} + for _, item := range obj.(*v1beta1.PermissionList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested permissions. +func (c *FakePermissions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(permissionsResource, c.ns, opts)) + +} + +// Create takes the representation of a permission and creates it. Returns the server's representation of the permission, and an error, if there is any. +func (c *FakePermissions) Create(ctx context.Context, permission *v1beta1.Permission, opts v1.CreateOptions) (result *v1beta1.Permission, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(permissionsResource, c.ns, permission), &v1beta1.Permission{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Permission), err +} + +// Update takes the representation of a permission and updates it. Returns the server's representation of the permission, and an error, if there is any. +func (c *FakePermissions) Update(ctx context.Context, permission *v1beta1.Permission, opts v1.UpdateOptions) (result *v1beta1.Permission, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(permissionsResource, c.ns, permission), &v1beta1.Permission{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Permission), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakePermissions) UpdateStatus(ctx context.Context, permission *v1beta1.Permission, opts v1.UpdateOptions) (*v1beta1.Permission, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(permissionsResource, "status", c.ns, permission), &v1beta1.Permission{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Permission), err +} + +// Delete takes name of the permission and deletes it. Returns an error if one occurs. +func (c *FakePermissions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(permissionsResource, c.ns, name), &v1beta1.Permission{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakePermissions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(permissionsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.PermissionList{}) + return err +} + +// Patch applies the patch and returns the patched permission. +func (c *FakePermissions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Permission, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(permissionsResource, c.ns, name, pt, data, subresources...), &v1beta1.Permission{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Permission), err +} diff --git a/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/fake/fake_policy.go b/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/fake/fake_policy.go new file mode 100644 index 0000000000..a2a2cbfa88 --- /dev/null +++ b/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/fake/fake_policy.go @@ -0,0 +1,141 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + v1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/apis/rabbitmq.com/v1beta1" +) + +// FakePolicies implements PolicyInterface +type FakePolicies struct { + Fake *FakeRabbitmqV1beta1 + ns string +} + +var policiesResource = schema.GroupVersionResource{Group: "rabbitmq.com", Version: "v1beta1", Resource: "policies"} + +var policiesKind = schema.GroupVersionKind{Group: "rabbitmq.com", Version: "v1beta1", Kind: "Policy"} + +// Get takes name of the policy, and returns the corresponding policy object, and an error if there is any. +func (c *FakePolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Policy, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(policiesResource, c.ns, name), &v1beta1.Policy{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Policy), err +} + +// List takes label and field selectors, and returns the list of Policies that match those selectors. +func (c *FakePolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PolicyList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(policiesResource, policiesKind, c.ns, opts), &v1beta1.PolicyList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.PolicyList{ListMeta: obj.(*v1beta1.PolicyList).ListMeta} + for _, item := range obj.(*v1beta1.PolicyList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested policies. +func (c *FakePolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(policiesResource, c.ns, opts)) + +} + +// Create takes the representation of a policy and creates it. Returns the server's representation of the policy, and an error, if there is any. +func (c *FakePolicies) Create(ctx context.Context, policy *v1beta1.Policy, opts v1.CreateOptions) (result *v1beta1.Policy, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(policiesResource, c.ns, policy), &v1beta1.Policy{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Policy), err +} + +// Update takes the representation of a policy and updates it. Returns the server's representation of the policy, and an error, if there is any. +func (c *FakePolicies) Update(ctx context.Context, policy *v1beta1.Policy, opts v1.UpdateOptions) (result *v1beta1.Policy, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(policiesResource, c.ns, policy), &v1beta1.Policy{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Policy), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakePolicies) UpdateStatus(ctx context.Context, policy *v1beta1.Policy, opts v1.UpdateOptions) (*v1beta1.Policy, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(policiesResource, "status", c.ns, policy), &v1beta1.Policy{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Policy), err +} + +// Delete takes name of the policy and deletes it. Returns an error if one occurs. +func (c *FakePolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(policiesResource, c.ns, name), &v1beta1.Policy{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakePolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(policiesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.PolicyList{}) + return err +} + +// Patch applies the patch and returns the patched policy. +func (c *FakePolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Policy, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(policiesResource, c.ns, name, pt, data, subresources...), &v1beta1.Policy{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Policy), err +} diff --git a/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/fake/fake_queue.go b/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/fake/fake_queue.go new file mode 100644 index 0000000000..7b0270eebf --- /dev/null +++ b/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/fake/fake_queue.go @@ -0,0 +1,141 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + v1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/apis/rabbitmq.com/v1beta1" +) + +// FakeQueues implements QueueInterface +type FakeQueues struct { + Fake *FakeRabbitmqV1beta1 + ns string +} + +var queuesResource = schema.GroupVersionResource{Group: "rabbitmq.com", Version: "v1beta1", Resource: "queues"} + +var queuesKind = schema.GroupVersionKind{Group: "rabbitmq.com", Version: "v1beta1", Kind: "Queue"} + +// Get takes name of the queue, and returns the corresponding queue object, and an error if there is any. +func (c *FakeQueues) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Queue, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(queuesResource, c.ns, name), &v1beta1.Queue{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Queue), err +} + +// List takes label and field selectors, and returns the list of Queues that match those selectors. +func (c *FakeQueues) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.QueueList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(queuesResource, queuesKind, c.ns, opts), &v1beta1.QueueList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.QueueList{ListMeta: obj.(*v1beta1.QueueList).ListMeta} + for _, item := range obj.(*v1beta1.QueueList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested queues. +func (c *FakeQueues) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(queuesResource, c.ns, opts)) + +} + +// Create takes the representation of a queue and creates it. Returns the server's representation of the queue, and an error, if there is any. +func (c *FakeQueues) Create(ctx context.Context, queue *v1beta1.Queue, opts v1.CreateOptions) (result *v1beta1.Queue, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(queuesResource, c.ns, queue), &v1beta1.Queue{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Queue), err +} + +// Update takes the representation of a queue and updates it. Returns the server's representation of the queue, and an error, if there is any. +func (c *FakeQueues) Update(ctx context.Context, queue *v1beta1.Queue, opts v1.UpdateOptions) (result *v1beta1.Queue, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(queuesResource, c.ns, queue), &v1beta1.Queue{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Queue), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeQueues) UpdateStatus(ctx context.Context, queue *v1beta1.Queue, opts v1.UpdateOptions) (*v1beta1.Queue, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(queuesResource, "status", c.ns, queue), &v1beta1.Queue{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Queue), err +} + +// Delete takes name of the queue and deletes it. Returns an error if one occurs. +func (c *FakeQueues) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(queuesResource, c.ns, name), &v1beta1.Queue{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeQueues) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(queuesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.QueueList{}) + return err +} + +// Patch applies the patch and returns the patched queue. +func (c *FakeQueues) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Queue, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(queuesResource, c.ns, name, pt, data, subresources...), &v1beta1.Queue{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Queue), err +} diff --git a/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/fake/fake_rabbitmq.com_client.go b/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/fake/fake_rabbitmq.com_client.go new file mode 100644 index 0000000000..45b30bb792 --- /dev/null +++ b/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/fake/fake_rabbitmq.com_client.go @@ -0,0 +1,67 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" + v1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1" +) + +type FakeRabbitmqV1beta1 struct { + *testing.Fake +} + +func (c *FakeRabbitmqV1beta1) Bindings(namespace string) v1beta1.BindingInterface { + return &FakeBindings{c, namespace} +} + +func (c *FakeRabbitmqV1beta1) Exchanges(namespace string) v1beta1.ExchangeInterface { + return &FakeExchanges{c, namespace} +} + +func (c *FakeRabbitmqV1beta1) Permissions(namespace string) v1beta1.PermissionInterface { + return &FakePermissions{c, namespace} +} + +func (c *FakeRabbitmqV1beta1) Policies(namespace string) v1beta1.PolicyInterface { + return &FakePolicies{c, namespace} +} + +func (c *FakeRabbitmqV1beta1) Queues(namespace string) v1beta1.QueueInterface { + return &FakeQueues{c, namespace} +} + +func (c *FakeRabbitmqV1beta1) SchemaReplications(namespace string) v1beta1.SchemaReplicationInterface { + return &FakeSchemaReplications{c, namespace} +} + +func (c *FakeRabbitmqV1beta1) Users(namespace string) v1beta1.UserInterface { + return &FakeUsers{c, namespace} +} + +func (c *FakeRabbitmqV1beta1) Vhosts(namespace string) v1beta1.VhostInterface { + return &FakeVhosts{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeRabbitmqV1beta1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/fake/fake_schemareplication.go b/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/fake/fake_schemareplication.go new file mode 100644 index 0000000000..47bcf81e73 --- /dev/null +++ b/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/fake/fake_schemareplication.go @@ -0,0 +1,141 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + v1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/apis/rabbitmq.com/v1beta1" +) + +// FakeSchemaReplications implements SchemaReplicationInterface +type FakeSchemaReplications struct { + Fake *FakeRabbitmqV1beta1 + ns string +} + +var schemareplicationsResource = schema.GroupVersionResource{Group: "rabbitmq.com", Version: "v1beta1", Resource: "schemareplications"} + +var schemareplicationsKind = schema.GroupVersionKind{Group: "rabbitmq.com", Version: "v1beta1", Kind: "SchemaReplication"} + +// Get takes name of the schemaReplication, and returns the corresponding schemaReplication object, and an error if there is any. +func (c *FakeSchemaReplications) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.SchemaReplication, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(schemareplicationsResource, c.ns, name), &v1beta1.SchemaReplication{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.SchemaReplication), err +} + +// List takes label and field selectors, and returns the list of SchemaReplications that match those selectors. +func (c *FakeSchemaReplications) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.SchemaReplicationList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(schemareplicationsResource, schemareplicationsKind, c.ns, opts), &v1beta1.SchemaReplicationList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.SchemaReplicationList{ListMeta: obj.(*v1beta1.SchemaReplicationList).ListMeta} + for _, item := range obj.(*v1beta1.SchemaReplicationList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested schemaReplications. +func (c *FakeSchemaReplications) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(schemareplicationsResource, c.ns, opts)) + +} + +// Create takes the representation of a schemaReplication and creates it. Returns the server's representation of the schemaReplication, and an error, if there is any. +func (c *FakeSchemaReplications) Create(ctx context.Context, schemaReplication *v1beta1.SchemaReplication, opts v1.CreateOptions) (result *v1beta1.SchemaReplication, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(schemareplicationsResource, c.ns, schemaReplication), &v1beta1.SchemaReplication{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.SchemaReplication), err +} + +// Update takes the representation of a schemaReplication and updates it. Returns the server's representation of the schemaReplication, and an error, if there is any. +func (c *FakeSchemaReplications) Update(ctx context.Context, schemaReplication *v1beta1.SchemaReplication, opts v1.UpdateOptions) (result *v1beta1.SchemaReplication, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(schemareplicationsResource, c.ns, schemaReplication), &v1beta1.SchemaReplication{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.SchemaReplication), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeSchemaReplications) UpdateStatus(ctx context.Context, schemaReplication *v1beta1.SchemaReplication, opts v1.UpdateOptions) (*v1beta1.SchemaReplication, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(schemareplicationsResource, "status", c.ns, schemaReplication), &v1beta1.SchemaReplication{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.SchemaReplication), err +} + +// Delete takes name of the schemaReplication and deletes it. Returns an error if one occurs. +func (c *FakeSchemaReplications) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(schemareplicationsResource, c.ns, name), &v1beta1.SchemaReplication{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeSchemaReplications) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(schemareplicationsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.SchemaReplicationList{}) + return err +} + +// Patch applies the patch and returns the patched schemaReplication. +func (c *FakeSchemaReplications) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.SchemaReplication, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(schemareplicationsResource, c.ns, name, pt, data, subresources...), &v1beta1.SchemaReplication{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.SchemaReplication), err +} diff --git a/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/fake/fake_user.go b/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/fake/fake_user.go new file mode 100644 index 0000000000..1c84932561 --- /dev/null +++ b/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/fake/fake_user.go @@ -0,0 +1,141 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + v1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/apis/rabbitmq.com/v1beta1" +) + +// FakeUsers implements UserInterface +type FakeUsers struct { + Fake *FakeRabbitmqV1beta1 + ns string +} + +var usersResource = schema.GroupVersionResource{Group: "rabbitmq.com", Version: "v1beta1", Resource: "users"} + +var usersKind = schema.GroupVersionKind{Group: "rabbitmq.com", Version: "v1beta1", Kind: "User"} + +// Get takes name of the user, and returns the corresponding user object, and an error if there is any. +func (c *FakeUsers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.User, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(usersResource, c.ns, name), &v1beta1.User{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.User), err +} + +// List takes label and field selectors, and returns the list of Users that match those selectors. +func (c *FakeUsers) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.UserList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(usersResource, usersKind, c.ns, opts), &v1beta1.UserList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.UserList{ListMeta: obj.(*v1beta1.UserList).ListMeta} + for _, item := range obj.(*v1beta1.UserList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested users. +func (c *FakeUsers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(usersResource, c.ns, opts)) + +} + +// Create takes the representation of a user and creates it. Returns the server's representation of the user, and an error, if there is any. +func (c *FakeUsers) Create(ctx context.Context, user *v1beta1.User, opts v1.CreateOptions) (result *v1beta1.User, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(usersResource, c.ns, user), &v1beta1.User{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.User), err +} + +// Update takes the representation of a user and updates it. Returns the server's representation of the user, and an error, if there is any. +func (c *FakeUsers) Update(ctx context.Context, user *v1beta1.User, opts v1.UpdateOptions) (result *v1beta1.User, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(usersResource, c.ns, user), &v1beta1.User{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.User), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeUsers) UpdateStatus(ctx context.Context, user *v1beta1.User, opts v1.UpdateOptions) (*v1beta1.User, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(usersResource, "status", c.ns, user), &v1beta1.User{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.User), err +} + +// Delete takes name of the user and deletes it. Returns an error if one occurs. +func (c *FakeUsers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(usersResource, c.ns, name), &v1beta1.User{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeUsers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(usersResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.UserList{}) + return err +} + +// Patch applies the patch and returns the patched user. +func (c *FakeUsers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.User, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(usersResource, c.ns, name, pt, data, subresources...), &v1beta1.User{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.User), err +} diff --git a/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/fake/fake_vhost.go b/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/fake/fake_vhost.go new file mode 100644 index 0000000000..33290c65dd --- /dev/null +++ b/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/fake/fake_vhost.go @@ -0,0 +1,141 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + v1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/apis/rabbitmq.com/v1beta1" +) + +// FakeVhosts implements VhostInterface +type FakeVhosts struct { + Fake *FakeRabbitmqV1beta1 + ns string +} + +var vhostsResource = schema.GroupVersionResource{Group: "rabbitmq.com", Version: "v1beta1", Resource: "vhosts"} + +var vhostsKind = schema.GroupVersionKind{Group: "rabbitmq.com", Version: "v1beta1", Kind: "Vhost"} + +// Get takes name of the vhost, and returns the corresponding vhost object, and an error if there is any. +func (c *FakeVhosts) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Vhost, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(vhostsResource, c.ns, name), &v1beta1.Vhost{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Vhost), err +} + +// List takes label and field selectors, and returns the list of Vhosts that match those selectors. +func (c *FakeVhosts) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VhostList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(vhostsResource, vhostsKind, c.ns, opts), &v1beta1.VhostList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.VhostList{ListMeta: obj.(*v1beta1.VhostList).ListMeta} + for _, item := range obj.(*v1beta1.VhostList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested vhosts. +func (c *FakeVhosts) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(vhostsResource, c.ns, opts)) + +} + +// Create takes the representation of a vhost and creates it. Returns the server's representation of the vhost, and an error, if there is any. +func (c *FakeVhosts) Create(ctx context.Context, vhost *v1beta1.Vhost, opts v1.CreateOptions) (result *v1beta1.Vhost, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(vhostsResource, c.ns, vhost), &v1beta1.Vhost{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Vhost), err +} + +// Update takes the representation of a vhost and updates it. Returns the server's representation of the vhost, and an error, if there is any. +func (c *FakeVhosts) Update(ctx context.Context, vhost *v1beta1.Vhost, opts v1.UpdateOptions) (result *v1beta1.Vhost, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(vhostsResource, c.ns, vhost), &v1beta1.Vhost{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Vhost), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeVhosts) UpdateStatus(ctx context.Context, vhost *v1beta1.Vhost, opts v1.UpdateOptions) (*v1beta1.Vhost, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(vhostsResource, "status", c.ns, vhost), &v1beta1.Vhost{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Vhost), err +} + +// Delete takes name of the vhost and deletes it. Returns an error if one occurs. +func (c *FakeVhosts) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(vhostsResource, c.ns, name), &v1beta1.Vhost{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeVhosts) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(vhostsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.VhostList{}) + return err +} + +// Patch applies the patch and returns the patched vhost. +func (c *FakeVhosts) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Vhost, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(vhostsResource, c.ns, name, pt, data, subresources...), &v1beta1.Vhost{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Vhost), err +} diff --git a/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/generated_expansion.go b/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/generated_expansion.go new file mode 100644 index 0000000000..7af45035c6 --- /dev/null +++ b/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/generated_expansion.go @@ -0,0 +1,34 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package v1beta1 + +type BindingExpansion interface{} + +type ExchangeExpansion interface{} + +type PermissionExpansion interface{} + +type PolicyExpansion interface{} + +type QueueExpansion interface{} + +type SchemaReplicationExpansion interface{} + +type UserExpansion interface{} + +type VhostExpansion interface{} diff --git a/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/permission.go b/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/permission.go new file mode 100644 index 0000000000..b97758a753 --- /dev/null +++ b/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/permission.go @@ -0,0 +1,194 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + v1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/apis/rabbitmq.com/v1beta1" + scheme "knative.dev/eventing-rabbitmq/third_party/pkg/client/clientset/versioned/scheme" +) + +// PermissionsGetter has a method to return a PermissionInterface. +// A group's client should implement this interface. +type PermissionsGetter interface { + Permissions(namespace string) PermissionInterface +} + +// PermissionInterface has methods to work with Permission resources. +type PermissionInterface interface { + Create(ctx context.Context, permission *v1beta1.Permission, opts v1.CreateOptions) (*v1beta1.Permission, error) + Update(ctx context.Context, permission *v1beta1.Permission, opts v1.UpdateOptions) (*v1beta1.Permission, error) + UpdateStatus(ctx context.Context, permission *v1beta1.Permission, opts v1.UpdateOptions) (*v1beta1.Permission, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Permission, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.PermissionList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Permission, err error) + PermissionExpansion +} + +// permissions implements PermissionInterface +type permissions struct { + client rest.Interface + ns string +} + +// newPermissions returns a Permissions +func newPermissions(c *RabbitmqV1beta1Client, namespace string) *permissions { + return &permissions{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the permission, and returns the corresponding permission object, and an error if there is any. +func (c *permissions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Permission, err error) { + result = &v1beta1.Permission{} + err = c.client.Get(). + Namespace(c.ns). + Resource("permissions"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Permissions that match those selectors. +func (c *permissions) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PermissionList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.PermissionList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("permissions"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested permissions. +func (c *permissions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("permissions"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a permission and creates it. Returns the server's representation of the permission, and an error, if there is any. +func (c *permissions) Create(ctx context.Context, permission *v1beta1.Permission, opts v1.CreateOptions) (result *v1beta1.Permission, err error) { + result = &v1beta1.Permission{} + err = c.client.Post(). + Namespace(c.ns). + Resource("permissions"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(permission). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a permission and updates it. Returns the server's representation of the permission, and an error, if there is any. +func (c *permissions) Update(ctx context.Context, permission *v1beta1.Permission, opts v1.UpdateOptions) (result *v1beta1.Permission, err error) { + result = &v1beta1.Permission{} + err = c.client.Put(). + Namespace(c.ns). + Resource("permissions"). + Name(permission.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(permission). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *permissions) UpdateStatus(ctx context.Context, permission *v1beta1.Permission, opts v1.UpdateOptions) (result *v1beta1.Permission, err error) { + result = &v1beta1.Permission{} + err = c.client.Put(). + Namespace(c.ns). + Resource("permissions"). + Name(permission.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(permission). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the permission and deletes it. Returns an error if one occurs. +func (c *permissions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("permissions"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *permissions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("permissions"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched permission. +func (c *permissions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Permission, err error) { + result = &v1beta1.Permission{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("permissions"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/policy.go b/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/policy.go new file mode 100644 index 0000000000..b59d23c485 --- /dev/null +++ b/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/policy.go @@ -0,0 +1,194 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + v1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/apis/rabbitmq.com/v1beta1" + scheme "knative.dev/eventing-rabbitmq/third_party/pkg/client/clientset/versioned/scheme" +) + +// PoliciesGetter has a method to return a PolicyInterface. +// A group's client should implement this interface. +type PoliciesGetter interface { + Policies(namespace string) PolicyInterface +} + +// PolicyInterface has methods to work with Policy resources. +type PolicyInterface interface { + Create(ctx context.Context, policy *v1beta1.Policy, opts v1.CreateOptions) (*v1beta1.Policy, error) + Update(ctx context.Context, policy *v1beta1.Policy, opts v1.UpdateOptions) (*v1beta1.Policy, error) + UpdateStatus(ctx context.Context, policy *v1beta1.Policy, opts v1.UpdateOptions) (*v1beta1.Policy, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Policy, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.PolicyList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Policy, err error) + PolicyExpansion +} + +// policies implements PolicyInterface +type policies struct { + client rest.Interface + ns string +} + +// newPolicies returns a Policies +func newPolicies(c *RabbitmqV1beta1Client, namespace string) *policies { + return &policies{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the policy, and returns the corresponding policy object, and an error if there is any. +func (c *policies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Policy, err error) { + result = &v1beta1.Policy{} + err = c.client.Get(). + Namespace(c.ns). + Resource("policies"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Policies that match those selectors. +func (c *policies) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PolicyList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.PolicyList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("policies"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested policies. +func (c *policies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("policies"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a policy and creates it. Returns the server's representation of the policy, and an error, if there is any. +func (c *policies) Create(ctx context.Context, policy *v1beta1.Policy, opts v1.CreateOptions) (result *v1beta1.Policy, err error) { + result = &v1beta1.Policy{} + err = c.client.Post(). + Namespace(c.ns). + Resource("policies"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(policy). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a policy and updates it. Returns the server's representation of the policy, and an error, if there is any. +func (c *policies) Update(ctx context.Context, policy *v1beta1.Policy, opts v1.UpdateOptions) (result *v1beta1.Policy, err error) { + result = &v1beta1.Policy{} + err = c.client.Put(). + Namespace(c.ns). + Resource("policies"). + Name(policy.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(policy). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *policies) UpdateStatus(ctx context.Context, policy *v1beta1.Policy, opts v1.UpdateOptions) (result *v1beta1.Policy, err error) { + result = &v1beta1.Policy{} + err = c.client.Put(). + Namespace(c.ns). + Resource("policies"). + Name(policy.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(policy). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the policy and deletes it. Returns an error if one occurs. +func (c *policies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("policies"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *policies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("policies"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched policy. +func (c *policies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Policy, err error) { + result = &v1beta1.Policy{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("policies"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/queue.go b/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/queue.go new file mode 100644 index 0000000000..ead63da0c8 --- /dev/null +++ b/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/queue.go @@ -0,0 +1,194 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + v1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/apis/rabbitmq.com/v1beta1" + scheme "knative.dev/eventing-rabbitmq/third_party/pkg/client/clientset/versioned/scheme" +) + +// QueuesGetter has a method to return a QueueInterface. +// A group's client should implement this interface. +type QueuesGetter interface { + Queues(namespace string) QueueInterface +} + +// QueueInterface has methods to work with Queue resources. +type QueueInterface interface { + Create(ctx context.Context, queue *v1beta1.Queue, opts v1.CreateOptions) (*v1beta1.Queue, error) + Update(ctx context.Context, queue *v1beta1.Queue, opts v1.UpdateOptions) (*v1beta1.Queue, error) + UpdateStatus(ctx context.Context, queue *v1beta1.Queue, opts v1.UpdateOptions) (*v1beta1.Queue, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Queue, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.QueueList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Queue, err error) + QueueExpansion +} + +// queues implements QueueInterface +type queues struct { + client rest.Interface + ns string +} + +// newQueues returns a Queues +func newQueues(c *RabbitmqV1beta1Client, namespace string) *queues { + return &queues{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the queue, and returns the corresponding queue object, and an error if there is any. +func (c *queues) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Queue, err error) { + result = &v1beta1.Queue{} + err = c.client.Get(). + Namespace(c.ns). + Resource("queues"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Queues that match those selectors. +func (c *queues) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.QueueList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.QueueList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("queues"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested queues. +func (c *queues) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("queues"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a queue and creates it. Returns the server's representation of the queue, and an error, if there is any. +func (c *queues) Create(ctx context.Context, queue *v1beta1.Queue, opts v1.CreateOptions) (result *v1beta1.Queue, err error) { + result = &v1beta1.Queue{} + err = c.client.Post(). + Namespace(c.ns). + Resource("queues"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(queue). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a queue and updates it. Returns the server's representation of the queue, and an error, if there is any. +func (c *queues) Update(ctx context.Context, queue *v1beta1.Queue, opts v1.UpdateOptions) (result *v1beta1.Queue, err error) { + result = &v1beta1.Queue{} + err = c.client.Put(). + Namespace(c.ns). + Resource("queues"). + Name(queue.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(queue). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *queues) UpdateStatus(ctx context.Context, queue *v1beta1.Queue, opts v1.UpdateOptions) (result *v1beta1.Queue, err error) { + result = &v1beta1.Queue{} + err = c.client.Put(). + Namespace(c.ns). + Resource("queues"). + Name(queue.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(queue). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the queue and deletes it. Returns an error if one occurs. +func (c *queues) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("queues"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *queues) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("queues"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched queue. +func (c *queues) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Queue, err error) { + result = &v1beta1.Queue{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("queues"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/rabbitmq.com_client.go b/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/rabbitmq.com_client.go new file mode 100644 index 0000000000..3350f83b0a --- /dev/null +++ b/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/rabbitmq.com_client.go @@ -0,0 +1,123 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package v1beta1 + +import ( + rest "k8s.io/client-go/rest" + v1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/apis/rabbitmq.com/v1beta1" + "knative.dev/eventing-rabbitmq/third_party/pkg/client/clientset/versioned/scheme" +) + +type RabbitmqV1beta1Interface interface { + RESTClient() rest.Interface + BindingsGetter + ExchangesGetter + PermissionsGetter + PoliciesGetter + QueuesGetter + SchemaReplicationsGetter + UsersGetter + VhostsGetter +} + +// RabbitmqV1beta1Client is used to interact with features provided by the rabbitmq.com group. +type RabbitmqV1beta1Client struct { + restClient rest.Interface +} + +func (c *RabbitmqV1beta1Client) Bindings(namespace string) BindingInterface { + return newBindings(c, namespace) +} + +func (c *RabbitmqV1beta1Client) Exchanges(namespace string) ExchangeInterface { + return newExchanges(c, namespace) +} + +func (c *RabbitmqV1beta1Client) Permissions(namespace string) PermissionInterface { + return newPermissions(c, namespace) +} + +func (c *RabbitmqV1beta1Client) Policies(namespace string) PolicyInterface { + return newPolicies(c, namespace) +} + +func (c *RabbitmqV1beta1Client) Queues(namespace string) QueueInterface { + return newQueues(c, namespace) +} + +func (c *RabbitmqV1beta1Client) SchemaReplications(namespace string) SchemaReplicationInterface { + return newSchemaReplications(c, namespace) +} + +func (c *RabbitmqV1beta1Client) Users(namespace string) UserInterface { + return newUsers(c, namespace) +} + +func (c *RabbitmqV1beta1Client) Vhosts(namespace string) VhostInterface { + return newVhosts(c, namespace) +} + +// NewForConfig creates a new RabbitmqV1beta1Client for the given config. +func NewForConfig(c *rest.Config) (*RabbitmqV1beta1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientFor(&config) + if err != nil { + return nil, err + } + return &RabbitmqV1beta1Client{client}, nil +} + +// NewForConfigOrDie creates a new RabbitmqV1beta1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *RabbitmqV1beta1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new RabbitmqV1beta1Client for the given RESTClient. +func New(c rest.Interface) *RabbitmqV1beta1Client { + return &RabbitmqV1beta1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1beta1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *RabbitmqV1beta1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/schemareplication.go b/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/schemareplication.go new file mode 100644 index 0000000000..89c77f725d --- /dev/null +++ b/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/schemareplication.go @@ -0,0 +1,194 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + v1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/apis/rabbitmq.com/v1beta1" + scheme "knative.dev/eventing-rabbitmq/third_party/pkg/client/clientset/versioned/scheme" +) + +// SchemaReplicationsGetter has a method to return a SchemaReplicationInterface. +// A group's client should implement this interface. +type SchemaReplicationsGetter interface { + SchemaReplications(namespace string) SchemaReplicationInterface +} + +// SchemaReplicationInterface has methods to work with SchemaReplication resources. +type SchemaReplicationInterface interface { + Create(ctx context.Context, schemaReplication *v1beta1.SchemaReplication, opts v1.CreateOptions) (*v1beta1.SchemaReplication, error) + Update(ctx context.Context, schemaReplication *v1beta1.SchemaReplication, opts v1.UpdateOptions) (*v1beta1.SchemaReplication, error) + UpdateStatus(ctx context.Context, schemaReplication *v1beta1.SchemaReplication, opts v1.UpdateOptions) (*v1beta1.SchemaReplication, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.SchemaReplication, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.SchemaReplicationList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.SchemaReplication, err error) + SchemaReplicationExpansion +} + +// schemaReplications implements SchemaReplicationInterface +type schemaReplications struct { + client rest.Interface + ns string +} + +// newSchemaReplications returns a SchemaReplications +func newSchemaReplications(c *RabbitmqV1beta1Client, namespace string) *schemaReplications { + return &schemaReplications{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the schemaReplication, and returns the corresponding schemaReplication object, and an error if there is any. +func (c *schemaReplications) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.SchemaReplication, err error) { + result = &v1beta1.SchemaReplication{} + err = c.client.Get(). + Namespace(c.ns). + Resource("schemareplications"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of SchemaReplications that match those selectors. +func (c *schemaReplications) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.SchemaReplicationList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.SchemaReplicationList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("schemareplications"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested schemaReplications. +func (c *schemaReplications) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("schemareplications"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a schemaReplication and creates it. Returns the server's representation of the schemaReplication, and an error, if there is any. +func (c *schemaReplications) Create(ctx context.Context, schemaReplication *v1beta1.SchemaReplication, opts v1.CreateOptions) (result *v1beta1.SchemaReplication, err error) { + result = &v1beta1.SchemaReplication{} + err = c.client.Post(). + Namespace(c.ns). + Resource("schemareplications"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(schemaReplication). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a schemaReplication and updates it. Returns the server's representation of the schemaReplication, and an error, if there is any. +func (c *schemaReplications) Update(ctx context.Context, schemaReplication *v1beta1.SchemaReplication, opts v1.UpdateOptions) (result *v1beta1.SchemaReplication, err error) { + result = &v1beta1.SchemaReplication{} + err = c.client.Put(). + Namespace(c.ns). + Resource("schemareplications"). + Name(schemaReplication.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(schemaReplication). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *schemaReplications) UpdateStatus(ctx context.Context, schemaReplication *v1beta1.SchemaReplication, opts v1.UpdateOptions) (result *v1beta1.SchemaReplication, err error) { + result = &v1beta1.SchemaReplication{} + err = c.client.Put(). + Namespace(c.ns). + Resource("schemareplications"). + Name(schemaReplication.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(schemaReplication). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the schemaReplication and deletes it. Returns an error if one occurs. +func (c *schemaReplications) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("schemareplications"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *schemaReplications) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("schemareplications"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched schemaReplication. +func (c *schemaReplications) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.SchemaReplication, err error) { + result = &v1beta1.SchemaReplication{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("schemareplications"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/user.go b/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/user.go new file mode 100644 index 0000000000..0a8c9f3790 --- /dev/null +++ b/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/user.go @@ -0,0 +1,194 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + v1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/apis/rabbitmq.com/v1beta1" + scheme "knative.dev/eventing-rabbitmq/third_party/pkg/client/clientset/versioned/scheme" +) + +// UsersGetter has a method to return a UserInterface. +// A group's client should implement this interface. +type UsersGetter interface { + Users(namespace string) UserInterface +} + +// UserInterface has methods to work with User resources. +type UserInterface interface { + Create(ctx context.Context, user *v1beta1.User, opts v1.CreateOptions) (*v1beta1.User, error) + Update(ctx context.Context, user *v1beta1.User, opts v1.UpdateOptions) (*v1beta1.User, error) + UpdateStatus(ctx context.Context, user *v1beta1.User, opts v1.UpdateOptions) (*v1beta1.User, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.User, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.UserList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.User, err error) + UserExpansion +} + +// users implements UserInterface +type users struct { + client rest.Interface + ns string +} + +// newUsers returns a Users +func newUsers(c *RabbitmqV1beta1Client, namespace string) *users { + return &users{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the user, and returns the corresponding user object, and an error if there is any. +func (c *users) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.User, err error) { + result = &v1beta1.User{} + err = c.client.Get(). + Namespace(c.ns). + Resource("users"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Users that match those selectors. +func (c *users) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.UserList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.UserList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("users"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested users. +func (c *users) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("users"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a user and creates it. Returns the server's representation of the user, and an error, if there is any. +func (c *users) Create(ctx context.Context, user *v1beta1.User, opts v1.CreateOptions) (result *v1beta1.User, err error) { + result = &v1beta1.User{} + err = c.client.Post(). + Namespace(c.ns). + Resource("users"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(user). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a user and updates it. Returns the server's representation of the user, and an error, if there is any. +func (c *users) Update(ctx context.Context, user *v1beta1.User, opts v1.UpdateOptions) (result *v1beta1.User, err error) { + result = &v1beta1.User{} + err = c.client.Put(). + Namespace(c.ns). + Resource("users"). + Name(user.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(user). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *users) UpdateStatus(ctx context.Context, user *v1beta1.User, opts v1.UpdateOptions) (result *v1beta1.User, err error) { + result = &v1beta1.User{} + err = c.client.Put(). + Namespace(c.ns). + Resource("users"). + Name(user.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(user). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the user and deletes it. Returns an error if one occurs. +func (c *users) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("users"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *users) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("users"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched user. +func (c *users) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.User, err error) { + result = &v1beta1.User{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("users"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/vhost.go b/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/vhost.go new file mode 100644 index 0000000000..8e9689d103 --- /dev/null +++ b/third_party/pkg/client/clientset/versioned/typed/rabbitmq.com/v1beta1/vhost.go @@ -0,0 +1,194 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + v1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/apis/rabbitmq.com/v1beta1" + scheme "knative.dev/eventing-rabbitmq/third_party/pkg/client/clientset/versioned/scheme" +) + +// VhostsGetter has a method to return a VhostInterface. +// A group's client should implement this interface. +type VhostsGetter interface { + Vhosts(namespace string) VhostInterface +} + +// VhostInterface has methods to work with Vhost resources. +type VhostInterface interface { + Create(ctx context.Context, vhost *v1beta1.Vhost, opts v1.CreateOptions) (*v1beta1.Vhost, error) + Update(ctx context.Context, vhost *v1beta1.Vhost, opts v1.UpdateOptions) (*v1beta1.Vhost, error) + UpdateStatus(ctx context.Context, vhost *v1beta1.Vhost, opts v1.UpdateOptions) (*v1beta1.Vhost, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Vhost, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.VhostList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Vhost, err error) + VhostExpansion +} + +// vhosts implements VhostInterface +type vhosts struct { + client rest.Interface + ns string +} + +// newVhosts returns a Vhosts +func newVhosts(c *RabbitmqV1beta1Client, namespace string) *vhosts { + return &vhosts{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the vhost, and returns the corresponding vhost object, and an error if there is any. +func (c *vhosts) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Vhost, err error) { + result = &v1beta1.Vhost{} + err = c.client.Get(). + Namespace(c.ns). + Resource("vhosts"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Vhosts that match those selectors. +func (c *vhosts) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VhostList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.VhostList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("vhosts"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested vhosts. +func (c *vhosts) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("vhosts"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a vhost and creates it. Returns the server's representation of the vhost, and an error, if there is any. +func (c *vhosts) Create(ctx context.Context, vhost *v1beta1.Vhost, opts v1.CreateOptions) (result *v1beta1.Vhost, err error) { + result = &v1beta1.Vhost{} + err = c.client.Post(). + Namespace(c.ns). + Resource("vhosts"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(vhost). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a vhost and updates it. Returns the server's representation of the vhost, and an error, if there is any. +func (c *vhosts) Update(ctx context.Context, vhost *v1beta1.Vhost, opts v1.UpdateOptions) (result *v1beta1.Vhost, err error) { + result = &v1beta1.Vhost{} + err = c.client.Put(). + Namespace(c.ns). + Resource("vhosts"). + Name(vhost.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(vhost). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *vhosts) UpdateStatus(ctx context.Context, vhost *v1beta1.Vhost, opts v1.UpdateOptions) (result *v1beta1.Vhost, err error) { + result = &v1beta1.Vhost{} + err = c.client.Put(). + Namespace(c.ns). + Resource("vhosts"). + Name(vhost.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(vhost). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the vhost and deletes it. Returns an error if one occurs. +func (c *vhosts) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("vhosts"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *vhosts) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("vhosts"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched vhost. +func (c *vhosts) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Vhost, err error) { + result = &v1beta1.Vhost{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("vhosts"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/third_party/pkg/client/informers/externalversions/factory.go b/third_party/pkg/client/informers/externalversions/factory.go new file mode 100644 index 0000000000..9c674cfcbd --- /dev/null +++ b/third_party/pkg/client/informers/externalversions/factory.go @@ -0,0 +1,179 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by informer-gen. DO NOT EDIT. + +package externalversions + +import ( + reflect "reflect" + sync "sync" + time "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + cache "k8s.io/client-go/tools/cache" + versioned "knative.dev/eventing-rabbitmq/third_party/pkg/client/clientset/versioned" + internalinterfaces "knative.dev/eventing-rabbitmq/third_party/pkg/client/informers/externalversions/internalinterfaces" + rabbitmqcom "knative.dev/eventing-rabbitmq/third_party/pkg/client/informers/externalversions/rabbitmq.com" +) + +// SharedInformerOption defines the functional option type for SharedInformerFactory. +type SharedInformerOption func(*sharedInformerFactory) *sharedInformerFactory + +type sharedInformerFactory struct { + client versioned.Interface + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc + lock sync.Mutex + defaultResync time.Duration + customResync map[reflect.Type]time.Duration + + informers map[reflect.Type]cache.SharedIndexInformer + // startedInformers is used for tracking which informers have been started. + // This allows Start() to be called multiple times safely. + startedInformers map[reflect.Type]bool +} + +// WithCustomResyncConfig sets a custom resync period for the specified informer types. +func WithCustomResyncConfig(resyncConfig map[v1.Object]time.Duration) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + for k, v := range resyncConfig { + factory.customResync[reflect.TypeOf(k)] = v + } + return factory + } +} + +// WithTweakListOptions sets a custom filter on all listers of the configured SharedInformerFactory. +func WithTweakListOptions(tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + factory.tweakListOptions = tweakListOptions + return factory + } +} + +// WithNamespace limits the SharedInformerFactory to the specified namespace. +func WithNamespace(namespace string) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + factory.namespace = namespace + return factory + } +} + +// NewSharedInformerFactory constructs a new instance of sharedInformerFactory for all namespaces. +func NewSharedInformerFactory(client versioned.Interface, defaultResync time.Duration) SharedInformerFactory { + return NewSharedInformerFactoryWithOptions(client, defaultResync) +} + +// NewFilteredSharedInformerFactory constructs a new instance of sharedInformerFactory. +// Listers obtained via this SharedInformerFactory will be subject to the same filters +// as specified here. +// Deprecated: Please use NewSharedInformerFactoryWithOptions instead +func NewFilteredSharedInformerFactory(client versioned.Interface, defaultResync time.Duration, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerFactory { + return NewSharedInformerFactoryWithOptions(client, defaultResync, WithNamespace(namespace), WithTweakListOptions(tweakListOptions)) +} + +// NewSharedInformerFactoryWithOptions constructs a new instance of a SharedInformerFactory with additional options. +func NewSharedInformerFactoryWithOptions(client versioned.Interface, defaultResync time.Duration, options ...SharedInformerOption) SharedInformerFactory { + factory := &sharedInformerFactory{ + client: client, + namespace: v1.NamespaceAll, + defaultResync: defaultResync, + informers: make(map[reflect.Type]cache.SharedIndexInformer), + startedInformers: make(map[reflect.Type]bool), + customResync: make(map[reflect.Type]time.Duration), + } + + // Apply all options + for _, opt := range options { + factory = opt(factory) + } + + return factory +} + +// Start initializes all requested informers. +func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) { + f.lock.Lock() + defer f.lock.Unlock() + + for informerType, informer := range f.informers { + if !f.startedInformers[informerType] { + go informer.Run(stopCh) + f.startedInformers[informerType] = true + } + } +} + +// WaitForCacheSync waits for all started informers' cache were synced. +func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool { + informers := func() map[reflect.Type]cache.SharedIndexInformer { + f.lock.Lock() + defer f.lock.Unlock() + + informers := map[reflect.Type]cache.SharedIndexInformer{} + for informerType, informer := range f.informers { + if f.startedInformers[informerType] { + informers[informerType] = informer + } + } + return informers + }() + + res := map[reflect.Type]bool{} + for informType, informer := range informers { + res[informType] = cache.WaitForCacheSync(stopCh, informer.HasSynced) + } + return res +} + +// InternalInformerFor returns the SharedIndexInformer for obj using an internal +// client. +func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer { + f.lock.Lock() + defer f.lock.Unlock() + + informerType := reflect.TypeOf(obj) + informer, exists := f.informers[informerType] + if exists { + return informer + } + + resyncPeriod, exists := f.customResync[informerType] + if !exists { + resyncPeriod = f.defaultResync + } + + informer = newFunc(f.client, resyncPeriod) + f.informers[informerType] = informer + + return informer +} + +// SharedInformerFactory provides shared informers for resources in all known +// API group versions. +type SharedInformerFactory interface { + internalinterfaces.SharedInformerFactory + ForResource(resource schema.GroupVersionResource) (GenericInformer, error) + WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool + + Rabbitmq() rabbitmqcom.Interface +} + +func (f *sharedInformerFactory) Rabbitmq() rabbitmqcom.Interface { + return rabbitmqcom.New(f, f.namespace, f.tweakListOptions) +} diff --git a/third_party/pkg/client/informers/externalversions/generic.go b/third_party/pkg/client/informers/externalversions/generic.go new file mode 100644 index 0000000000..867a1fa5d4 --- /dev/null +++ b/third_party/pkg/client/informers/externalversions/generic.go @@ -0,0 +1,75 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by informer-gen. DO NOT EDIT. + +package externalversions + +import ( + "fmt" + + schema "k8s.io/apimachinery/pkg/runtime/schema" + cache "k8s.io/client-go/tools/cache" + v1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/apis/rabbitmq.com/v1beta1" +) + +// GenericInformer is type of SharedIndexInformer which will locate and delegate to other +// sharedInformers based on type +type GenericInformer interface { + Informer() cache.SharedIndexInformer + Lister() cache.GenericLister +} + +type genericInformer struct { + informer cache.SharedIndexInformer + resource schema.GroupResource +} + +// Informer returns the SharedIndexInformer. +func (f *genericInformer) Informer() cache.SharedIndexInformer { + return f.informer +} + +// Lister returns the GenericLister. +func (f *genericInformer) Lister() cache.GenericLister { + return cache.NewGenericLister(f.Informer().GetIndexer(), f.resource) +} + +// ForResource gives generic access to a shared informer of the matching type +// TODO extend this to unknown resources with a client pool +func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { + switch resource { + // Group=rabbitmq.com, Version=v1beta1 + case v1beta1.SchemeGroupVersion.WithResource("bindings"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Rabbitmq().V1beta1().Bindings().Informer()}, nil + case v1beta1.SchemeGroupVersion.WithResource("exchanges"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Rabbitmq().V1beta1().Exchanges().Informer()}, nil + case v1beta1.SchemeGroupVersion.WithResource("permissions"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Rabbitmq().V1beta1().Permissions().Informer()}, nil + case v1beta1.SchemeGroupVersion.WithResource("policies"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Rabbitmq().V1beta1().Policies().Informer()}, nil + case v1beta1.SchemeGroupVersion.WithResource("queues"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Rabbitmq().V1beta1().Queues().Informer()}, nil + case v1beta1.SchemeGroupVersion.WithResource("schemareplications"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Rabbitmq().V1beta1().SchemaReplications().Informer()}, nil + case v1beta1.SchemeGroupVersion.WithResource("users"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Rabbitmq().V1beta1().Users().Informer()}, nil + case v1beta1.SchemeGroupVersion.WithResource("vhosts"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Rabbitmq().V1beta1().Vhosts().Informer()}, nil + + } + + return nil, fmt.Errorf("no informer found for %v", resource) +} diff --git a/third_party/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go b/third_party/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go new file mode 100644 index 0000000000..3387be7f5f --- /dev/null +++ b/third_party/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go @@ -0,0 +1,39 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by informer-gen. DO NOT EDIT. + +package internalinterfaces + +import ( + time "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + cache "k8s.io/client-go/tools/cache" + versioned "knative.dev/eventing-rabbitmq/third_party/pkg/client/clientset/versioned" +) + +// NewInformerFunc takes versioned.Interface and time.Duration to return a SharedIndexInformer. +type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer + +// SharedInformerFactory a small interface to allow for adding an informer without an import cycle +type SharedInformerFactory interface { + Start(stopCh <-chan struct{}) + InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer +} + +// TweakListOptionsFunc is a function that transforms a v1.ListOptions. +type TweakListOptionsFunc func(*v1.ListOptions) diff --git a/third_party/pkg/client/informers/externalversions/rabbitmq.com/interface.go b/third_party/pkg/client/informers/externalversions/rabbitmq.com/interface.go new file mode 100644 index 0000000000..8bf59307b8 --- /dev/null +++ b/third_party/pkg/client/informers/externalversions/rabbitmq.com/interface.go @@ -0,0 +1,45 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by informer-gen. DO NOT EDIT. + +package rabbitmq + +import ( + internalinterfaces "knative.dev/eventing-rabbitmq/third_party/pkg/client/informers/externalversions/internalinterfaces" + v1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1" +) + +// Interface provides access to each of this group's versions. +type Interface interface { + // V1beta1 provides access to shared informers for resources in V1beta1. + V1beta1() v1beta1.Interface +} + +type group struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// V1beta1 returns a new v1beta1.Interface. +func (g *group) V1beta1() v1beta1.Interface { + return v1beta1.New(g.factory, g.namespace, g.tweakListOptions) +} diff --git a/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1/binding.go b/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1/binding.go new file mode 100644 index 0000000000..a6b266697f --- /dev/null +++ b/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1/binding.go @@ -0,0 +1,89 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by informer-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + time "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" + rabbitmqcomv1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/apis/rabbitmq.com/v1beta1" + versioned "knative.dev/eventing-rabbitmq/third_party/pkg/client/clientset/versioned" + internalinterfaces "knative.dev/eventing-rabbitmq/third_party/pkg/client/informers/externalversions/internalinterfaces" + v1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/client/listers/rabbitmq.com/v1beta1" +) + +// BindingInformer provides access to a shared informer and lister for +// Bindings. +type BindingInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1beta1.BindingLister +} + +type bindingInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewBindingInformer constructs a new informer for Binding type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewBindingInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredBindingInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredBindingInformer constructs a new informer for Binding type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredBindingInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.RabbitmqV1beta1().Bindings(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.RabbitmqV1beta1().Bindings(namespace).Watch(context.TODO(), options) + }, + }, + &rabbitmqcomv1beta1.Binding{}, + resyncPeriod, + indexers, + ) +} + +func (f *bindingInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredBindingInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *bindingInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&rabbitmqcomv1beta1.Binding{}, f.defaultInformer) +} + +func (f *bindingInformer) Lister() v1beta1.BindingLister { + return v1beta1.NewBindingLister(f.Informer().GetIndexer()) +} diff --git a/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1/exchange.go b/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1/exchange.go new file mode 100644 index 0000000000..de4534be5e --- /dev/null +++ b/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1/exchange.go @@ -0,0 +1,89 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by informer-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + time "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" + rabbitmqcomv1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/apis/rabbitmq.com/v1beta1" + versioned "knative.dev/eventing-rabbitmq/third_party/pkg/client/clientset/versioned" + internalinterfaces "knative.dev/eventing-rabbitmq/third_party/pkg/client/informers/externalversions/internalinterfaces" + v1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/client/listers/rabbitmq.com/v1beta1" +) + +// ExchangeInformer provides access to a shared informer and lister for +// Exchanges. +type ExchangeInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1beta1.ExchangeLister +} + +type exchangeInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewExchangeInformer constructs a new informer for Exchange type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewExchangeInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredExchangeInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredExchangeInformer constructs a new informer for Exchange type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredExchangeInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.RabbitmqV1beta1().Exchanges(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.RabbitmqV1beta1().Exchanges(namespace).Watch(context.TODO(), options) + }, + }, + &rabbitmqcomv1beta1.Exchange{}, + resyncPeriod, + indexers, + ) +} + +func (f *exchangeInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredExchangeInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *exchangeInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&rabbitmqcomv1beta1.Exchange{}, f.defaultInformer) +} + +func (f *exchangeInformer) Lister() v1beta1.ExchangeLister { + return v1beta1.NewExchangeLister(f.Informer().GetIndexer()) +} diff --git a/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1/interface.go b/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1/interface.go new file mode 100644 index 0000000000..25b8f8d991 --- /dev/null +++ b/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1/interface.go @@ -0,0 +1,93 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by informer-gen. DO NOT EDIT. + +package v1beta1 + +import ( + internalinterfaces "knative.dev/eventing-rabbitmq/third_party/pkg/client/informers/externalversions/internalinterfaces" +) + +// Interface provides access to all the informers in this group version. +type Interface interface { + // Bindings returns a BindingInformer. + Bindings() BindingInformer + // Exchanges returns a ExchangeInformer. + Exchanges() ExchangeInformer + // Permissions returns a PermissionInformer. + Permissions() PermissionInformer + // Policies returns a PolicyInformer. + Policies() PolicyInformer + // Queues returns a QueueInformer. + Queues() QueueInformer + // SchemaReplications returns a SchemaReplicationInformer. + SchemaReplications() SchemaReplicationInformer + // Users returns a UserInformer. + Users() UserInformer + // Vhosts returns a VhostInformer. + Vhosts() VhostInformer +} + +type version struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// Bindings returns a BindingInformer. +func (v *version) Bindings() BindingInformer { + return &bindingInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// Exchanges returns a ExchangeInformer. +func (v *version) Exchanges() ExchangeInformer { + return &exchangeInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// Permissions returns a PermissionInformer. +func (v *version) Permissions() PermissionInformer { + return &permissionInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// Policies returns a PolicyInformer. +func (v *version) Policies() PolicyInformer { + return &policyInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// Queues returns a QueueInformer. +func (v *version) Queues() QueueInformer { + return &queueInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// SchemaReplications returns a SchemaReplicationInformer. +func (v *version) SchemaReplications() SchemaReplicationInformer { + return &schemaReplicationInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// Users returns a UserInformer. +func (v *version) Users() UserInformer { + return &userInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// Vhosts returns a VhostInformer. +func (v *version) Vhosts() VhostInformer { + return &vhostInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} diff --git a/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1/permission.go b/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1/permission.go new file mode 100644 index 0000000000..b90ef127c0 --- /dev/null +++ b/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1/permission.go @@ -0,0 +1,89 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by informer-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + time "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" + rabbitmqcomv1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/apis/rabbitmq.com/v1beta1" + versioned "knative.dev/eventing-rabbitmq/third_party/pkg/client/clientset/versioned" + internalinterfaces "knative.dev/eventing-rabbitmq/third_party/pkg/client/informers/externalversions/internalinterfaces" + v1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/client/listers/rabbitmq.com/v1beta1" +) + +// PermissionInformer provides access to a shared informer and lister for +// Permissions. +type PermissionInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1beta1.PermissionLister +} + +type permissionInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewPermissionInformer constructs a new informer for Permission type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewPermissionInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredPermissionInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredPermissionInformer constructs a new informer for Permission type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredPermissionInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.RabbitmqV1beta1().Permissions(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.RabbitmqV1beta1().Permissions(namespace).Watch(context.TODO(), options) + }, + }, + &rabbitmqcomv1beta1.Permission{}, + resyncPeriod, + indexers, + ) +} + +func (f *permissionInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredPermissionInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *permissionInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&rabbitmqcomv1beta1.Permission{}, f.defaultInformer) +} + +func (f *permissionInformer) Lister() v1beta1.PermissionLister { + return v1beta1.NewPermissionLister(f.Informer().GetIndexer()) +} diff --git a/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1/policy.go b/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1/policy.go new file mode 100644 index 0000000000..b74f616dfb --- /dev/null +++ b/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1/policy.go @@ -0,0 +1,89 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by informer-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + time "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" + rabbitmqcomv1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/apis/rabbitmq.com/v1beta1" + versioned "knative.dev/eventing-rabbitmq/third_party/pkg/client/clientset/versioned" + internalinterfaces "knative.dev/eventing-rabbitmq/third_party/pkg/client/informers/externalversions/internalinterfaces" + v1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/client/listers/rabbitmq.com/v1beta1" +) + +// PolicyInformer provides access to a shared informer and lister for +// Policies. +type PolicyInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1beta1.PolicyLister +} + +type policyInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewPolicyInformer constructs a new informer for Policy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewPolicyInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredPolicyInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredPolicyInformer constructs a new informer for Policy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredPolicyInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.RabbitmqV1beta1().Policies(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.RabbitmqV1beta1().Policies(namespace).Watch(context.TODO(), options) + }, + }, + &rabbitmqcomv1beta1.Policy{}, + resyncPeriod, + indexers, + ) +} + +func (f *policyInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredPolicyInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *policyInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&rabbitmqcomv1beta1.Policy{}, f.defaultInformer) +} + +func (f *policyInformer) Lister() v1beta1.PolicyLister { + return v1beta1.NewPolicyLister(f.Informer().GetIndexer()) +} diff --git a/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1/queue.go b/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1/queue.go new file mode 100644 index 0000000000..4ea9046b92 --- /dev/null +++ b/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1/queue.go @@ -0,0 +1,89 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by informer-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + time "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" + rabbitmqcomv1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/apis/rabbitmq.com/v1beta1" + versioned "knative.dev/eventing-rabbitmq/third_party/pkg/client/clientset/versioned" + internalinterfaces "knative.dev/eventing-rabbitmq/third_party/pkg/client/informers/externalversions/internalinterfaces" + v1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/client/listers/rabbitmq.com/v1beta1" +) + +// QueueInformer provides access to a shared informer and lister for +// Queues. +type QueueInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1beta1.QueueLister +} + +type queueInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewQueueInformer constructs a new informer for Queue type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewQueueInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredQueueInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredQueueInformer constructs a new informer for Queue type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredQueueInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.RabbitmqV1beta1().Queues(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.RabbitmqV1beta1().Queues(namespace).Watch(context.TODO(), options) + }, + }, + &rabbitmqcomv1beta1.Queue{}, + resyncPeriod, + indexers, + ) +} + +func (f *queueInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredQueueInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *queueInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&rabbitmqcomv1beta1.Queue{}, f.defaultInformer) +} + +func (f *queueInformer) Lister() v1beta1.QueueLister { + return v1beta1.NewQueueLister(f.Informer().GetIndexer()) +} diff --git a/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1/schemareplication.go b/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1/schemareplication.go new file mode 100644 index 0000000000..a284357c27 --- /dev/null +++ b/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1/schemareplication.go @@ -0,0 +1,89 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by informer-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + time "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" + rabbitmqcomv1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/apis/rabbitmq.com/v1beta1" + versioned "knative.dev/eventing-rabbitmq/third_party/pkg/client/clientset/versioned" + internalinterfaces "knative.dev/eventing-rabbitmq/third_party/pkg/client/informers/externalversions/internalinterfaces" + v1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/client/listers/rabbitmq.com/v1beta1" +) + +// SchemaReplicationInformer provides access to a shared informer and lister for +// SchemaReplications. +type SchemaReplicationInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1beta1.SchemaReplicationLister +} + +type schemaReplicationInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewSchemaReplicationInformer constructs a new informer for SchemaReplication type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewSchemaReplicationInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredSchemaReplicationInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredSchemaReplicationInformer constructs a new informer for SchemaReplication type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredSchemaReplicationInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.RabbitmqV1beta1().SchemaReplications(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.RabbitmqV1beta1().SchemaReplications(namespace).Watch(context.TODO(), options) + }, + }, + &rabbitmqcomv1beta1.SchemaReplication{}, + resyncPeriod, + indexers, + ) +} + +func (f *schemaReplicationInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredSchemaReplicationInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *schemaReplicationInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&rabbitmqcomv1beta1.SchemaReplication{}, f.defaultInformer) +} + +func (f *schemaReplicationInformer) Lister() v1beta1.SchemaReplicationLister { + return v1beta1.NewSchemaReplicationLister(f.Informer().GetIndexer()) +} diff --git a/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1/user.go b/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1/user.go new file mode 100644 index 0000000000..a2d32f4bab --- /dev/null +++ b/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1/user.go @@ -0,0 +1,89 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by informer-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + time "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" + rabbitmqcomv1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/apis/rabbitmq.com/v1beta1" + versioned "knative.dev/eventing-rabbitmq/third_party/pkg/client/clientset/versioned" + internalinterfaces "knative.dev/eventing-rabbitmq/third_party/pkg/client/informers/externalversions/internalinterfaces" + v1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/client/listers/rabbitmq.com/v1beta1" +) + +// UserInformer provides access to a shared informer and lister for +// Users. +type UserInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1beta1.UserLister +} + +type userInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewUserInformer constructs a new informer for User type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewUserInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredUserInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredUserInformer constructs a new informer for User type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredUserInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.RabbitmqV1beta1().Users(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.RabbitmqV1beta1().Users(namespace).Watch(context.TODO(), options) + }, + }, + &rabbitmqcomv1beta1.User{}, + resyncPeriod, + indexers, + ) +} + +func (f *userInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredUserInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *userInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&rabbitmqcomv1beta1.User{}, f.defaultInformer) +} + +func (f *userInformer) Lister() v1beta1.UserLister { + return v1beta1.NewUserLister(f.Informer().GetIndexer()) +} diff --git a/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1/vhost.go b/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1/vhost.go new file mode 100644 index 0000000000..834bb5e912 --- /dev/null +++ b/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1/vhost.go @@ -0,0 +1,89 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by informer-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + time "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" + rabbitmqcomv1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/apis/rabbitmq.com/v1beta1" + versioned "knative.dev/eventing-rabbitmq/third_party/pkg/client/clientset/versioned" + internalinterfaces "knative.dev/eventing-rabbitmq/third_party/pkg/client/informers/externalversions/internalinterfaces" + v1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/client/listers/rabbitmq.com/v1beta1" +) + +// VhostInformer provides access to a shared informer and lister for +// Vhosts. +type VhostInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1beta1.VhostLister +} + +type vhostInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewVhostInformer constructs a new informer for Vhost type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewVhostInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredVhostInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredVhostInformer constructs a new informer for Vhost type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredVhostInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.RabbitmqV1beta1().Vhosts(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.RabbitmqV1beta1().Vhosts(namespace).Watch(context.TODO(), options) + }, + }, + &rabbitmqcomv1beta1.Vhost{}, + resyncPeriod, + indexers, + ) +} + +func (f *vhostInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredVhostInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *vhostInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&rabbitmqcomv1beta1.Vhost{}, f.defaultInformer) +} + +func (f *vhostInformer) Lister() v1beta1.VhostLister { + return v1beta1.NewVhostLister(f.Informer().GetIndexer()) +} diff --git a/third_party/pkg/client/injection/client/client.go b/third_party/pkg/client/injection/client/client.go new file mode 100644 index 0000000000..6861dd80b0 --- /dev/null +++ b/third_party/pkg/client/injection/client/client.go @@ -0,0 +1,56 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by injection-gen. DO NOT EDIT. + +package client + +import ( + context "context" + + rest "k8s.io/client-go/rest" + versioned "knative.dev/eventing-rabbitmq/third_party/pkg/client/clientset/versioned" + injection "knative.dev/pkg/injection" + logging "knative.dev/pkg/logging" +) + +func init() { + injection.Default.RegisterClient(withClient) + injection.Default.RegisterClientFetcher(func(ctx context.Context) interface{} { + return Get(ctx) + }) +} + +// Key is used as the key for associating information with a context.Context. +type Key struct{} + +func withClient(ctx context.Context, cfg *rest.Config) context.Context { + return context.WithValue(ctx, Key{}, versioned.NewForConfigOrDie(cfg)) +} + +// Get extracts the versioned.Interface client from the context. +func Get(ctx context.Context) versioned.Interface { + untyped := ctx.Value(Key{}) + if untyped == nil { + if injection.GetConfig(ctx) == nil { + logging.FromContext(ctx).Panic( + "Unable to fetch knative.dev/eventing-rabbitmq/third_party/pkg/client/clientset/versioned.Interface from context. This context is not the application context (which is typically given to constructors via sharedmain).") + } else { + logging.FromContext(ctx).Panic( + "Unable to fetch knative.dev/eventing-rabbitmq/third_party/pkg/client/clientset/versioned.Interface from context.") + } + } + return untyped.(versioned.Interface) +} diff --git a/third_party/pkg/client/injection/client/fake/fake.go b/third_party/pkg/client/injection/client/fake/fake.go new file mode 100644 index 0000000000..ba8d45996d --- /dev/null +++ b/third_party/pkg/client/injection/client/fake/fake.go @@ -0,0 +1,56 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by injection-gen. DO NOT EDIT. + +package fake + +import ( + context "context" + + runtime "k8s.io/apimachinery/pkg/runtime" + rest "k8s.io/client-go/rest" + fake "knative.dev/eventing-rabbitmq/third_party/pkg/client/clientset/versioned/fake" + client "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/client" + injection "knative.dev/pkg/injection" + logging "knative.dev/pkg/logging" +) + +func init() { + injection.Fake.RegisterClient(withClient) + injection.Fake.RegisterClientFetcher(func(ctx context.Context) interface{} { + return Get(ctx) + }) +} + +func withClient(ctx context.Context, cfg *rest.Config) context.Context { + ctx, _ = With(ctx) + return ctx +} + +func With(ctx context.Context, objects ...runtime.Object) (context.Context, *fake.Clientset) { + cs := fake.NewSimpleClientset(objects...) + return context.WithValue(ctx, client.Key{}, cs), cs +} + +// Get extracts the Kubernetes client from the context. +func Get(ctx context.Context) *fake.Clientset { + untyped := ctx.Value(client.Key{}) + if untyped == nil { + logging.FromContext(ctx).Panic( + "Unable to fetch knative.dev/eventing-rabbitmq/third_party/pkg/client/clientset/versioned/fake.Clientset from context.") + } + return untyped.(*fake.Clientset) +} diff --git a/third_party/pkg/client/injection/informers/factory/factory.go b/third_party/pkg/client/injection/informers/factory/factory.go new file mode 100644 index 0000000000..8f4c5e201b --- /dev/null +++ b/third_party/pkg/client/injection/informers/factory/factory.go @@ -0,0 +1,55 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by injection-gen. DO NOT EDIT. + +package factory + +import ( + context "context" + + externalversions "knative.dev/eventing-rabbitmq/third_party/pkg/client/informers/externalversions" + client "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/client" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" + logging "knative.dev/pkg/logging" +) + +func init() { + injection.Default.RegisterInformerFactory(withInformerFactory) +} + +// Key is used as the key for associating information with a context.Context. +type Key struct{} + +func withInformerFactory(ctx context.Context) context.Context { + c := client.Get(ctx) + opts := make([]externalversions.SharedInformerOption, 0, 1) + if injection.HasNamespaceScope(ctx) { + opts = append(opts, externalversions.WithNamespace(injection.GetNamespaceScope(ctx))) + } + return context.WithValue(ctx, Key{}, + externalversions.NewSharedInformerFactoryWithOptions(c, controller.GetResyncPeriod(ctx), opts...)) +} + +// Get extracts the InformerFactory from the context. +func Get(ctx context.Context) externalversions.SharedInformerFactory { + untyped := ctx.Value(Key{}) + if untyped == nil { + logging.FromContext(ctx).Panic( + "Unable to fetch knative.dev/eventing-rabbitmq/third_party/pkg/client/informers/externalversions.SharedInformerFactory from context.") + } + return untyped.(externalversions.SharedInformerFactory) +} diff --git a/third_party/pkg/client/injection/informers/factory/fake/fake.go b/third_party/pkg/client/injection/informers/factory/fake/fake.go new file mode 100644 index 0000000000..d17110b18a --- /dev/null +++ b/third_party/pkg/client/injection/informers/factory/fake/fake.go @@ -0,0 +1,44 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by injection-gen. DO NOT EDIT. + +package fake + +import ( + context "context" + + externalversions "knative.dev/eventing-rabbitmq/third_party/pkg/client/informers/externalversions" + fake "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/client/fake" + factory "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/factory" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" +) + +var Get = factory.Get + +func init() { + injection.Fake.RegisterInformerFactory(withInformerFactory) +} + +func withInformerFactory(ctx context.Context) context.Context { + c := fake.Get(ctx) + opts := make([]externalversions.SharedInformerOption, 0, 1) + if injection.HasNamespaceScope(ctx) { + opts = append(opts, externalversions.WithNamespace(injection.GetNamespaceScope(ctx))) + } + return context.WithValue(ctx, factory.Key{}, + externalversions.NewSharedInformerFactoryWithOptions(c, controller.GetResyncPeriod(ctx), opts...)) +} diff --git a/third_party/pkg/client/injection/informers/factory/filtered/fake/fake_filtered_factory.go b/third_party/pkg/client/injection/informers/factory/filtered/fake/fake_filtered_factory.go new file mode 100644 index 0000000000..f6326eb08a --- /dev/null +++ b/third_party/pkg/client/injection/informers/factory/filtered/fake/fake_filtered_factory.go @@ -0,0 +1,58 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by injection-gen. DO NOT EDIT. + +package fakeFilteredFactory + +import ( + context "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + externalversions "knative.dev/eventing-rabbitmq/third_party/pkg/client/informers/externalversions" + fake "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/client/fake" + filtered "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/factory/filtered" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" + logging "knative.dev/pkg/logging" +) + +var Get = filtered.Get + +func init() { + injection.Fake.RegisterInformerFactory(withInformerFactory) +} + +func withInformerFactory(ctx context.Context) context.Context { + c := fake.Get(ctx) + untyped := ctx.Value(filtered.LabelKey{}) + if untyped == nil { + logging.FromContext(ctx).Panic( + "Unable to fetch labelkey from context.") + } + labelSelectors := untyped.([]string) + for _, selector := range labelSelectors { + opts := []externalversions.SharedInformerOption{} + if injection.HasNamespaceScope(ctx) { + opts = append(opts, externalversions.WithNamespace(injection.GetNamespaceScope(ctx))) + } + opts = append(opts, externalversions.WithTweakListOptions(func(l *v1.ListOptions) { + l.LabelSelector = selector + })) + ctx = context.WithValue(ctx, filtered.Key{Selector: selector}, + externalversions.NewSharedInformerFactoryWithOptions(c, controller.GetResyncPeriod(ctx), opts...)) + } + return ctx +} diff --git a/third_party/pkg/client/injection/informers/factory/filtered/filtered_factory.go b/third_party/pkg/client/injection/informers/factory/filtered/filtered_factory.go new file mode 100644 index 0000000000..e4e44633eb --- /dev/null +++ b/third_party/pkg/client/injection/informers/factory/filtered/filtered_factory.go @@ -0,0 +1,76 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by injection-gen. DO NOT EDIT. + +package filteredFactory + +import ( + context "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + externalversions "knative.dev/eventing-rabbitmq/third_party/pkg/client/informers/externalversions" + client "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/client" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" + logging "knative.dev/pkg/logging" +) + +func init() { + injection.Default.RegisterInformerFactory(withInformerFactory) +} + +// Key is used as the key for associating information with a context.Context. +type Key struct { + Selector string +} + +type LabelKey struct{} + +func WithSelectors(ctx context.Context, selector ...string) context.Context { + return context.WithValue(ctx, LabelKey{}, selector) +} + +func withInformerFactory(ctx context.Context) context.Context { + c := client.Get(ctx) + untyped := ctx.Value(LabelKey{}) + if untyped == nil { + logging.FromContext(ctx).Panic( + "Unable to fetch labelkey from context.") + } + labelSelectors := untyped.([]string) + for _, selector := range labelSelectors { + opts := []externalversions.SharedInformerOption{} + if injection.HasNamespaceScope(ctx) { + opts = append(opts, externalversions.WithNamespace(injection.GetNamespaceScope(ctx))) + } + opts = append(opts, externalversions.WithTweakListOptions(func(l *v1.ListOptions) { + l.LabelSelector = selector + })) + ctx = context.WithValue(ctx, Key{Selector: selector}, + externalversions.NewSharedInformerFactoryWithOptions(c, controller.GetResyncPeriod(ctx), opts...)) + } + return ctx +} + +// Get extracts the InformerFactory from the context. +func Get(ctx context.Context, selector string) externalversions.SharedInformerFactory { + untyped := ctx.Value(Key{Selector: selector}) + if untyped == nil { + logging.FromContext(ctx).Panicf( + "Unable to fetch knative.dev/eventing-rabbitmq/third_party/pkg/client/informers/externalversions.SharedInformerFactory with selector %s from context.", selector) + } + return untyped.(externalversions.SharedInformerFactory) +} diff --git a/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/binding/binding.go b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/binding/binding.go new file mode 100644 index 0000000000..18111cfe9d --- /dev/null +++ b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/binding/binding.go @@ -0,0 +1,51 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by injection-gen. DO NOT EDIT. + +package binding + +import ( + context "context" + + v1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1" + factory "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/factory" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" + logging "knative.dev/pkg/logging" +) + +func init() { + injection.Default.RegisterInformer(withInformer) +} + +// Key is used for associating the Informer inside the context.Context. +type Key struct{} + +func withInformer(ctx context.Context) (context.Context, controller.Informer) { + f := factory.Get(ctx) + inf := f.Rabbitmq().V1beta1().Bindings() + return context.WithValue(ctx, Key{}, inf), inf.Informer() +} + +// Get extracts the typed informer from the context. +func Get(ctx context.Context) v1beta1.BindingInformer { + untyped := ctx.Value(Key{}) + if untyped == nil { + logging.FromContext(ctx).Panic( + "Unable to fetch knative.dev/eventing-rabbitmq/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1.BindingInformer from context.") + } + return untyped.(v1beta1.BindingInformer) +} diff --git a/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/binding/fake/fake.go b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/binding/fake/fake.go new file mode 100644 index 0000000000..684bbce476 --- /dev/null +++ b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/binding/fake/fake.go @@ -0,0 +1,39 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by injection-gen. DO NOT EDIT. + +package fake + +import ( + context "context" + + fake "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/factory/fake" + binding "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/binding" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" +) + +var Get = binding.Get + +func init() { + injection.Fake.RegisterInformer(withInformer) +} + +func withInformer(ctx context.Context) (context.Context, controller.Informer) { + f := fake.Get(ctx) + inf := f.Rabbitmq().V1beta1().Bindings() + return context.WithValue(ctx, binding.Key{}, inf), inf.Informer() +} diff --git a/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/binding/filtered/binding.go b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/binding/filtered/binding.go new file mode 100644 index 0000000000..f69da9d46c --- /dev/null +++ b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/binding/filtered/binding.go @@ -0,0 +1,64 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by injection-gen. DO NOT EDIT. + +package filtered + +import ( + context "context" + + v1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1" + filtered "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/factory/filtered" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" + logging "knative.dev/pkg/logging" +) + +func init() { + injection.Default.RegisterFilteredInformers(withInformer) +} + +// Key is used for associating the Informer inside the context.Context. +type Key struct { + Selector string +} + +func withInformer(ctx context.Context) (context.Context, []controller.Informer) { + untyped := ctx.Value(filtered.LabelKey{}) + if untyped == nil { + logging.FromContext(ctx).Panic( + "Unable to fetch labelkey from context.") + } + labelSelectors := untyped.([]string) + infs := []controller.Informer{} + for _, selector := range labelSelectors { + f := filtered.Get(ctx, selector) + inf := f.Rabbitmq().V1beta1().Bindings() + ctx = context.WithValue(ctx, Key{Selector: selector}, inf) + infs = append(infs, inf.Informer()) + } + return ctx, infs +} + +// Get extracts the typed informer from the context. +func Get(ctx context.Context, selector string) v1beta1.BindingInformer { + untyped := ctx.Value(Key{Selector: selector}) + if untyped == nil { + logging.FromContext(ctx).Panicf( + "Unable to fetch knative.dev/eventing-rabbitmq/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1.BindingInformer with selector %s from context.", selector) + } + return untyped.(v1beta1.BindingInformer) +} diff --git a/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/binding/filtered/fake/fake.go b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/binding/filtered/fake/fake.go new file mode 100644 index 0000000000..b6c1208f4f --- /dev/null +++ b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/binding/filtered/fake/fake.go @@ -0,0 +1,51 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by injection-gen. DO NOT EDIT. + +package fake + +import ( + context "context" + + factoryfiltered "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/factory/filtered" + filtered "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/binding/filtered" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" + logging "knative.dev/pkg/logging" +) + +var Get = filtered.Get + +func init() { + injection.Fake.RegisterFilteredInformers(withInformer) +} + +func withInformer(ctx context.Context) (context.Context, []controller.Informer) { + untyped := ctx.Value(factoryfiltered.LabelKey{}) + if untyped == nil { + logging.FromContext(ctx).Panic( + "Unable to fetch labelkey from context.") + } + labelSelectors := untyped.([]string) + infs := []controller.Informer{} + for _, selector := range labelSelectors { + f := factoryfiltered.Get(ctx, selector) + inf := f.Rabbitmq().V1beta1().Bindings() + ctx = context.WithValue(ctx, filtered.Key{Selector: selector}, inf) + infs = append(infs, inf.Informer()) + } + return ctx, infs +} diff --git a/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/exchange/exchange.go b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/exchange/exchange.go new file mode 100644 index 0000000000..13874d16b1 --- /dev/null +++ b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/exchange/exchange.go @@ -0,0 +1,51 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by injection-gen. DO NOT EDIT. + +package exchange + +import ( + context "context" + + v1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1" + factory "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/factory" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" + logging "knative.dev/pkg/logging" +) + +func init() { + injection.Default.RegisterInformer(withInformer) +} + +// Key is used for associating the Informer inside the context.Context. +type Key struct{} + +func withInformer(ctx context.Context) (context.Context, controller.Informer) { + f := factory.Get(ctx) + inf := f.Rabbitmq().V1beta1().Exchanges() + return context.WithValue(ctx, Key{}, inf), inf.Informer() +} + +// Get extracts the typed informer from the context. +func Get(ctx context.Context) v1beta1.ExchangeInformer { + untyped := ctx.Value(Key{}) + if untyped == nil { + logging.FromContext(ctx).Panic( + "Unable to fetch knative.dev/eventing-rabbitmq/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1.ExchangeInformer from context.") + } + return untyped.(v1beta1.ExchangeInformer) +} diff --git a/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/exchange/fake/fake.go b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/exchange/fake/fake.go new file mode 100644 index 0000000000..d29b8e2fa0 --- /dev/null +++ b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/exchange/fake/fake.go @@ -0,0 +1,39 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by injection-gen. DO NOT EDIT. + +package fake + +import ( + context "context" + + fake "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/factory/fake" + exchange "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/exchange" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" +) + +var Get = exchange.Get + +func init() { + injection.Fake.RegisterInformer(withInformer) +} + +func withInformer(ctx context.Context) (context.Context, controller.Informer) { + f := fake.Get(ctx) + inf := f.Rabbitmq().V1beta1().Exchanges() + return context.WithValue(ctx, exchange.Key{}, inf), inf.Informer() +} diff --git a/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/exchange/filtered/exchange.go b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/exchange/filtered/exchange.go new file mode 100644 index 0000000000..2aefd1a549 --- /dev/null +++ b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/exchange/filtered/exchange.go @@ -0,0 +1,64 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by injection-gen. DO NOT EDIT. + +package filtered + +import ( + context "context" + + v1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1" + filtered "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/factory/filtered" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" + logging "knative.dev/pkg/logging" +) + +func init() { + injection.Default.RegisterFilteredInformers(withInformer) +} + +// Key is used for associating the Informer inside the context.Context. +type Key struct { + Selector string +} + +func withInformer(ctx context.Context) (context.Context, []controller.Informer) { + untyped := ctx.Value(filtered.LabelKey{}) + if untyped == nil { + logging.FromContext(ctx).Panic( + "Unable to fetch labelkey from context.") + } + labelSelectors := untyped.([]string) + infs := []controller.Informer{} + for _, selector := range labelSelectors { + f := filtered.Get(ctx, selector) + inf := f.Rabbitmq().V1beta1().Exchanges() + ctx = context.WithValue(ctx, Key{Selector: selector}, inf) + infs = append(infs, inf.Informer()) + } + return ctx, infs +} + +// Get extracts the typed informer from the context. +func Get(ctx context.Context, selector string) v1beta1.ExchangeInformer { + untyped := ctx.Value(Key{Selector: selector}) + if untyped == nil { + logging.FromContext(ctx).Panicf( + "Unable to fetch knative.dev/eventing-rabbitmq/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1.ExchangeInformer with selector %s from context.", selector) + } + return untyped.(v1beta1.ExchangeInformer) +} diff --git a/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/exchange/filtered/fake/fake.go b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/exchange/filtered/fake/fake.go new file mode 100644 index 0000000000..b5c4431cda --- /dev/null +++ b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/exchange/filtered/fake/fake.go @@ -0,0 +1,51 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by injection-gen. DO NOT EDIT. + +package fake + +import ( + context "context" + + factoryfiltered "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/factory/filtered" + filtered "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/exchange/filtered" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" + logging "knative.dev/pkg/logging" +) + +var Get = filtered.Get + +func init() { + injection.Fake.RegisterFilteredInformers(withInformer) +} + +func withInformer(ctx context.Context) (context.Context, []controller.Informer) { + untyped := ctx.Value(factoryfiltered.LabelKey{}) + if untyped == nil { + logging.FromContext(ctx).Panic( + "Unable to fetch labelkey from context.") + } + labelSelectors := untyped.([]string) + infs := []controller.Informer{} + for _, selector := range labelSelectors { + f := factoryfiltered.Get(ctx, selector) + inf := f.Rabbitmq().V1beta1().Exchanges() + ctx = context.WithValue(ctx, filtered.Key{Selector: selector}, inf) + infs = append(infs, inf.Informer()) + } + return ctx, infs +} diff --git a/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/permission/fake/fake.go b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/permission/fake/fake.go new file mode 100644 index 0000000000..02b472f522 --- /dev/null +++ b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/permission/fake/fake.go @@ -0,0 +1,39 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by injection-gen. DO NOT EDIT. + +package fake + +import ( + context "context" + + fake "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/factory/fake" + permission "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/permission" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" +) + +var Get = permission.Get + +func init() { + injection.Fake.RegisterInformer(withInformer) +} + +func withInformer(ctx context.Context) (context.Context, controller.Informer) { + f := fake.Get(ctx) + inf := f.Rabbitmq().V1beta1().Permissions() + return context.WithValue(ctx, permission.Key{}, inf), inf.Informer() +} diff --git a/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/permission/filtered/fake/fake.go b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/permission/filtered/fake/fake.go new file mode 100644 index 0000000000..1750b42370 --- /dev/null +++ b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/permission/filtered/fake/fake.go @@ -0,0 +1,51 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by injection-gen. DO NOT EDIT. + +package fake + +import ( + context "context" + + factoryfiltered "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/factory/filtered" + filtered "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/permission/filtered" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" + logging "knative.dev/pkg/logging" +) + +var Get = filtered.Get + +func init() { + injection.Fake.RegisterFilteredInformers(withInformer) +} + +func withInformer(ctx context.Context) (context.Context, []controller.Informer) { + untyped := ctx.Value(factoryfiltered.LabelKey{}) + if untyped == nil { + logging.FromContext(ctx).Panic( + "Unable to fetch labelkey from context.") + } + labelSelectors := untyped.([]string) + infs := []controller.Informer{} + for _, selector := range labelSelectors { + f := factoryfiltered.Get(ctx, selector) + inf := f.Rabbitmq().V1beta1().Permissions() + ctx = context.WithValue(ctx, filtered.Key{Selector: selector}, inf) + infs = append(infs, inf.Informer()) + } + return ctx, infs +} diff --git a/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/permission/filtered/permission.go b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/permission/filtered/permission.go new file mode 100644 index 0000000000..d7bb4c001c --- /dev/null +++ b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/permission/filtered/permission.go @@ -0,0 +1,64 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by injection-gen. DO NOT EDIT. + +package filtered + +import ( + context "context" + + v1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1" + filtered "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/factory/filtered" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" + logging "knative.dev/pkg/logging" +) + +func init() { + injection.Default.RegisterFilteredInformers(withInformer) +} + +// Key is used for associating the Informer inside the context.Context. +type Key struct { + Selector string +} + +func withInformer(ctx context.Context) (context.Context, []controller.Informer) { + untyped := ctx.Value(filtered.LabelKey{}) + if untyped == nil { + logging.FromContext(ctx).Panic( + "Unable to fetch labelkey from context.") + } + labelSelectors := untyped.([]string) + infs := []controller.Informer{} + for _, selector := range labelSelectors { + f := filtered.Get(ctx, selector) + inf := f.Rabbitmq().V1beta1().Permissions() + ctx = context.WithValue(ctx, Key{Selector: selector}, inf) + infs = append(infs, inf.Informer()) + } + return ctx, infs +} + +// Get extracts the typed informer from the context. +func Get(ctx context.Context, selector string) v1beta1.PermissionInformer { + untyped := ctx.Value(Key{Selector: selector}) + if untyped == nil { + logging.FromContext(ctx).Panicf( + "Unable to fetch knative.dev/eventing-rabbitmq/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1.PermissionInformer with selector %s from context.", selector) + } + return untyped.(v1beta1.PermissionInformer) +} diff --git a/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/permission/permission.go b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/permission/permission.go new file mode 100644 index 0000000000..3fef437b43 --- /dev/null +++ b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/permission/permission.go @@ -0,0 +1,51 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by injection-gen. DO NOT EDIT. + +package permission + +import ( + context "context" + + v1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1" + factory "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/factory" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" + logging "knative.dev/pkg/logging" +) + +func init() { + injection.Default.RegisterInformer(withInformer) +} + +// Key is used for associating the Informer inside the context.Context. +type Key struct{} + +func withInformer(ctx context.Context) (context.Context, controller.Informer) { + f := factory.Get(ctx) + inf := f.Rabbitmq().V1beta1().Permissions() + return context.WithValue(ctx, Key{}, inf), inf.Informer() +} + +// Get extracts the typed informer from the context. +func Get(ctx context.Context) v1beta1.PermissionInformer { + untyped := ctx.Value(Key{}) + if untyped == nil { + logging.FromContext(ctx).Panic( + "Unable to fetch knative.dev/eventing-rabbitmq/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1.PermissionInformer from context.") + } + return untyped.(v1beta1.PermissionInformer) +} diff --git a/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/policy/fake/fake.go b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/policy/fake/fake.go new file mode 100644 index 0000000000..20b425ef61 --- /dev/null +++ b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/policy/fake/fake.go @@ -0,0 +1,39 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by injection-gen. DO NOT EDIT. + +package fake + +import ( + context "context" + + fake "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/factory/fake" + policy "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/policy" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" +) + +var Get = policy.Get + +func init() { + injection.Fake.RegisterInformer(withInformer) +} + +func withInformer(ctx context.Context) (context.Context, controller.Informer) { + f := fake.Get(ctx) + inf := f.Rabbitmq().V1beta1().Policies() + return context.WithValue(ctx, policy.Key{}, inf), inf.Informer() +} diff --git a/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/policy/filtered/fake/fake.go b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/policy/filtered/fake/fake.go new file mode 100644 index 0000000000..9991a4799f --- /dev/null +++ b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/policy/filtered/fake/fake.go @@ -0,0 +1,51 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by injection-gen. DO NOT EDIT. + +package fake + +import ( + context "context" + + factoryfiltered "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/factory/filtered" + filtered "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/policy/filtered" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" + logging "knative.dev/pkg/logging" +) + +var Get = filtered.Get + +func init() { + injection.Fake.RegisterFilteredInformers(withInformer) +} + +func withInformer(ctx context.Context) (context.Context, []controller.Informer) { + untyped := ctx.Value(factoryfiltered.LabelKey{}) + if untyped == nil { + logging.FromContext(ctx).Panic( + "Unable to fetch labelkey from context.") + } + labelSelectors := untyped.([]string) + infs := []controller.Informer{} + for _, selector := range labelSelectors { + f := factoryfiltered.Get(ctx, selector) + inf := f.Rabbitmq().V1beta1().Policies() + ctx = context.WithValue(ctx, filtered.Key{Selector: selector}, inf) + infs = append(infs, inf.Informer()) + } + return ctx, infs +} diff --git a/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/policy/filtered/policy.go b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/policy/filtered/policy.go new file mode 100644 index 0000000000..1c3ab3698d --- /dev/null +++ b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/policy/filtered/policy.go @@ -0,0 +1,64 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by injection-gen. DO NOT EDIT. + +package filtered + +import ( + context "context" + + v1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1" + filtered "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/factory/filtered" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" + logging "knative.dev/pkg/logging" +) + +func init() { + injection.Default.RegisterFilteredInformers(withInformer) +} + +// Key is used for associating the Informer inside the context.Context. +type Key struct { + Selector string +} + +func withInformer(ctx context.Context) (context.Context, []controller.Informer) { + untyped := ctx.Value(filtered.LabelKey{}) + if untyped == nil { + logging.FromContext(ctx).Panic( + "Unable to fetch labelkey from context.") + } + labelSelectors := untyped.([]string) + infs := []controller.Informer{} + for _, selector := range labelSelectors { + f := filtered.Get(ctx, selector) + inf := f.Rabbitmq().V1beta1().Policies() + ctx = context.WithValue(ctx, Key{Selector: selector}, inf) + infs = append(infs, inf.Informer()) + } + return ctx, infs +} + +// Get extracts the typed informer from the context. +func Get(ctx context.Context, selector string) v1beta1.PolicyInformer { + untyped := ctx.Value(Key{Selector: selector}) + if untyped == nil { + logging.FromContext(ctx).Panicf( + "Unable to fetch knative.dev/eventing-rabbitmq/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1.PolicyInformer with selector %s from context.", selector) + } + return untyped.(v1beta1.PolicyInformer) +} diff --git a/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/policy/policy.go b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/policy/policy.go new file mode 100644 index 0000000000..519ea6277a --- /dev/null +++ b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/policy/policy.go @@ -0,0 +1,51 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by injection-gen. DO NOT EDIT. + +package policy + +import ( + context "context" + + v1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1" + factory "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/factory" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" + logging "knative.dev/pkg/logging" +) + +func init() { + injection.Default.RegisterInformer(withInformer) +} + +// Key is used for associating the Informer inside the context.Context. +type Key struct{} + +func withInformer(ctx context.Context) (context.Context, controller.Informer) { + f := factory.Get(ctx) + inf := f.Rabbitmq().V1beta1().Policies() + return context.WithValue(ctx, Key{}, inf), inf.Informer() +} + +// Get extracts the typed informer from the context. +func Get(ctx context.Context) v1beta1.PolicyInformer { + untyped := ctx.Value(Key{}) + if untyped == nil { + logging.FromContext(ctx).Panic( + "Unable to fetch knative.dev/eventing-rabbitmq/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1.PolicyInformer from context.") + } + return untyped.(v1beta1.PolicyInformer) +} diff --git a/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/queue/fake/fake.go b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/queue/fake/fake.go new file mode 100644 index 0000000000..cfd9bebbc3 --- /dev/null +++ b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/queue/fake/fake.go @@ -0,0 +1,39 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by injection-gen. DO NOT EDIT. + +package fake + +import ( + context "context" + + fake "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/factory/fake" + queue "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/queue" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" +) + +var Get = queue.Get + +func init() { + injection.Fake.RegisterInformer(withInformer) +} + +func withInformer(ctx context.Context) (context.Context, controller.Informer) { + f := fake.Get(ctx) + inf := f.Rabbitmq().V1beta1().Queues() + return context.WithValue(ctx, queue.Key{}, inf), inf.Informer() +} diff --git a/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/queue/filtered/fake/fake.go b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/queue/filtered/fake/fake.go new file mode 100644 index 0000000000..6c068a1bad --- /dev/null +++ b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/queue/filtered/fake/fake.go @@ -0,0 +1,51 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by injection-gen. DO NOT EDIT. + +package fake + +import ( + context "context" + + factoryfiltered "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/factory/filtered" + filtered "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/queue/filtered" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" + logging "knative.dev/pkg/logging" +) + +var Get = filtered.Get + +func init() { + injection.Fake.RegisterFilteredInformers(withInformer) +} + +func withInformer(ctx context.Context) (context.Context, []controller.Informer) { + untyped := ctx.Value(factoryfiltered.LabelKey{}) + if untyped == nil { + logging.FromContext(ctx).Panic( + "Unable to fetch labelkey from context.") + } + labelSelectors := untyped.([]string) + infs := []controller.Informer{} + for _, selector := range labelSelectors { + f := factoryfiltered.Get(ctx, selector) + inf := f.Rabbitmq().V1beta1().Queues() + ctx = context.WithValue(ctx, filtered.Key{Selector: selector}, inf) + infs = append(infs, inf.Informer()) + } + return ctx, infs +} diff --git a/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/queue/filtered/queue.go b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/queue/filtered/queue.go new file mode 100644 index 0000000000..4ac809678f --- /dev/null +++ b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/queue/filtered/queue.go @@ -0,0 +1,64 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by injection-gen. DO NOT EDIT. + +package filtered + +import ( + context "context" + + v1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1" + filtered "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/factory/filtered" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" + logging "knative.dev/pkg/logging" +) + +func init() { + injection.Default.RegisterFilteredInformers(withInformer) +} + +// Key is used for associating the Informer inside the context.Context. +type Key struct { + Selector string +} + +func withInformer(ctx context.Context) (context.Context, []controller.Informer) { + untyped := ctx.Value(filtered.LabelKey{}) + if untyped == nil { + logging.FromContext(ctx).Panic( + "Unable to fetch labelkey from context.") + } + labelSelectors := untyped.([]string) + infs := []controller.Informer{} + for _, selector := range labelSelectors { + f := filtered.Get(ctx, selector) + inf := f.Rabbitmq().V1beta1().Queues() + ctx = context.WithValue(ctx, Key{Selector: selector}, inf) + infs = append(infs, inf.Informer()) + } + return ctx, infs +} + +// Get extracts the typed informer from the context. +func Get(ctx context.Context, selector string) v1beta1.QueueInformer { + untyped := ctx.Value(Key{Selector: selector}) + if untyped == nil { + logging.FromContext(ctx).Panicf( + "Unable to fetch knative.dev/eventing-rabbitmq/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1.QueueInformer with selector %s from context.", selector) + } + return untyped.(v1beta1.QueueInformer) +} diff --git a/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/queue/queue.go b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/queue/queue.go new file mode 100644 index 0000000000..5a388c02ab --- /dev/null +++ b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/queue/queue.go @@ -0,0 +1,51 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by injection-gen. DO NOT EDIT. + +package queue + +import ( + context "context" + + v1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1" + factory "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/factory" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" + logging "knative.dev/pkg/logging" +) + +func init() { + injection.Default.RegisterInformer(withInformer) +} + +// Key is used for associating the Informer inside the context.Context. +type Key struct{} + +func withInformer(ctx context.Context) (context.Context, controller.Informer) { + f := factory.Get(ctx) + inf := f.Rabbitmq().V1beta1().Queues() + return context.WithValue(ctx, Key{}, inf), inf.Informer() +} + +// Get extracts the typed informer from the context. +func Get(ctx context.Context) v1beta1.QueueInformer { + untyped := ctx.Value(Key{}) + if untyped == nil { + logging.FromContext(ctx).Panic( + "Unable to fetch knative.dev/eventing-rabbitmq/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1.QueueInformer from context.") + } + return untyped.(v1beta1.QueueInformer) +} diff --git a/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/schemareplication/fake/fake.go b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/schemareplication/fake/fake.go new file mode 100644 index 0000000000..f9e6b14c1e --- /dev/null +++ b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/schemareplication/fake/fake.go @@ -0,0 +1,39 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by injection-gen. DO NOT EDIT. + +package fake + +import ( + context "context" + + fake "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/factory/fake" + schemareplication "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/schemareplication" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" +) + +var Get = schemareplication.Get + +func init() { + injection.Fake.RegisterInformer(withInformer) +} + +func withInformer(ctx context.Context) (context.Context, controller.Informer) { + f := fake.Get(ctx) + inf := f.Rabbitmq().V1beta1().SchemaReplications() + return context.WithValue(ctx, schemareplication.Key{}, inf), inf.Informer() +} diff --git a/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/schemareplication/filtered/fake/fake.go b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/schemareplication/filtered/fake/fake.go new file mode 100644 index 0000000000..d3997a7aeb --- /dev/null +++ b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/schemareplication/filtered/fake/fake.go @@ -0,0 +1,51 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by injection-gen. DO NOT EDIT. + +package fake + +import ( + context "context" + + factoryfiltered "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/factory/filtered" + filtered "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/schemareplication/filtered" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" + logging "knative.dev/pkg/logging" +) + +var Get = filtered.Get + +func init() { + injection.Fake.RegisterFilteredInformers(withInformer) +} + +func withInformer(ctx context.Context) (context.Context, []controller.Informer) { + untyped := ctx.Value(factoryfiltered.LabelKey{}) + if untyped == nil { + logging.FromContext(ctx).Panic( + "Unable to fetch labelkey from context.") + } + labelSelectors := untyped.([]string) + infs := []controller.Informer{} + for _, selector := range labelSelectors { + f := factoryfiltered.Get(ctx, selector) + inf := f.Rabbitmq().V1beta1().SchemaReplications() + ctx = context.WithValue(ctx, filtered.Key{Selector: selector}, inf) + infs = append(infs, inf.Informer()) + } + return ctx, infs +} diff --git a/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/schemareplication/filtered/schemareplication.go b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/schemareplication/filtered/schemareplication.go new file mode 100644 index 0000000000..694cc1fe45 --- /dev/null +++ b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/schemareplication/filtered/schemareplication.go @@ -0,0 +1,64 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by injection-gen. DO NOT EDIT. + +package filtered + +import ( + context "context" + + v1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1" + filtered "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/factory/filtered" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" + logging "knative.dev/pkg/logging" +) + +func init() { + injection.Default.RegisterFilteredInformers(withInformer) +} + +// Key is used for associating the Informer inside the context.Context. +type Key struct { + Selector string +} + +func withInformer(ctx context.Context) (context.Context, []controller.Informer) { + untyped := ctx.Value(filtered.LabelKey{}) + if untyped == nil { + logging.FromContext(ctx).Panic( + "Unable to fetch labelkey from context.") + } + labelSelectors := untyped.([]string) + infs := []controller.Informer{} + for _, selector := range labelSelectors { + f := filtered.Get(ctx, selector) + inf := f.Rabbitmq().V1beta1().SchemaReplications() + ctx = context.WithValue(ctx, Key{Selector: selector}, inf) + infs = append(infs, inf.Informer()) + } + return ctx, infs +} + +// Get extracts the typed informer from the context. +func Get(ctx context.Context, selector string) v1beta1.SchemaReplicationInformer { + untyped := ctx.Value(Key{Selector: selector}) + if untyped == nil { + logging.FromContext(ctx).Panicf( + "Unable to fetch knative.dev/eventing-rabbitmq/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1.SchemaReplicationInformer with selector %s from context.", selector) + } + return untyped.(v1beta1.SchemaReplicationInformer) +} diff --git a/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/schemareplication/schemareplication.go b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/schemareplication/schemareplication.go new file mode 100644 index 0000000000..fe90497e7a --- /dev/null +++ b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/schemareplication/schemareplication.go @@ -0,0 +1,51 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by injection-gen. DO NOT EDIT. + +package schemareplication + +import ( + context "context" + + v1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1" + factory "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/factory" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" + logging "knative.dev/pkg/logging" +) + +func init() { + injection.Default.RegisterInformer(withInformer) +} + +// Key is used for associating the Informer inside the context.Context. +type Key struct{} + +func withInformer(ctx context.Context) (context.Context, controller.Informer) { + f := factory.Get(ctx) + inf := f.Rabbitmq().V1beta1().SchemaReplications() + return context.WithValue(ctx, Key{}, inf), inf.Informer() +} + +// Get extracts the typed informer from the context. +func Get(ctx context.Context) v1beta1.SchemaReplicationInformer { + untyped := ctx.Value(Key{}) + if untyped == nil { + logging.FromContext(ctx).Panic( + "Unable to fetch knative.dev/eventing-rabbitmq/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1.SchemaReplicationInformer from context.") + } + return untyped.(v1beta1.SchemaReplicationInformer) +} diff --git a/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/user/fake/fake.go b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/user/fake/fake.go new file mode 100644 index 0000000000..2a422995f1 --- /dev/null +++ b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/user/fake/fake.go @@ -0,0 +1,39 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by injection-gen. DO NOT EDIT. + +package fake + +import ( + context "context" + + fake "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/factory/fake" + user "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/user" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" +) + +var Get = user.Get + +func init() { + injection.Fake.RegisterInformer(withInformer) +} + +func withInformer(ctx context.Context) (context.Context, controller.Informer) { + f := fake.Get(ctx) + inf := f.Rabbitmq().V1beta1().Users() + return context.WithValue(ctx, user.Key{}, inf), inf.Informer() +} diff --git a/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/user/filtered/fake/fake.go b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/user/filtered/fake/fake.go new file mode 100644 index 0000000000..61033d8ddc --- /dev/null +++ b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/user/filtered/fake/fake.go @@ -0,0 +1,51 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by injection-gen. DO NOT EDIT. + +package fake + +import ( + context "context" + + factoryfiltered "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/factory/filtered" + filtered "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/user/filtered" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" + logging "knative.dev/pkg/logging" +) + +var Get = filtered.Get + +func init() { + injection.Fake.RegisterFilteredInformers(withInformer) +} + +func withInformer(ctx context.Context) (context.Context, []controller.Informer) { + untyped := ctx.Value(factoryfiltered.LabelKey{}) + if untyped == nil { + logging.FromContext(ctx).Panic( + "Unable to fetch labelkey from context.") + } + labelSelectors := untyped.([]string) + infs := []controller.Informer{} + for _, selector := range labelSelectors { + f := factoryfiltered.Get(ctx, selector) + inf := f.Rabbitmq().V1beta1().Users() + ctx = context.WithValue(ctx, filtered.Key{Selector: selector}, inf) + infs = append(infs, inf.Informer()) + } + return ctx, infs +} diff --git a/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/user/filtered/user.go b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/user/filtered/user.go new file mode 100644 index 0000000000..f09e1ff30c --- /dev/null +++ b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/user/filtered/user.go @@ -0,0 +1,64 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by injection-gen. DO NOT EDIT. + +package filtered + +import ( + context "context" + + v1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1" + filtered "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/factory/filtered" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" + logging "knative.dev/pkg/logging" +) + +func init() { + injection.Default.RegisterFilteredInformers(withInformer) +} + +// Key is used for associating the Informer inside the context.Context. +type Key struct { + Selector string +} + +func withInformer(ctx context.Context) (context.Context, []controller.Informer) { + untyped := ctx.Value(filtered.LabelKey{}) + if untyped == nil { + logging.FromContext(ctx).Panic( + "Unable to fetch labelkey from context.") + } + labelSelectors := untyped.([]string) + infs := []controller.Informer{} + for _, selector := range labelSelectors { + f := filtered.Get(ctx, selector) + inf := f.Rabbitmq().V1beta1().Users() + ctx = context.WithValue(ctx, Key{Selector: selector}, inf) + infs = append(infs, inf.Informer()) + } + return ctx, infs +} + +// Get extracts the typed informer from the context. +func Get(ctx context.Context, selector string) v1beta1.UserInformer { + untyped := ctx.Value(Key{Selector: selector}) + if untyped == nil { + logging.FromContext(ctx).Panicf( + "Unable to fetch knative.dev/eventing-rabbitmq/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1.UserInformer with selector %s from context.", selector) + } + return untyped.(v1beta1.UserInformer) +} diff --git a/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/user/user.go b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/user/user.go new file mode 100644 index 0000000000..73ea498ef9 --- /dev/null +++ b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/user/user.go @@ -0,0 +1,51 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by injection-gen. DO NOT EDIT. + +package user + +import ( + context "context" + + v1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1" + factory "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/factory" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" + logging "knative.dev/pkg/logging" +) + +func init() { + injection.Default.RegisterInformer(withInformer) +} + +// Key is used for associating the Informer inside the context.Context. +type Key struct{} + +func withInformer(ctx context.Context) (context.Context, controller.Informer) { + f := factory.Get(ctx) + inf := f.Rabbitmq().V1beta1().Users() + return context.WithValue(ctx, Key{}, inf), inf.Informer() +} + +// Get extracts the typed informer from the context. +func Get(ctx context.Context) v1beta1.UserInformer { + untyped := ctx.Value(Key{}) + if untyped == nil { + logging.FromContext(ctx).Panic( + "Unable to fetch knative.dev/eventing-rabbitmq/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1.UserInformer from context.") + } + return untyped.(v1beta1.UserInformer) +} diff --git a/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/vhost/fake/fake.go b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/vhost/fake/fake.go new file mode 100644 index 0000000000..dc99227c67 --- /dev/null +++ b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/vhost/fake/fake.go @@ -0,0 +1,39 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by injection-gen. DO NOT EDIT. + +package fake + +import ( + context "context" + + fake "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/factory/fake" + vhost "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/vhost" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" +) + +var Get = vhost.Get + +func init() { + injection.Fake.RegisterInformer(withInformer) +} + +func withInformer(ctx context.Context) (context.Context, controller.Informer) { + f := fake.Get(ctx) + inf := f.Rabbitmq().V1beta1().Vhosts() + return context.WithValue(ctx, vhost.Key{}, inf), inf.Informer() +} diff --git a/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/vhost/filtered/fake/fake.go b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/vhost/filtered/fake/fake.go new file mode 100644 index 0000000000..a8925d0c98 --- /dev/null +++ b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/vhost/filtered/fake/fake.go @@ -0,0 +1,51 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by injection-gen. DO NOT EDIT. + +package fake + +import ( + context "context" + + factoryfiltered "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/factory/filtered" + filtered "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/vhost/filtered" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" + logging "knative.dev/pkg/logging" +) + +var Get = filtered.Get + +func init() { + injection.Fake.RegisterFilteredInformers(withInformer) +} + +func withInformer(ctx context.Context) (context.Context, []controller.Informer) { + untyped := ctx.Value(factoryfiltered.LabelKey{}) + if untyped == nil { + logging.FromContext(ctx).Panic( + "Unable to fetch labelkey from context.") + } + labelSelectors := untyped.([]string) + infs := []controller.Informer{} + for _, selector := range labelSelectors { + f := factoryfiltered.Get(ctx, selector) + inf := f.Rabbitmq().V1beta1().Vhosts() + ctx = context.WithValue(ctx, filtered.Key{Selector: selector}, inf) + infs = append(infs, inf.Informer()) + } + return ctx, infs +} diff --git a/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/vhost/filtered/vhost.go b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/vhost/filtered/vhost.go new file mode 100644 index 0000000000..36e7703dce --- /dev/null +++ b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/vhost/filtered/vhost.go @@ -0,0 +1,64 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by injection-gen. DO NOT EDIT. + +package filtered + +import ( + context "context" + + v1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1" + filtered "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/factory/filtered" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" + logging "knative.dev/pkg/logging" +) + +func init() { + injection.Default.RegisterFilteredInformers(withInformer) +} + +// Key is used for associating the Informer inside the context.Context. +type Key struct { + Selector string +} + +func withInformer(ctx context.Context) (context.Context, []controller.Informer) { + untyped := ctx.Value(filtered.LabelKey{}) + if untyped == nil { + logging.FromContext(ctx).Panic( + "Unable to fetch labelkey from context.") + } + labelSelectors := untyped.([]string) + infs := []controller.Informer{} + for _, selector := range labelSelectors { + f := filtered.Get(ctx, selector) + inf := f.Rabbitmq().V1beta1().Vhosts() + ctx = context.WithValue(ctx, Key{Selector: selector}, inf) + infs = append(infs, inf.Informer()) + } + return ctx, infs +} + +// Get extracts the typed informer from the context. +func Get(ctx context.Context, selector string) v1beta1.VhostInformer { + untyped := ctx.Value(Key{Selector: selector}) + if untyped == nil { + logging.FromContext(ctx).Panicf( + "Unable to fetch knative.dev/eventing-rabbitmq/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1.VhostInformer with selector %s from context.", selector) + } + return untyped.(v1beta1.VhostInformer) +} diff --git a/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/vhost/vhost.go b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/vhost/vhost.go new file mode 100644 index 0000000000..61ba61a225 --- /dev/null +++ b/third_party/pkg/client/injection/informers/rabbitmq.com/v1beta1/vhost/vhost.go @@ -0,0 +1,51 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by injection-gen. DO NOT EDIT. + +package vhost + +import ( + context "context" + + v1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1" + factory "knative.dev/eventing-rabbitmq/third_party/pkg/client/injection/informers/factory" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" + logging "knative.dev/pkg/logging" +) + +func init() { + injection.Default.RegisterInformer(withInformer) +} + +// Key is used for associating the Informer inside the context.Context. +type Key struct{} + +func withInformer(ctx context.Context) (context.Context, controller.Informer) { + f := factory.Get(ctx) + inf := f.Rabbitmq().V1beta1().Vhosts() + return context.WithValue(ctx, Key{}, inf), inf.Informer() +} + +// Get extracts the typed informer from the context. +func Get(ctx context.Context) v1beta1.VhostInformer { + untyped := ctx.Value(Key{}) + if untyped == nil { + logging.FromContext(ctx).Panic( + "Unable to fetch knative.dev/eventing-rabbitmq/third_party/pkg/client/informers/externalversions/rabbitmq.com/v1beta1.VhostInformer from context.") + } + return untyped.(v1beta1.VhostInformer) +} diff --git a/third_party/pkg/client/listers/rabbitmq.com/v1beta1/binding.go b/third_party/pkg/client/listers/rabbitmq.com/v1beta1/binding.go new file mode 100644 index 0000000000..225e2523d2 --- /dev/null +++ b/third_party/pkg/client/listers/rabbitmq.com/v1beta1/binding.go @@ -0,0 +1,98 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by lister-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" + v1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/apis/rabbitmq.com/v1beta1" +) + +// BindingLister helps list Bindings. +// All objects returned here must be treated as read-only. +type BindingLister interface { + // List lists all Bindings in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1beta1.Binding, err error) + // Bindings returns an object that can list and get Bindings. + Bindings(namespace string) BindingNamespaceLister + BindingListerExpansion +} + +// bindingLister implements the BindingLister interface. +type bindingLister struct { + indexer cache.Indexer +} + +// NewBindingLister returns a new BindingLister. +func NewBindingLister(indexer cache.Indexer) BindingLister { + return &bindingLister{indexer: indexer} +} + +// List lists all Bindings in the indexer. +func (s *bindingLister) List(selector labels.Selector) (ret []*v1beta1.Binding, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.Binding)) + }) + return ret, err +} + +// Bindings returns an object that can list and get Bindings. +func (s *bindingLister) Bindings(namespace string) BindingNamespaceLister { + return bindingNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// BindingNamespaceLister helps list and get Bindings. +// All objects returned here must be treated as read-only. +type BindingNamespaceLister interface { + // List lists all Bindings in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1beta1.Binding, err error) + // Get retrieves the Binding from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1beta1.Binding, error) + BindingNamespaceListerExpansion +} + +// bindingNamespaceLister implements the BindingNamespaceLister +// interface. +type bindingNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all Bindings in the indexer for a given namespace. +func (s bindingNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.Binding, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.Binding)) + }) + return ret, err +} + +// Get retrieves the Binding from the indexer for a given namespace and name. +func (s bindingNamespaceLister) Get(name string) (*v1beta1.Binding, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1beta1.Resource("binding"), name) + } + return obj.(*v1beta1.Binding), nil +} diff --git a/third_party/pkg/client/listers/rabbitmq.com/v1beta1/exchange.go b/third_party/pkg/client/listers/rabbitmq.com/v1beta1/exchange.go new file mode 100644 index 0000000000..845521b592 --- /dev/null +++ b/third_party/pkg/client/listers/rabbitmq.com/v1beta1/exchange.go @@ -0,0 +1,98 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by lister-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" + v1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/apis/rabbitmq.com/v1beta1" +) + +// ExchangeLister helps list Exchanges. +// All objects returned here must be treated as read-only. +type ExchangeLister interface { + // List lists all Exchanges in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1beta1.Exchange, err error) + // Exchanges returns an object that can list and get Exchanges. + Exchanges(namespace string) ExchangeNamespaceLister + ExchangeListerExpansion +} + +// exchangeLister implements the ExchangeLister interface. +type exchangeLister struct { + indexer cache.Indexer +} + +// NewExchangeLister returns a new ExchangeLister. +func NewExchangeLister(indexer cache.Indexer) ExchangeLister { + return &exchangeLister{indexer: indexer} +} + +// List lists all Exchanges in the indexer. +func (s *exchangeLister) List(selector labels.Selector) (ret []*v1beta1.Exchange, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.Exchange)) + }) + return ret, err +} + +// Exchanges returns an object that can list and get Exchanges. +func (s *exchangeLister) Exchanges(namespace string) ExchangeNamespaceLister { + return exchangeNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// ExchangeNamespaceLister helps list and get Exchanges. +// All objects returned here must be treated as read-only. +type ExchangeNamespaceLister interface { + // List lists all Exchanges in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1beta1.Exchange, err error) + // Get retrieves the Exchange from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1beta1.Exchange, error) + ExchangeNamespaceListerExpansion +} + +// exchangeNamespaceLister implements the ExchangeNamespaceLister +// interface. +type exchangeNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all Exchanges in the indexer for a given namespace. +func (s exchangeNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.Exchange, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.Exchange)) + }) + return ret, err +} + +// Get retrieves the Exchange from the indexer for a given namespace and name. +func (s exchangeNamespaceLister) Get(name string) (*v1beta1.Exchange, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1beta1.Resource("exchange"), name) + } + return obj.(*v1beta1.Exchange), nil +} diff --git a/third_party/pkg/client/listers/rabbitmq.com/v1beta1/expansion_generated.go b/third_party/pkg/client/listers/rabbitmq.com/v1beta1/expansion_generated.go new file mode 100644 index 0000000000..a5b536e25e --- /dev/null +++ b/third_party/pkg/client/listers/rabbitmq.com/v1beta1/expansion_generated.go @@ -0,0 +1,82 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by lister-gen. DO NOT EDIT. + +package v1beta1 + +// BindingListerExpansion allows custom methods to be added to +// BindingLister. +type BindingListerExpansion interface{} + +// BindingNamespaceListerExpansion allows custom methods to be added to +// BindingNamespaceLister. +type BindingNamespaceListerExpansion interface{} + +// ExchangeListerExpansion allows custom methods to be added to +// ExchangeLister. +type ExchangeListerExpansion interface{} + +// ExchangeNamespaceListerExpansion allows custom methods to be added to +// ExchangeNamespaceLister. +type ExchangeNamespaceListerExpansion interface{} + +// PermissionListerExpansion allows custom methods to be added to +// PermissionLister. +type PermissionListerExpansion interface{} + +// PermissionNamespaceListerExpansion allows custom methods to be added to +// PermissionNamespaceLister. +type PermissionNamespaceListerExpansion interface{} + +// PolicyListerExpansion allows custom methods to be added to +// PolicyLister. +type PolicyListerExpansion interface{} + +// PolicyNamespaceListerExpansion allows custom methods to be added to +// PolicyNamespaceLister. +type PolicyNamespaceListerExpansion interface{} + +// QueueListerExpansion allows custom methods to be added to +// QueueLister. +type QueueListerExpansion interface{} + +// QueueNamespaceListerExpansion allows custom methods to be added to +// QueueNamespaceLister. +type QueueNamespaceListerExpansion interface{} + +// SchemaReplicationListerExpansion allows custom methods to be added to +// SchemaReplicationLister. +type SchemaReplicationListerExpansion interface{} + +// SchemaReplicationNamespaceListerExpansion allows custom methods to be added to +// SchemaReplicationNamespaceLister. +type SchemaReplicationNamespaceListerExpansion interface{} + +// UserListerExpansion allows custom methods to be added to +// UserLister. +type UserListerExpansion interface{} + +// UserNamespaceListerExpansion allows custom methods to be added to +// UserNamespaceLister. +type UserNamespaceListerExpansion interface{} + +// VhostListerExpansion allows custom methods to be added to +// VhostLister. +type VhostListerExpansion interface{} + +// VhostNamespaceListerExpansion allows custom methods to be added to +// VhostNamespaceLister. +type VhostNamespaceListerExpansion interface{} diff --git a/third_party/pkg/client/listers/rabbitmq.com/v1beta1/permission.go b/third_party/pkg/client/listers/rabbitmq.com/v1beta1/permission.go new file mode 100644 index 0000000000..d1369bd65a --- /dev/null +++ b/third_party/pkg/client/listers/rabbitmq.com/v1beta1/permission.go @@ -0,0 +1,98 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by lister-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" + v1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/apis/rabbitmq.com/v1beta1" +) + +// PermissionLister helps list Permissions. +// All objects returned here must be treated as read-only. +type PermissionLister interface { + // List lists all Permissions in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1beta1.Permission, err error) + // Permissions returns an object that can list and get Permissions. + Permissions(namespace string) PermissionNamespaceLister + PermissionListerExpansion +} + +// permissionLister implements the PermissionLister interface. +type permissionLister struct { + indexer cache.Indexer +} + +// NewPermissionLister returns a new PermissionLister. +func NewPermissionLister(indexer cache.Indexer) PermissionLister { + return &permissionLister{indexer: indexer} +} + +// List lists all Permissions in the indexer. +func (s *permissionLister) List(selector labels.Selector) (ret []*v1beta1.Permission, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.Permission)) + }) + return ret, err +} + +// Permissions returns an object that can list and get Permissions. +func (s *permissionLister) Permissions(namespace string) PermissionNamespaceLister { + return permissionNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// PermissionNamespaceLister helps list and get Permissions. +// All objects returned here must be treated as read-only. +type PermissionNamespaceLister interface { + // List lists all Permissions in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1beta1.Permission, err error) + // Get retrieves the Permission from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1beta1.Permission, error) + PermissionNamespaceListerExpansion +} + +// permissionNamespaceLister implements the PermissionNamespaceLister +// interface. +type permissionNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all Permissions in the indexer for a given namespace. +func (s permissionNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.Permission, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.Permission)) + }) + return ret, err +} + +// Get retrieves the Permission from the indexer for a given namespace and name. +func (s permissionNamespaceLister) Get(name string) (*v1beta1.Permission, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1beta1.Resource("permission"), name) + } + return obj.(*v1beta1.Permission), nil +} diff --git a/third_party/pkg/client/listers/rabbitmq.com/v1beta1/policy.go b/third_party/pkg/client/listers/rabbitmq.com/v1beta1/policy.go new file mode 100644 index 0000000000..36cbd5b597 --- /dev/null +++ b/third_party/pkg/client/listers/rabbitmq.com/v1beta1/policy.go @@ -0,0 +1,98 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by lister-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" + v1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/apis/rabbitmq.com/v1beta1" +) + +// PolicyLister helps list Policies. +// All objects returned here must be treated as read-only. +type PolicyLister interface { + // List lists all Policies in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1beta1.Policy, err error) + // Policies returns an object that can list and get Policies. + Policies(namespace string) PolicyNamespaceLister + PolicyListerExpansion +} + +// policyLister implements the PolicyLister interface. +type policyLister struct { + indexer cache.Indexer +} + +// NewPolicyLister returns a new PolicyLister. +func NewPolicyLister(indexer cache.Indexer) PolicyLister { + return &policyLister{indexer: indexer} +} + +// List lists all Policies in the indexer. +func (s *policyLister) List(selector labels.Selector) (ret []*v1beta1.Policy, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.Policy)) + }) + return ret, err +} + +// Policies returns an object that can list and get Policies. +func (s *policyLister) Policies(namespace string) PolicyNamespaceLister { + return policyNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// PolicyNamespaceLister helps list and get Policies. +// All objects returned here must be treated as read-only. +type PolicyNamespaceLister interface { + // List lists all Policies in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1beta1.Policy, err error) + // Get retrieves the Policy from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1beta1.Policy, error) + PolicyNamespaceListerExpansion +} + +// policyNamespaceLister implements the PolicyNamespaceLister +// interface. +type policyNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all Policies in the indexer for a given namespace. +func (s policyNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.Policy, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.Policy)) + }) + return ret, err +} + +// Get retrieves the Policy from the indexer for a given namespace and name. +func (s policyNamespaceLister) Get(name string) (*v1beta1.Policy, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1beta1.Resource("policy"), name) + } + return obj.(*v1beta1.Policy), nil +} diff --git a/third_party/pkg/client/listers/rabbitmq.com/v1beta1/queue.go b/third_party/pkg/client/listers/rabbitmq.com/v1beta1/queue.go new file mode 100644 index 0000000000..1fc7c55c81 --- /dev/null +++ b/third_party/pkg/client/listers/rabbitmq.com/v1beta1/queue.go @@ -0,0 +1,98 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by lister-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" + v1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/apis/rabbitmq.com/v1beta1" +) + +// QueueLister helps list Queues. +// All objects returned here must be treated as read-only. +type QueueLister interface { + // List lists all Queues in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1beta1.Queue, err error) + // Queues returns an object that can list and get Queues. + Queues(namespace string) QueueNamespaceLister + QueueListerExpansion +} + +// queueLister implements the QueueLister interface. +type queueLister struct { + indexer cache.Indexer +} + +// NewQueueLister returns a new QueueLister. +func NewQueueLister(indexer cache.Indexer) QueueLister { + return &queueLister{indexer: indexer} +} + +// List lists all Queues in the indexer. +func (s *queueLister) List(selector labels.Selector) (ret []*v1beta1.Queue, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.Queue)) + }) + return ret, err +} + +// Queues returns an object that can list and get Queues. +func (s *queueLister) Queues(namespace string) QueueNamespaceLister { + return queueNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// QueueNamespaceLister helps list and get Queues. +// All objects returned here must be treated as read-only. +type QueueNamespaceLister interface { + // List lists all Queues in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1beta1.Queue, err error) + // Get retrieves the Queue from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1beta1.Queue, error) + QueueNamespaceListerExpansion +} + +// queueNamespaceLister implements the QueueNamespaceLister +// interface. +type queueNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all Queues in the indexer for a given namespace. +func (s queueNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.Queue, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.Queue)) + }) + return ret, err +} + +// Get retrieves the Queue from the indexer for a given namespace and name. +func (s queueNamespaceLister) Get(name string) (*v1beta1.Queue, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1beta1.Resource("queue"), name) + } + return obj.(*v1beta1.Queue), nil +} diff --git a/third_party/pkg/client/listers/rabbitmq.com/v1beta1/schemareplication.go b/third_party/pkg/client/listers/rabbitmq.com/v1beta1/schemareplication.go new file mode 100644 index 0000000000..9abbc85dd4 --- /dev/null +++ b/third_party/pkg/client/listers/rabbitmq.com/v1beta1/schemareplication.go @@ -0,0 +1,98 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by lister-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" + v1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/apis/rabbitmq.com/v1beta1" +) + +// SchemaReplicationLister helps list SchemaReplications. +// All objects returned here must be treated as read-only. +type SchemaReplicationLister interface { + // List lists all SchemaReplications in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1beta1.SchemaReplication, err error) + // SchemaReplications returns an object that can list and get SchemaReplications. + SchemaReplications(namespace string) SchemaReplicationNamespaceLister + SchemaReplicationListerExpansion +} + +// schemaReplicationLister implements the SchemaReplicationLister interface. +type schemaReplicationLister struct { + indexer cache.Indexer +} + +// NewSchemaReplicationLister returns a new SchemaReplicationLister. +func NewSchemaReplicationLister(indexer cache.Indexer) SchemaReplicationLister { + return &schemaReplicationLister{indexer: indexer} +} + +// List lists all SchemaReplications in the indexer. +func (s *schemaReplicationLister) List(selector labels.Selector) (ret []*v1beta1.SchemaReplication, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.SchemaReplication)) + }) + return ret, err +} + +// SchemaReplications returns an object that can list and get SchemaReplications. +func (s *schemaReplicationLister) SchemaReplications(namespace string) SchemaReplicationNamespaceLister { + return schemaReplicationNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// SchemaReplicationNamespaceLister helps list and get SchemaReplications. +// All objects returned here must be treated as read-only. +type SchemaReplicationNamespaceLister interface { + // List lists all SchemaReplications in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1beta1.SchemaReplication, err error) + // Get retrieves the SchemaReplication from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1beta1.SchemaReplication, error) + SchemaReplicationNamespaceListerExpansion +} + +// schemaReplicationNamespaceLister implements the SchemaReplicationNamespaceLister +// interface. +type schemaReplicationNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all SchemaReplications in the indexer for a given namespace. +func (s schemaReplicationNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.SchemaReplication, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.SchemaReplication)) + }) + return ret, err +} + +// Get retrieves the SchemaReplication from the indexer for a given namespace and name. +func (s schemaReplicationNamespaceLister) Get(name string) (*v1beta1.SchemaReplication, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1beta1.Resource("schemareplication"), name) + } + return obj.(*v1beta1.SchemaReplication), nil +} diff --git a/third_party/pkg/client/listers/rabbitmq.com/v1beta1/user.go b/third_party/pkg/client/listers/rabbitmq.com/v1beta1/user.go new file mode 100644 index 0000000000..d65249d7b9 --- /dev/null +++ b/third_party/pkg/client/listers/rabbitmq.com/v1beta1/user.go @@ -0,0 +1,98 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by lister-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" + v1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/apis/rabbitmq.com/v1beta1" +) + +// UserLister helps list Users. +// All objects returned here must be treated as read-only. +type UserLister interface { + // List lists all Users in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1beta1.User, err error) + // Users returns an object that can list and get Users. + Users(namespace string) UserNamespaceLister + UserListerExpansion +} + +// userLister implements the UserLister interface. +type userLister struct { + indexer cache.Indexer +} + +// NewUserLister returns a new UserLister. +func NewUserLister(indexer cache.Indexer) UserLister { + return &userLister{indexer: indexer} +} + +// List lists all Users in the indexer. +func (s *userLister) List(selector labels.Selector) (ret []*v1beta1.User, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.User)) + }) + return ret, err +} + +// Users returns an object that can list and get Users. +func (s *userLister) Users(namespace string) UserNamespaceLister { + return userNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// UserNamespaceLister helps list and get Users. +// All objects returned here must be treated as read-only. +type UserNamespaceLister interface { + // List lists all Users in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1beta1.User, err error) + // Get retrieves the User from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1beta1.User, error) + UserNamespaceListerExpansion +} + +// userNamespaceLister implements the UserNamespaceLister +// interface. +type userNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all Users in the indexer for a given namespace. +func (s userNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.User, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.User)) + }) + return ret, err +} + +// Get retrieves the User from the indexer for a given namespace and name. +func (s userNamespaceLister) Get(name string) (*v1beta1.User, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1beta1.Resource("user"), name) + } + return obj.(*v1beta1.User), nil +} diff --git a/third_party/pkg/client/listers/rabbitmq.com/v1beta1/vhost.go b/third_party/pkg/client/listers/rabbitmq.com/v1beta1/vhost.go new file mode 100644 index 0000000000..863adccf0b --- /dev/null +++ b/third_party/pkg/client/listers/rabbitmq.com/v1beta1/vhost.go @@ -0,0 +1,98 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by lister-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" + v1beta1 "knative.dev/eventing-rabbitmq/third_party/pkg/apis/rabbitmq.com/v1beta1" +) + +// VhostLister helps list Vhosts. +// All objects returned here must be treated as read-only. +type VhostLister interface { + // List lists all Vhosts in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1beta1.Vhost, err error) + // Vhosts returns an object that can list and get Vhosts. + Vhosts(namespace string) VhostNamespaceLister + VhostListerExpansion +} + +// vhostLister implements the VhostLister interface. +type vhostLister struct { + indexer cache.Indexer +} + +// NewVhostLister returns a new VhostLister. +func NewVhostLister(indexer cache.Indexer) VhostLister { + return &vhostLister{indexer: indexer} +} + +// List lists all Vhosts in the indexer. +func (s *vhostLister) List(selector labels.Selector) (ret []*v1beta1.Vhost, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.Vhost)) + }) + return ret, err +} + +// Vhosts returns an object that can list and get Vhosts. +func (s *vhostLister) Vhosts(namespace string) VhostNamespaceLister { + return vhostNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// VhostNamespaceLister helps list and get Vhosts. +// All objects returned here must be treated as read-only. +type VhostNamespaceLister interface { + // List lists all Vhosts in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1beta1.Vhost, err error) + // Get retrieves the Vhost from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1beta1.Vhost, error) + VhostNamespaceListerExpansion +} + +// vhostNamespaceLister implements the VhostNamespaceLister +// interface. +type vhostNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all Vhosts in the indexer for a given namespace. +func (s vhostNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.Vhost, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.Vhost)) + }) + return ret, err +} + +// Get retrieves the Vhost from the indexer for a given namespace and name. +func (s vhostNamespaceLister) Get(name string) (*v1beta1.Vhost, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1beta1.Resource("vhost"), name) + } + return obj.(*v1beta1.Vhost), nil +} diff --git a/vendor/modules.txt b/vendor/modules.txt index c7f51bcc42..4a344e04ac 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1168,6 +1168,7 @@ knative.dev/reconciler-test/pkg/milestone knative.dev/reconciler-test/pkg/state knative.dev/reconciler-test/resources/svc # sigs.k8s.io/controller-runtime v0.8.3 +## explicit sigs.k8s.io/controller-runtime sigs.k8s.io/controller-runtime/pkg/builder sigs.k8s.io/controller-runtime/pkg/cache