v1

package
v0.1.323 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Overview

Package v1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_service_generic_v1_generic_proto protoreflect.FileDescriptor
View Source
var GenericService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "viam.service.generic.v1.GenericService",
	HandlerType: (*GenericServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "DoCommand",
			Handler:    _GenericService_DoCommand_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "service/generic/v1/generic.proto",
}

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

Functions

func RegisterGenericServiceHandler

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

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

func RegisterGenericServiceHandlerClient

func RegisterGenericServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client GenericServiceClient) error

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

func RegisterGenericServiceHandlerFromEndpoint

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

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

func RegisterGenericServiceHandlerServer

func RegisterGenericServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server GenericServiceServer) error

RegisterGenericServiceHandlerServer registers the http handlers for service GenericService to "mux". UnaryRPC :call GenericServiceServer 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 RegisterGenericServiceHandlerFromEndpoint instead.

func RegisterGenericServiceServer

func RegisterGenericServiceServer(s grpc.ServiceRegistrar, srv GenericServiceServer)

Types

type GenericServiceClient

type GenericServiceClient interface {
	// DoCommand sends/receives arbitrary commands
	DoCommand(ctx context.Context, in *v1.DoCommandRequest, opts ...grpc.CallOption) (*v1.DoCommandResponse, error)
}

GenericServiceClient is the client API for GenericService 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 GenericServiceServer

type GenericServiceServer interface {
	// DoCommand sends/receives arbitrary commands
	DoCommand(context.Context, *v1.DoCommandRequest) (*v1.DoCommandResponse, error)
	// contains filtered or unexported methods
}

GenericServiceServer is the server API for GenericService service. All implementations must embed UnimplementedGenericServiceServer for forward compatibility

type UnimplementedGenericServiceServer

type UnimplementedGenericServiceServer struct {
}

UnimplementedGenericServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedGenericServiceServer) DoCommand

type UnsafeGenericServiceServer

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

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

Jump to

Keyboard shortcuts

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