blob: 91ba3e30202432cdadc2a98d32ec3042f23cf164 [file] [log] [blame]
// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright ownership.
// The ASF licenses this file to You 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 protoc-gen-connect-go. DO NOT EDIT.
//
// Source: registry/v1alpha1/docker.proto
package registryv1alpha1connect
import (
context "context"
errors "errors"
v1alpha1 "github.com/apache/dubbo-kubernetes/pkg/bufman/gen/proto/go/registry/v1alpha1"
connect_go "github.com/bufbuild/connect-go"
http "net/http"
strings "strings"
)
// This is a compile-time assertion to ensure that this generated file and the connect package are
// compatible. If you get a compiler error that this constant is not defined, this code was
// generated with a version of connect newer than the one compiled into your binary. You can fix the
// problem by either regenerating this code with an older version of connect or updating the connect
// version compiled into your binary.
const _ = connect_go.IsAtLeastVersion1_7_0
const (
// DockerRepoServiceName is the fully-qualified name of the DockerRepoService service.
DockerRepoServiceName = "bufman.dubbo.apache.org.registry.v1alpha1.DockerRepoService"
)
// These constants are the fully-qualified names of the RPCs defined in this package. They're
// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.
//
// Note that these are different from the fully-qualified method names used by
// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to
// reflection-formatted method names, remove the leading slash and convert the remaining slash to a
// period.
const (
// DockerRepoServiceCreateDockerRepoProcedure is the fully-qualified name of the DockerRepoService's
// CreateDockerRepo RPC.
DockerRepoServiceCreateDockerRepoProcedure = "/bufman.dubbo.apache.org.registry.v1alpha1.DockerRepoService/CreateDockerRepo"
// DockerRepoServiceGetDockerRepoProcedure is the fully-qualified name of the DockerRepoService's
// GetDockerRepo RPC.
DockerRepoServiceGetDockerRepoProcedure = "/bufman.dubbo.apache.org.registry.v1alpha1.DockerRepoService/GetDockerRepo"
// DockerRepoServiceGetDockerRepoByNameProcedure is the fully-qualified name of the
// DockerRepoService's GetDockerRepoByName RPC.
DockerRepoServiceGetDockerRepoByNameProcedure = "/bufman.dubbo.apache.org.registry.v1alpha1.DockerRepoService/GetDockerRepoByName"
// DockerRepoServiceListDockerReposProcedure is the fully-qualified name of the DockerRepoService's
// ListDockerRepos RPC.
DockerRepoServiceListDockerReposProcedure = "/bufman.dubbo.apache.org.registry.v1alpha1.DockerRepoService/ListDockerRepos"
// DockerRepoServiceUpdateDockerRepoByNameProcedure is the fully-qualified name of the
// DockerRepoService's UpdateDockerRepoByName RPC.
DockerRepoServiceUpdateDockerRepoByNameProcedure = "/bufman.dubbo.apache.org.registry.v1alpha1.DockerRepoService/UpdateDockerRepoByName"
// DockerRepoServiceUpdateDockerRepoByIDProcedure is the fully-qualified name of the
// DockerRepoService's UpdateDockerRepoByID RPC.
DockerRepoServiceUpdateDockerRepoByIDProcedure = "/bufman.dubbo.apache.org.registry.v1alpha1.DockerRepoService/UpdateDockerRepoByID"
)
// DockerRepoServiceClient is a client for the
// bufman.dubbo.apache.org.registry.v1alpha1.DockerRepoService service.
type DockerRepoServiceClient interface {
// CreateDockerRepo create a docker repo for user
//
// This method requires authentication.
CreateDockerRepo(context.Context, *connect_go.Request[v1alpha1.CreateDockerRepoRequest]) (*connect_go.Response[v1alpha1.CreateDockerRepoResponse], error)
// GetDockerRepo get a user's docker repo by id
//
// This method requires authentication.
GetDockerRepo(context.Context, *connect_go.Request[v1alpha1.GetDockerRepoRequest]) (*connect_go.Response[v1alpha1.GetDockerRepoResponse], error)
// GetDockerRepoByName get a user's docker repo by name
//
// This method requires authentication.
GetDockerRepoByName(context.Context, *connect_go.Request[v1alpha1.GetDockerRepoByNameRequest]) (*connect_go.Response[v1alpha1.GetDockerRepoByNameResponse], error)
// ListDockerRepos lists the user's all docker repo entries
//
// This method requires authentication.
ListDockerRepos(context.Context, *connect_go.Request[v1alpha1.ListDockerReposRequest]) (*connect_go.Response[v1alpha1.ListDockerReposResponse], error)
// UpdateDockerRepoByName given a name, to update address、username、password
//
// This method requires authentication.
UpdateDockerRepoByName(context.Context, *connect_go.Request[v1alpha1.UpdateDockerRepoByNameRequest]) (*connect_go.Response[v1alpha1.UpdateDockerRepoByNameResponse], error)
// UpdateDockerRepoByName given a id, to update address、username、password
//
// This method requires authentication.
UpdateDockerRepoByID(context.Context, *connect_go.Request[v1alpha1.UpdateDockerRepoByIDRequest]) (*connect_go.Response[v1alpha1.UpdateDockerRepoByIDResponse], error)
}
// NewDockerRepoServiceClient constructs a client for the
// bufman.dubbo.apache.org.registry.v1alpha1.DockerRepoService service. By default, it uses the
// Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends
// uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or
// connect.WithGRPCWeb() options.
//
// The URL supplied here should be the base URL for the Connect or gRPC server (for example,
// http://api.acme.com or https://acme.com/grpc).
func NewDockerRepoServiceClient(httpClient connect_go.HTTPClient, baseURL string, opts ...connect_go.ClientOption) DockerRepoServiceClient {
baseURL = strings.TrimRight(baseURL, "/")
return &dockerRepoServiceClient{
createDockerRepo: connect_go.NewClient[v1alpha1.CreateDockerRepoRequest, v1alpha1.CreateDockerRepoResponse](
httpClient,
baseURL+DockerRepoServiceCreateDockerRepoProcedure,
connect_go.WithIdempotency(connect_go.IdempotencyIdempotent),
connect_go.WithClientOptions(opts...),
),
getDockerRepo: connect_go.NewClient[v1alpha1.GetDockerRepoRequest, v1alpha1.GetDockerRepoResponse](
httpClient,
baseURL+DockerRepoServiceGetDockerRepoProcedure,
connect_go.WithIdempotency(connect_go.IdempotencyNoSideEffects),
connect_go.WithClientOptions(opts...),
),
getDockerRepoByName: connect_go.NewClient[v1alpha1.GetDockerRepoByNameRequest, v1alpha1.GetDockerRepoByNameResponse](
httpClient,
baseURL+DockerRepoServiceGetDockerRepoByNameProcedure,
connect_go.WithIdempotency(connect_go.IdempotencyNoSideEffects),
connect_go.WithClientOptions(opts...),
),
listDockerRepos: connect_go.NewClient[v1alpha1.ListDockerReposRequest, v1alpha1.ListDockerReposResponse](
httpClient,
baseURL+DockerRepoServiceListDockerReposProcedure,
connect_go.WithIdempotency(connect_go.IdempotencyNoSideEffects),
connect_go.WithClientOptions(opts...),
),
updateDockerRepoByName: connect_go.NewClient[v1alpha1.UpdateDockerRepoByNameRequest, v1alpha1.UpdateDockerRepoByNameResponse](
httpClient,
baseURL+DockerRepoServiceUpdateDockerRepoByNameProcedure,
connect_go.WithIdempotency(connect_go.IdempotencyIdempotent),
connect_go.WithClientOptions(opts...),
),
updateDockerRepoByID: connect_go.NewClient[v1alpha1.UpdateDockerRepoByIDRequest, v1alpha1.UpdateDockerRepoByIDResponse](
httpClient,
baseURL+DockerRepoServiceUpdateDockerRepoByIDProcedure,
connect_go.WithIdempotency(connect_go.IdempotencyIdempotent),
connect_go.WithClientOptions(opts...),
),
}
}
// dockerRepoServiceClient implements DockerRepoServiceClient.
type dockerRepoServiceClient struct {
createDockerRepo *connect_go.Client[v1alpha1.CreateDockerRepoRequest, v1alpha1.CreateDockerRepoResponse]
getDockerRepo *connect_go.Client[v1alpha1.GetDockerRepoRequest, v1alpha1.GetDockerRepoResponse]
getDockerRepoByName *connect_go.Client[v1alpha1.GetDockerRepoByNameRequest, v1alpha1.GetDockerRepoByNameResponse]
listDockerRepos *connect_go.Client[v1alpha1.ListDockerReposRequest, v1alpha1.ListDockerReposResponse]
updateDockerRepoByName *connect_go.Client[v1alpha1.UpdateDockerRepoByNameRequest, v1alpha1.UpdateDockerRepoByNameResponse]
updateDockerRepoByID *connect_go.Client[v1alpha1.UpdateDockerRepoByIDRequest, v1alpha1.UpdateDockerRepoByIDResponse]
}
// CreateDockerRepo calls
// bufman.dubbo.apache.org.registry.v1alpha1.DockerRepoService.CreateDockerRepo.
func (c *dockerRepoServiceClient) CreateDockerRepo(ctx context.Context, req *connect_go.Request[v1alpha1.CreateDockerRepoRequest]) (*connect_go.Response[v1alpha1.CreateDockerRepoResponse], error) {
return c.createDockerRepo.CallUnary(ctx, req)
}
// GetDockerRepo calls bufman.dubbo.apache.org.registry.v1alpha1.DockerRepoService.GetDockerRepo.
func (c *dockerRepoServiceClient) GetDockerRepo(ctx context.Context, req *connect_go.Request[v1alpha1.GetDockerRepoRequest]) (*connect_go.Response[v1alpha1.GetDockerRepoResponse], error) {
return c.getDockerRepo.CallUnary(ctx, req)
}
// GetDockerRepoByName calls
// bufman.dubbo.apache.org.registry.v1alpha1.DockerRepoService.GetDockerRepoByName.
func (c *dockerRepoServiceClient) GetDockerRepoByName(ctx context.Context, req *connect_go.Request[v1alpha1.GetDockerRepoByNameRequest]) (*connect_go.Response[v1alpha1.GetDockerRepoByNameResponse], error) {
return c.getDockerRepoByName.CallUnary(ctx, req)
}
// ListDockerRepos calls
// bufman.dubbo.apache.org.registry.v1alpha1.DockerRepoService.ListDockerRepos.
func (c *dockerRepoServiceClient) ListDockerRepos(ctx context.Context, req *connect_go.Request[v1alpha1.ListDockerReposRequest]) (*connect_go.Response[v1alpha1.ListDockerReposResponse], error) {
return c.listDockerRepos.CallUnary(ctx, req)
}
// UpdateDockerRepoByName calls
// bufman.dubbo.apache.org.registry.v1alpha1.DockerRepoService.UpdateDockerRepoByName.
func (c *dockerRepoServiceClient) UpdateDockerRepoByName(ctx context.Context, req *connect_go.Request[v1alpha1.UpdateDockerRepoByNameRequest]) (*connect_go.Response[v1alpha1.UpdateDockerRepoByNameResponse], error) {
return c.updateDockerRepoByName.CallUnary(ctx, req)
}
// UpdateDockerRepoByID calls
// bufman.dubbo.apache.org.registry.v1alpha1.DockerRepoService.UpdateDockerRepoByID.
func (c *dockerRepoServiceClient) UpdateDockerRepoByID(ctx context.Context, req *connect_go.Request[v1alpha1.UpdateDockerRepoByIDRequest]) (*connect_go.Response[v1alpha1.UpdateDockerRepoByIDResponse], error) {
return c.updateDockerRepoByID.CallUnary(ctx, req)
}
// DockerRepoServiceHandler is an implementation of the
// bufman.dubbo.apache.org.registry.v1alpha1.DockerRepoService service.
type DockerRepoServiceHandler interface {
// CreateDockerRepo create a docker repo for user
//
// This method requires authentication.
CreateDockerRepo(context.Context, *connect_go.Request[v1alpha1.CreateDockerRepoRequest]) (*connect_go.Response[v1alpha1.CreateDockerRepoResponse], error)
// GetDockerRepo get a user's docker repo by id
//
// This method requires authentication.
GetDockerRepo(context.Context, *connect_go.Request[v1alpha1.GetDockerRepoRequest]) (*connect_go.Response[v1alpha1.GetDockerRepoResponse], error)
// GetDockerRepoByName get a user's docker repo by name
//
// This method requires authentication.
GetDockerRepoByName(context.Context, *connect_go.Request[v1alpha1.GetDockerRepoByNameRequest]) (*connect_go.Response[v1alpha1.GetDockerRepoByNameResponse], error)
// ListDockerRepos lists the user's all docker repo entries
//
// This method requires authentication.
ListDockerRepos(context.Context, *connect_go.Request[v1alpha1.ListDockerReposRequest]) (*connect_go.Response[v1alpha1.ListDockerReposResponse], error)
// UpdateDockerRepoByName given a name, to update address、username、password
//
// This method requires authentication.
UpdateDockerRepoByName(context.Context, *connect_go.Request[v1alpha1.UpdateDockerRepoByNameRequest]) (*connect_go.Response[v1alpha1.UpdateDockerRepoByNameResponse], error)
// UpdateDockerRepoByName given a id, to update address、username、password
//
// This method requires authentication.
UpdateDockerRepoByID(context.Context, *connect_go.Request[v1alpha1.UpdateDockerRepoByIDRequest]) (*connect_go.Response[v1alpha1.UpdateDockerRepoByIDResponse], error)
}
// NewDockerRepoServiceHandler builds an HTTP handler from the service implementation. It returns
// the path on which to mount the handler and the handler itself.
//
// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf
// and JSON codecs. They also support gzip compression.
func NewDockerRepoServiceHandler(svc DockerRepoServiceHandler, opts ...connect_go.HandlerOption) (string, http.Handler) {
dockerRepoServiceCreateDockerRepoHandler := connect_go.NewUnaryHandler(
DockerRepoServiceCreateDockerRepoProcedure,
svc.CreateDockerRepo,
connect_go.WithIdempotency(connect_go.IdempotencyIdempotent),
connect_go.WithHandlerOptions(opts...),
)
dockerRepoServiceGetDockerRepoHandler := connect_go.NewUnaryHandler(
DockerRepoServiceGetDockerRepoProcedure,
svc.GetDockerRepo,
connect_go.WithIdempotency(connect_go.IdempotencyNoSideEffects),
connect_go.WithHandlerOptions(opts...),
)
dockerRepoServiceGetDockerRepoByNameHandler := connect_go.NewUnaryHandler(
DockerRepoServiceGetDockerRepoByNameProcedure,
svc.GetDockerRepoByName,
connect_go.WithIdempotency(connect_go.IdempotencyNoSideEffects),
connect_go.WithHandlerOptions(opts...),
)
dockerRepoServiceListDockerReposHandler := connect_go.NewUnaryHandler(
DockerRepoServiceListDockerReposProcedure,
svc.ListDockerRepos,
connect_go.WithIdempotency(connect_go.IdempotencyNoSideEffects),
connect_go.WithHandlerOptions(opts...),
)
dockerRepoServiceUpdateDockerRepoByNameHandler := connect_go.NewUnaryHandler(
DockerRepoServiceUpdateDockerRepoByNameProcedure,
svc.UpdateDockerRepoByName,
connect_go.WithIdempotency(connect_go.IdempotencyIdempotent),
connect_go.WithHandlerOptions(opts...),
)
dockerRepoServiceUpdateDockerRepoByIDHandler := connect_go.NewUnaryHandler(
DockerRepoServiceUpdateDockerRepoByIDProcedure,
svc.UpdateDockerRepoByID,
connect_go.WithIdempotency(connect_go.IdempotencyIdempotent),
connect_go.WithHandlerOptions(opts...),
)
return "/bufman.dubbo.apache.org.registry.v1alpha1.DockerRepoService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
switch r.URL.Path {
case DockerRepoServiceCreateDockerRepoProcedure:
dockerRepoServiceCreateDockerRepoHandler.ServeHTTP(w, r)
case DockerRepoServiceGetDockerRepoProcedure:
dockerRepoServiceGetDockerRepoHandler.ServeHTTP(w, r)
case DockerRepoServiceGetDockerRepoByNameProcedure:
dockerRepoServiceGetDockerRepoByNameHandler.ServeHTTP(w, r)
case DockerRepoServiceListDockerReposProcedure:
dockerRepoServiceListDockerReposHandler.ServeHTTP(w, r)
case DockerRepoServiceUpdateDockerRepoByNameProcedure:
dockerRepoServiceUpdateDockerRepoByNameHandler.ServeHTTP(w, r)
case DockerRepoServiceUpdateDockerRepoByIDProcedure:
dockerRepoServiceUpdateDockerRepoByIDHandler.ServeHTTP(w, r)
default:
http.NotFound(w, r)
}
})
}
// UnimplementedDockerRepoServiceHandler returns CodeUnimplemented from all methods.
type UnimplementedDockerRepoServiceHandler struct{}
func (UnimplementedDockerRepoServiceHandler) CreateDockerRepo(context.Context, *connect_go.Request[v1alpha1.CreateDockerRepoRequest]) (*connect_go.Response[v1alpha1.CreateDockerRepoResponse], error) {
return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("bufman.dubbo.apache.org.registry.v1alpha1.DockerRepoService.CreateDockerRepo is not implemented"))
}
func (UnimplementedDockerRepoServiceHandler) GetDockerRepo(context.Context, *connect_go.Request[v1alpha1.GetDockerRepoRequest]) (*connect_go.Response[v1alpha1.GetDockerRepoResponse], error) {
return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("bufman.dubbo.apache.org.registry.v1alpha1.DockerRepoService.GetDockerRepo is not implemented"))
}
func (UnimplementedDockerRepoServiceHandler) GetDockerRepoByName(context.Context, *connect_go.Request[v1alpha1.GetDockerRepoByNameRequest]) (*connect_go.Response[v1alpha1.GetDockerRepoByNameResponse], error) {
return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("bufman.dubbo.apache.org.registry.v1alpha1.DockerRepoService.GetDockerRepoByName is not implemented"))
}
func (UnimplementedDockerRepoServiceHandler) ListDockerRepos(context.Context, *connect_go.Request[v1alpha1.ListDockerReposRequest]) (*connect_go.Response[v1alpha1.ListDockerReposResponse], error) {
return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("bufman.dubbo.apache.org.registry.v1alpha1.DockerRepoService.ListDockerRepos is not implemented"))
}
func (UnimplementedDockerRepoServiceHandler) UpdateDockerRepoByName(context.Context, *connect_go.Request[v1alpha1.UpdateDockerRepoByNameRequest]) (*connect_go.Response[v1alpha1.UpdateDockerRepoByNameResponse], error) {
return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("bufman.dubbo.apache.org.registry.v1alpha1.DockerRepoService.UpdateDockerRepoByName is not implemented"))
}
func (UnimplementedDockerRepoServiceHandler) UpdateDockerRepoByID(context.Context, *connect_go.Request[v1alpha1.UpdateDockerRepoByIDRequest]) (*connect_go.Response[v1alpha1.UpdateDockerRepoByIDResponse], error) {
return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("bufman.dubbo.apache.org.registry.v1alpha1.DockerRepoService.UpdateDockerRepoByID is not implemented"))
}