Migrate to newer grpc utilities and bump deps (#593)
* Migrate to newer grpc utilities and bump deps * Revert grpc back as it was an accidental tag
This commit is contained in:
1 parent
273cf29ba4
commit
7f00e61ab0
34 files changed
+4511
-4474
No files matched your search
@@ -7,15 +7,11 @@
|
||||
package services
|
||||
|
||||
import (
|
||||
context "context"
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
_ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options"
|
||||
hosts "github.com/hashicorp/boundary/internal/gen/controller/api/resources/hosts"
|
||||
_ "google.golang.org/genproto/googleapis/api/annotations"
|
||||
field_mask "google.golang.org/genproto/protobuf/field_mask"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
@@ -840,273 +836,3 @@ func file_controller_api_services_v1_host_service_proto_init() {
|
||||
file_controller_api_services_v1_host_service_proto_goTypes = nil
|
||||
file_controller_api_services_v1_host_service_proto_depIdxs = nil
|
||||
}
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ context.Context
|
||||
var _ grpc.ClientConnInterface
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
const _ = grpc.SupportPackageIsVersion6
|
||||
|
||||
// HostServiceClient is the client API for HostService service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
||||
type HostServiceClient interface {
|
||||
// GetHost returns a stored Host if present. The provided request
|
||||
// must include the host ID for the resource being retrieved. If the ID is
|
||||
// missing, malformed or referencing anon existing resource an error is
|
||||
// returned.
|
||||
GetHost(ctx context.Context, in *GetHostRequest, opts ...grpc.CallOption) (*GetHostResponse, error)
|
||||
// ListHosts returns a list of stored hosts which exist inside the provided
|
||||
// Host Catalog. The request must include the Host Catalog id containing the
|
||||
// Hosts being listed. If the id is missing, malformed, or reference a
|
||||
// non-existing resource, an error is returned.
|
||||
ListHosts(ctx context.Context, in *ListHostsRequest, opts ...grpc.CallOption) (*ListHostsResponse, error)
|
||||
// CreateHost creates and stores a Host in boundary. The provided
|
||||
// request must include the Host Catalog id in which the Host
|
||||
// will be created. If the Catalog id is missing, malformed or references a
|
||||
// non-existing resource, an error is returned. If a name is provided that
|
||||
// is in use by another Host in the same Host Catalog, an error is returned.
|
||||
CreateHost(ctx context.Context, in *CreateHostRequest, opts ...grpc.CallOption) (*CreateHostResponse, error)
|
||||
// UpdateHost updates an existing Host in boundary. The provided
|
||||
// Host must not have any read only fields set. The update mask must be
|
||||
// included in the request and contain at least 1 mutable field. To unset
|
||||
// a field's value, include the field in the update mask and don't set it
|
||||
// in the provided Host. An error is returned if the Host id is missing or
|
||||
// reference a non-existing resource. An error is also returned if the
|
||||
// request attempts to update the name to one that is already in use in
|
||||
// the same Host Catalog.
|
||||
UpdateHost(ctx context.Context, in *UpdateHostRequest, opts ...grpc.CallOption) (*UpdateHostResponse, error)
|
||||
// DeleteHost removes a Host from Boundary. If the provided Host ID
|
||||
// is malformed or not provided an error is returned.
|
||||
DeleteHost(ctx context.Context, in *DeleteHostRequest, opts ...grpc.CallOption) (*DeleteHostResponse, error)
|
||||
}
|
||||
|
||||
type hostServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewHostServiceClient(cc grpc.ClientConnInterface) HostServiceClient {
|
||||
return &hostServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *hostServiceClient) GetHost(ctx context.Context, in *GetHostRequest, opts ...grpc.CallOption) (*GetHostResponse, error) {
|
||||
out := new(GetHostResponse)
|
||||
err := c.cc.Invoke(ctx, "/controller.api.services.v1.HostService/GetHost", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *hostServiceClient) ListHosts(ctx context.Context, in *ListHostsRequest, opts ...grpc.CallOption) (*ListHostsResponse, error) {
|
||||
out := new(ListHostsResponse)
|
||||
err := c.cc.Invoke(ctx, "/controller.api.services.v1.HostService/ListHosts", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *hostServiceClient) CreateHost(ctx context.Context, in *CreateHostRequest, opts ...grpc.CallOption) (*CreateHostResponse, error) {
|
||||
out := new(CreateHostResponse)
|
||||
err := c.cc.Invoke(ctx, "/controller.api.services.v1.HostService/CreateHost", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *hostServiceClient) UpdateHost(ctx context.Context, in *UpdateHostRequest, opts ...grpc.CallOption) (*UpdateHostResponse, error) {
|
||||
out := new(UpdateHostResponse)
|
||||
err := c.cc.Invoke(ctx, "/controller.api.services.v1.HostService/UpdateHost", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *hostServiceClient) DeleteHost(ctx context.Context, in *DeleteHostRequest, opts ...grpc.CallOption) (*DeleteHostResponse, error) {
|
||||
out := new(DeleteHostResponse)
|
||||
err := c.cc.Invoke(ctx, "/controller.api.services.v1.HostService/DeleteHost", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// HostServiceServer is the server API for HostService service.
|
||||
type HostServiceServer interface {
|
||||
// GetHost returns a stored Host if present. The provided request
|
||||
// must include the host ID for the resource being retrieved. If the ID is
|
||||
// missing, malformed or referencing anon existing resource an error is
|
||||
// returned.
|
||||
GetHost(context.Context, *GetHostRequest) (*GetHostResponse, error)
|
||||
// ListHosts returns a list of stored hosts which exist inside the provided
|
||||
// Host Catalog. The request must include the Host Catalog id containing the
|
||||
// Hosts being listed. If the id is missing, malformed, or reference a
|
||||
// non-existing resource, an error is returned.
|
||||
ListHosts(context.Context, *ListHostsRequest) (*ListHostsResponse, error)
|
||||
// CreateHost creates and stores a Host in boundary. The provided
|
||||
// request must include the Host Catalog id in which the Host
|
||||
// will be created. If the Catalog id is missing, malformed or references a
|
||||
// non-existing resource, an error is returned. If a name is provided that
|
||||
// is in use by another Host in the same Host Catalog, an error is returned.
|
||||
CreateHost(context.Context, *CreateHostRequest) (*CreateHostResponse, error)
|
||||
// UpdateHost updates an existing Host in boundary. The provided
|
||||
// Host must not have any read only fields set. The update mask must be
|
||||
// included in the request and contain at least 1 mutable field. To unset
|
||||
// a field's value, include the field in the update mask and don't set it
|
||||
// in the provided Host. An error is returned if the Host id is missing or
|
||||
// reference a non-existing resource. An error is also returned if the
|
||||
// request attempts to update the name to one that is already in use in
|
||||
// the same Host Catalog.
|
||||
UpdateHost(context.Context, *UpdateHostRequest) (*UpdateHostResponse, error)
|
||||
// DeleteHost removes a Host from Boundary. If the provided Host ID
|
||||
// is malformed or not provided an error is returned.
|
||||
DeleteHost(context.Context, *DeleteHostRequest) (*DeleteHostResponse, error)
|
||||
}
|
||||
|
||||
// UnimplementedHostServiceServer can be embedded to have forward compatible implementations.
|
||||
type UnimplementedHostServiceServer struct {
|
||||
}
|
||||
|
||||
func (*UnimplementedHostServiceServer) GetHost(context.Context, *GetHostRequest) (*GetHostResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetHost not implemented")
|
||||
}
|
||||
func (*UnimplementedHostServiceServer) ListHosts(context.Context, *ListHostsRequest) (*ListHostsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListHosts not implemented")
|
||||
}
|
||||
func (*UnimplementedHostServiceServer) CreateHost(context.Context, *CreateHostRequest) (*CreateHostResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method CreateHost not implemented")
|
||||
}
|
||||
func (*UnimplementedHostServiceServer) UpdateHost(context.Context, *UpdateHostRequest) (*UpdateHostResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateHost not implemented")
|
||||
}
|
||||
func (*UnimplementedHostServiceServer) DeleteHost(context.Context, *DeleteHostRequest) (*DeleteHostResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method DeleteHost not implemented")
|
||||
}
|
||||
|
||||
func RegisterHostServiceServer(s *grpc.Server, srv HostServiceServer) {
|
||||
s.RegisterService(&_HostService_serviceDesc, srv)
|
||||
}
|
||||
|
||||
func _HostService_GetHost_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetHostRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(HostServiceServer).GetHost(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/controller.api.services.v1.HostService/GetHost",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(HostServiceServer).GetHost(ctx, req.(*GetHostRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _HostService_ListHosts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListHostsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(HostServiceServer).ListHosts(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/controller.api.services.v1.HostService/ListHosts",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(HostServiceServer).ListHosts(ctx, req.(*ListHostsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _HostService_CreateHost_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CreateHostRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(HostServiceServer).CreateHost(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/controller.api.services.v1.HostService/CreateHost",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(HostServiceServer).CreateHost(ctx, req.(*CreateHostRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _HostService_UpdateHost_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UpdateHostRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(HostServiceServer).UpdateHost(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/controller.api.services.v1.HostService/UpdateHost",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(HostServiceServer).UpdateHost(ctx, req.(*UpdateHostRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _HostService_DeleteHost_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(DeleteHostRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(HostServiceServer).DeleteHost(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/controller.api.services.v1.HostService/DeleteHost",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(HostServiceServer).DeleteHost(ctx, req.(*DeleteHostRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
var _HostService_serviceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "controller.api.services.v1.HostService",
|
||||
HandlerType: (*HostServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "GetHost",
|
||||
Handler: _HostService_GetHost_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListHosts",
|
||||
Handler: _HostService_ListHosts_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "CreateHost",
|
||||
Handler: _HostService_CreateHost_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdateHost",
|
||||
Handler: _HostService_UpdateHost_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DeleteHost",
|
||||
Handler: _HostService_DeleteHost_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "controller/api/services/v1/host_service.proto",
|
||||
}
|
||||
Reference in new issue
Block a user