v1

package
v0.1.89 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: Apache-2.0 Imports: 18 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_shell_v1_shell_proto protoreflect.FileDescriptor
View Source
var ShellService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "viam.service.shell.v1.ShellService",
	HandlerType: (*ShellServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "DoCommand",
			Handler:    _ShellService_DoCommand_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Shell",
			Handler:       _ShellService_Shell_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "service/shell/v1/shell.proto",
}

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

Functions

func RegisterShellServiceHandler

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

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

func RegisterShellServiceHandlerClient

func RegisterShellServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ShellServiceClient) error

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

func RegisterShellServiceHandlerFromEndpoint

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

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

func RegisterShellServiceHandlerServer

func RegisterShellServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ShellServiceServer) error

RegisterShellServiceHandlerServer registers the http handlers for service ShellService to "mux". UnaryRPC :call ShellServiceServer 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 RegisterShellServiceHandlerFromEndpoint instead.

func RegisterShellServiceServer

func RegisterShellServiceServer(s grpc.ServiceRegistrar, srv ShellServiceServer)

Types

type ShellRequest

type ShellRequest struct {
	Name   string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	DataIn string `protobuf:"bytes,2,opt,name=data_in,json=dataIn,proto3" json:"data_in,omitempty"`
	// Additional arguments to the method
	Extra *structpb.Struct `protobuf:"bytes,99,opt,name=extra,proto3" json:"extra,omitempty"`
	// contains filtered or unexported fields
}

func (*ShellRequest) Descriptor deprecated

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

Deprecated: Use ShellRequest.ProtoReflect.Descriptor instead.

func (*ShellRequest) GetDataIn

func (x *ShellRequest) GetDataIn() string

func (*ShellRequest) GetExtra added in v0.1.6

func (x *ShellRequest) GetExtra() *structpb.Struct

func (*ShellRequest) GetName

func (x *ShellRequest) GetName() string

func (*ShellRequest) ProtoMessage

func (*ShellRequest) ProtoMessage()

func (*ShellRequest) ProtoReflect

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

func (*ShellRequest) Reset

func (x *ShellRequest) Reset()

func (*ShellRequest) String

func (x *ShellRequest) String() string

type ShellResponse

type ShellResponse struct {
	DataOut string `protobuf:"bytes,1,opt,name=data_out,json=dataOut,proto3" json:"data_out,omitempty"`
	DataErr string `protobuf:"bytes,2,opt,name=data_err,json=dataErr,proto3" json:"data_err,omitempty"`
	Eof     bool   `protobuf:"varint,3,opt,name=eof,proto3" json:"eof,omitempty"`
	// contains filtered or unexported fields
}

func (*ShellResponse) Descriptor deprecated

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

Deprecated: Use ShellResponse.ProtoReflect.Descriptor instead.

func (*ShellResponse) GetDataErr

func (x *ShellResponse) GetDataErr() string

func (*ShellResponse) GetDataOut

func (x *ShellResponse) GetDataOut() string

func (*ShellResponse) GetEof

func (x *ShellResponse) GetEof() bool

func (*ShellResponse) ProtoMessage

func (*ShellResponse) ProtoMessage()

func (*ShellResponse) ProtoReflect

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

func (*ShellResponse) Reset

func (x *ShellResponse) Reset()

func (*ShellResponse) String

func (x *ShellResponse) String() string

type ShellServiceClient

type ShellServiceClient interface {
	// Shell starts a shell with an input and output pipe.
	Shell(ctx context.Context, opts ...grpc.CallOption) (ShellService_ShellClient, error)
	// DoCommand sends/receives arbitrary commands
	DoCommand(ctx context.Context, in *v1.DoCommandRequest, opts ...grpc.CallOption) (*v1.DoCommandResponse, error)
}

ShellServiceClient is the client API for ShellService 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 ShellServiceServer

type ShellServiceServer interface {
	// Shell starts a shell with an input and output pipe.
	Shell(ShellService_ShellServer) error
	// DoCommand sends/receives arbitrary commands
	DoCommand(context.Context, *v1.DoCommandRequest) (*v1.DoCommandResponse, error)
	// contains filtered or unexported methods
}

ShellServiceServer is the server API for ShellService service. All implementations must embed UnimplementedShellServiceServer for forward compatibility

type ShellService_ShellClient

type ShellService_ShellClient interface {
	Send(*ShellRequest) error
	Recv() (*ShellResponse, error)
	grpc.ClientStream
}

type ShellService_ShellServer

type ShellService_ShellServer interface {
	Send(*ShellResponse) error
	Recv() (*ShellRequest, error)
	grpc.ServerStream
}

type UnimplementedShellServiceServer

type UnimplementedShellServiceServer struct {
}

UnimplementedShellServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedShellServiceServer) DoCommand added in v0.1.80

func (UnimplementedShellServiceServer) Shell

type UnsafeShellServiceServer

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

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

Jump to

Keyboard shortcuts

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