v1

package
v0.0.0-...-9f61de0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 22, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package v1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Package v1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	ConsumerService_Read_FullMethodName   = "/v1.ConsumerService/Read"
	ConsumerService_Create_FullMethodName = "/v1.ConsumerService/Create"
	ConsumerService_Update_FullMethodName = "/v1.ConsumerService/Update"
)
View Source
const (
	ResourceService_Read_FullMethodName   = "/v1.ResourceService/Read"
	ResourceService_Create_FullMethodName = "/v1.ResourceService/Create"
	ResourceService_Update_FullMethodName = "/v1.ResourceService/Update"
)

Variables

View Source
var ConsumerService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "v1.ConsumerService",
	HandlerType: (*ConsumerServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Read",
			Handler:    _ConsumerService_Read_Handler,
		},
		{
			MethodName: "Create",
			Handler:    _ConsumerService_Create_Handler,
		},
		{
			MethodName: "Update",
			Handler:    _ConsumerService_Update_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "api/v1/consumer.proto",
}

ConsumerService_ServiceDesc is the grpc.ServiceDesc for ConsumerService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var File_api_v1_consumer_proto protoreflect.FileDescriptor
View Source
var File_api_v1_resource_proto protoreflect.FileDescriptor
View Source
var ResourceService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "v1.ResourceService",
	HandlerType: (*ResourceServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Read",
			Handler:    _ResourceService_Read_Handler,
		},
		{
			MethodName: "Create",
			Handler:    _ResourceService_Create_Handler,
		},
		{
			MethodName: "Update",
			Handler:    _ResourceService_Update_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "api/v1/resource.proto",
}

ResourceService_ServiceDesc is the grpc.ServiceDesc for ResourceService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterConsumerServiceHandler

func RegisterConsumerServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterConsumerServiceHandler registers the http handlers for service ConsumerService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterConsumerServiceHandlerClient

func RegisterConsumerServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ConsumerServiceClient) error

RegisterConsumerServiceHandlerClient registers the http handlers for service ConsumerService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ConsumerServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ConsumerServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ConsumerServiceClient" to call the correct interceptors.

func RegisterConsumerServiceHandlerFromEndpoint

func RegisterConsumerServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterConsumerServiceHandlerFromEndpoint is same as RegisterConsumerServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterConsumerServiceHandlerServer

func RegisterConsumerServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ConsumerServiceServer) error

RegisterConsumerServiceHandlerServer registers the http handlers for service ConsumerService to "mux". UnaryRPC :call ConsumerServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterConsumerServiceHandlerFromEndpoint instead.

func RegisterConsumerServiceServer

func RegisterConsumerServiceServer(s grpc.ServiceRegistrar, srv ConsumerServiceServer)

func RegisterResourceServiceHandler

func RegisterResourceServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterResourceServiceHandler registers the http handlers for service ResourceService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterResourceServiceHandlerClient

func RegisterResourceServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ResourceServiceClient) error

RegisterResourceServiceHandlerClient registers the http handlers for service ResourceService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ResourceServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ResourceServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ResourceServiceClient" to call the correct interceptors.

func RegisterResourceServiceHandlerFromEndpoint

func RegisterResourceServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterResourceServiceHandlerFromEndpoint is same as RegisterResourceServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterResourceServiceHandlerServer

func RegisterResourceServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ResourceServiceServer) error

RegisterResourceServiceHandlerServer registers the http handlers for service ResourceService to "mux". UnaryRPC :call ResourceServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterResourceServiceHandlerFromEndpoint instead.

func RegisterResourceServiceServer

func RegisterResourceServiceServer(s grpc.ServiceRegistrar, srv ResourceServiceServer)

Types

type Consumer

type Consumer struct {
	Id     string           `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Labels []*ConsumerLabel `protobuf:"bytes,3,rep,name=labels,proto3" json:"labels,omitempty"`
	// contains filtered or unexported fields
}

func (*Consumer) Descriptor deprecated

func (*Consumer) Descriptor() ([]byte, []int)

Deprecated: Use Consumer.ProtoReflect.Descriptor instead.

func (*Consumer) GetId

func (x *Consumer) GetId() string

func (*Consumer) GetLabels

func (x *Consumer) GetLabels() []*ConsumerLabel

func (*Consumer) ProtoMessage

func (*Consumer) ProtoMessage()

func (*Consumer) ProtoReflect

func (x *Consumer) ProtoReflect() protoreflect.Message

func (*Consumer) Reset

func (x *Consumer) Reset()

func (*Consumer) String

func (x *Consumer) String() string

type ConsumerCreateRequest

type ConsumerCreateRequest struct {
	Id     string           `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Labels []*ConsumerLabel `protobuf:"bytes,2,rep,name=labels,proto3" json:"labels,omitempty"`
	// contains filtered or unexported fields
}

func (*ConsumerCreateRequest) Descriptor deprecated

func (*ConsumerCreateRequest) Descriptor() ([]byte, []int)

Deprecated: Use ConsumerCreateRequest.ProtoReflect.Descriptor instead.

func (*ConsumerCreateRequest) GetId

func (x *ConsumerCreateRequest) GetId() string

func (*ConsumerCreateRequest) GetLabels

func (x *ConsumerCreateRequest) GetLabels() []*ConsumerLabel

func (*ConsumerCreateRequest) ProtoMessage

func (*ConsumerCreateRequest) ProtoMessage()

func (*ConsumerCreateRequest) ProtoReflect

func (x *ConsumerCreateRequest) ProtoReflect() protoreflect.Message

func (*ConsumerCreateRequest) Reset

func (x *ConsumerCreateRequest) Reset()

func (*ConsumerCreateRequest) String

func (x *ConsumerCreateRequest) String() string

type ConsumerLabel

type ConsumerLabel struct {
	Key   string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*ConsumerLabel) Descriptor deprecated

func (*ConsumerLabel) Descriptor() ([]byte, []int)

Deprecated: Use ConsumerLabel.ProtoReflect.Descriptor instead.

func (*ConsumerLabel) GetKey

func (x *ConsumerLabel) GetKey() string

func (*ConsumerLabel) GetValue

func (x *ConsumerLabel) GetValue() string

func (*ConsumerLabel) ProtoMessage

func (*ConsumerLabel) ProtoMessage()

func (*ConsumerLabel) ProtoReflect

func (x *ConsumerLabel) ProtoReflect() protoreflect.Message

func (*ConsumerLabel) Reset

func (x *ConsumerLabel) Reset()

func (*ConsumerLabel) String

func (x *ConsumerLabel) String() string

type ConsumerReadRequest

type ConsumerReadRequest struct {
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*ConsumerReadRequest) Descriptor deprecated

func (*ConsumerReadRequest) Descriptor() ([]byte, []int)

Deprecated: Use ConsumerReadRequest.ProtoReflect.Descriptor instead.

func (*ConsumerReadRequest) GetId

func (x *ConsumerReadRequest) GetId() string

func (*ConsumerReadRequest) ProtoMessage

func (*ConsumerReadRequest) ProtoMessage()

func (*ConsumerReadRequest) ProtoReflect

func (x *ConsumerReadRequest) ProtoReflect() protoreflect.Message

func (*ConsumerReadRequest) Reset

func (x *ConsumerReadRequest) Reset()

func (*ConsumerReadRequest) String

func (x *ConsumerReadRequest) String() string

type ConsumerServiceClient

type ConsumerServiceClient interface {
	Read(ctx context.Context, in *ConsumerReadRequest, opts ...grpc.CallOption) (*Consumer, error)
	Create(ctx context.Context, in *ConsumerCreateRequest, opts ...grpc.CallOption) (*Consumer, error)
	Update(ctx context.Context, in *ConsumerUpdateRequest, opts ...grpc.CallOption) (*Consumer, error)
}

ConsumerServiceClient is the client API for ConsumerService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type ConsumerServiceServer

type ConsumerServiceServer interface {
	Read(context.Context, *ConsumerReadRequest) (*Consumer, error)
	Create(context.Context, *ConsumerCreateRequest) (*Consumer, error)
	Update(context.Context, *ConsumerUpdateRequest) (*Consumer, error)
	// contains filtered or unexported methods
}

ConsumerServiceServer is the server API for ConsumerService service. All implementations must embed UnimplementedConsumerServiceServer for forward compatibility

type ConsumerUpdateRequest

type ConsumerUpdateRequest struct {
	Id     string           `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Labels []*ConsumerLabel `protobuf:"bytes,2,rep,name=labels,proto3" json:"labels,omitempty"`
	// contains filtered or unexported fields
}

func (*ConsumerUpdateRequest) Descriptor deprecated

func (*ConsumerUpdateRequest) Descriptor() ([]byte, []int)

Deprecated: Use ConsumerUpdateRequest.ProtoReflect.Descriptor instead.

func (*ConsumerUpdateRequest) GetId

func (x *ConsumerUpdateRequest) GetId() string

func (*ConsumerUpdateRequest) GetLabels

func (x *ConsumerUpdateRequest) GetLabels() []*ConsumerLabel

func (*ConsumerUpdateRequest) ProtoMessage

func (*ConsumerUpdateRequest) ProtoMessage()

func (*ConsumerUpdateRequest) ProtoReflect

func (x *ConsumerUpdateRequest) ProtoReflect() protoreflect.Message

func (*ConsumerUpdateRequest) Reset

func (x *ConsumerUpdateRequest) Reset()

func (*ConsumerUpdateRequest) String

func (x *ConsumerUpdateRequest) String() string

type Resource

type Resource struct {
	Id           string           `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	ConsumerId   string           `protobuf:"bytes,2,opt,name=consumerId,proto3" json:"consumerId,omitempty"`
	GenerationId int64            `protobuf:"varint,3,opt,name=generationId,proto3" json:"generationId,omitempty"`
	Object       *structpb.Struct `protobuf:"bytes,4,opt,name=object,proto3" json:"object,omitempty"`
	Status       *structpb.Struct `protobuf:"bytes,5,opt,name=status,proto3" json:"status,omitempty"`
	// contains filtered or unexported fields
}

func (*Resource) Descriptor deprecated

func (*Resource) Descriptor() ([]byte, []int)

Deprecated: Use Resource.ProtoReflect.Descriptor instead.

func (*Resource) GetConsumerId

func (x *Resource) GetConsumerId() string

func (*Resource) GetGenerationId

func (x *Resource) GetGenerationId() int64

func (*Resource) GetId

func (x *Resource) GetId() string

func (*Resource) GetObject

func (x *Resource) GetObject() *structpb.Struct

func (*Resource) GetStatus

func (x *Resource) GetStatus() *structpb.Struct

func (*Resource) ProtoMessage

func (*Resource) ProtoMessage()

func (*Resource) ProtoReflect

func (x *Resource) ProtoReflect() protoreflect.Message

func (*Resource) Reset

func (x *Resource) Reset()

func (*Resource) String

func (x *Resource) String() string

type ResourceCreateRequest

type ResourceCreateRequest struct {
	ConsumerId string           `protobuf:"bytes,1,opt,name=consumerId,proto3" json:"consumerId,omitempty"`
	Object     *structpb.Struct `protobuf:"bytes,2,opt,name=object,proto3" json:"object,omitempty"`
	// contains filtered or unexported fields
}

func (*ResourceCreateRequest) Descriptor deprecated

func (*ResourceCreateRequest) Descriptor() ([]byte, []int)

Deprecated: Use ResourceCreateRequest.ProtoReflect.Descriptor instead.

func (*ResourceCreateRequest) GetConsumerId

func (x *ResourceCreateRequest) GetConsumerId() string

func (*ResourceCreateRequest) GetObject

func (x *ResourceCreateRequest) GetObject() *structpb.Struct

func (*ResourceCreateRequest) ProtoMessage

func (*ResourceCreateRequest) ProtoMessage()

func (*ResourceCreateRequest) ProtoReflect

func (x *ResourceCreateRequest) ProtoReflect() protoreflect.Message

func (*ResourceCreateRequest) Reset

func (x *ResourceCreateRequest) Reset()

func (*ResourceCreateRequest) String

func (x *ResourceCreateRequest) String() string

type ResourceReadRequest

type ResourceReadRequest struct {
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*ResourceReadRequest) Descriptor deprecated

func (*ResourceReadRequest) Descriptor() ([]byte, []int)

Deprecated: Use ResourceReadRequest.ProtoReflect.Descriptor instead.

func (*ResourceReadRequest) GetId

func (x *ResourceReadRequest) GetId() string

func (*ResourceReadRequest) ProtoMessage

func (*ResourceReadRequest) ProtoMessage()

func (*ResourceReadRequest) ProtoReflect

func (x *ResourceReadRequest) ProtoReflect() protoreflect.Message

func (*ResourceReadRequest) Reset

func (x *ResourceReadRequest) Reset()

func (*ResourceReadRequest) String

func (x *ResourceReadRequest) String() string

type ResourceServiceClient

type ResourceServiceClient interface {
	Read(ctx context.Context, in *ResourceReadRequest, opts ...grpc.CallOption) (*Resource, error)
	Create(ctx context.Context, in *ResourceCreateRequest, opts ...grpc.CallOption) (*Resource, error)
	Update(ctx context.Context, in *ResourceUpdateRequest, opts ...grpc.CallOption) (*Resource, error)
}

ResourceServiceClient is the client API for ResourceService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type ResourceServiceServer

type ResourceServiceServer interface {
	Read(context.Context, *ResourceReadRequest) (*Resource, error)
	Create(context.Context, *ResourceCreateRequest) (*Resource, error)
	Update(context.Context, *ResourceUpdateRequest) (*Resource, error)
	// contains filtered or unexported methods
}

ResourceServiceServer is the server API for ResourceService service. All implementations must embed UnimplementedResourceServiceServer for forward compatibility

type ResourceUpdateRequest

type ResourceUpdateRequest struct {
	Id     string           `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Object *structpb.Struct `protobuf:"bytes,2,opt,name=object,proto3" json:"object,omitempty"`
	// contains filtered or unexported fields
}

func (*ResourceUpdateRequest) Descriptor deprecated

func (*ResourceUpdateRequest) Descriptor() ([]byte, []int)

Deprecated: Use ResourceUpdateRequest.ProtoReflect.Descriptor instead.

func (*ResourceUpdateRequest) GetId

func (x *ResourceUpdateRequest) GetId() string

func (*ResourceUpdateRequest) GetObject

func (x *ResourceUpdateRequest) GetObject() *structpb.Struct

func (*ResourceUpdateRequest) ProtoMessage

func (*ResourceUpdateRequest) ProtoMessage()

func (*ResourceUpdateRequest) ProtoReflect

func (x *ResourceUpdateRequest) ProtoReflect() protoreflect.Message

func (*ResourceUpdateRequest) Reset

func (x *ResourceUpdateRequest) Reset()

func (*ResourceUpdateRequest) String

func (x *ResourceUpdateRequest) String() string

type UnimplementedConsumerServiceServer

type UnimplementedConsumerServiceServer struct {
}

UnimplementedConsumerServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedConsumerServiceServer) Create

func (UnimplementedConsumerServiceServer) Read

func (UnimplementedConsumerServiceServer) Update

type UnimplementedResourceServiceServer

type UnimplementedResourceServiceServer struct {
}

UnimplementedResourceServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedResourceServiceServer) Create

func (UnimplementedResourceServiceServer) Read

func (UnimplementedResourceServiceServer) Update

type UnsafeConsumerServiceServer

type UnsafeConsumerServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeConsumerServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ConsumerServiceServer will result in compilation errors.

type UnsafeResourceServiceServer

type UnsafeResourceServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeResourceServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ResourceServiceServer will result in compilation errors.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL