v1

package
v0.1.391 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2025 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 ButtonService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "viam.component.button.v1.ButtonService",
	HandlerType: (*ButtonServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Push",
			Handler:    _ButtonService_Push_Handler,
		},
		{
			MethodName: "DoCommand",
			Handler:    _ButtonService_DoCommand_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "component/button/v1/button.proto",
}

ButtonService_ServiceDesc is the grpc.ServiceDesc for ButtonService 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_component_button_v1_button_proto protoreflect.FileDescriptor

Functions

func RegisterButtonServiceHandler

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

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

func RegisterButtonServiceHandlerClient

func RegisterButtonServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ButtonServiceClient) error

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

func RegisterButtonServiceHandlerFromEndpoint

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

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

func RegisterButtonServiceHandlerServer

func RegisterButtonServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ButtonServiceServer) error

RegisterButtonServiceHandlerServer registers the http handlers for service ButtonService to "mux". UnaryRPC :call ButtonServiceServer 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 RegisterButtonServiceHandlerFromEndpoint instead.

func RegisterButtonServiceServer

func RegisterButtonServiceServer(s grpc.ServiceRegistrar, srv ButtonServiceServer)

Types

type ButtonServiceClient

type ButtonServiceClient interface {
	// Pushes a button
	Push(ctx context.Context, in *PushRequest, opts ...grpc.CallOption) (*PushResponse, error)
	// DoCommand sends/receives arbitrary commands
	DoCommand(ctx context.Context, in *v1.DoCommandRequest, opts ...grpc.CallOption) (*v1.DoCommandResponse, error)
}

ButtonServiceClient is the client API for ButtonService 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 ButtonServiceServer

type ButtonServiceServer interface {
	// Pushes a button
	Push(context.Context, *PushRequest) (*PushResponse, error)
	// DoCommand sends/receives arbitrary commands
	DoCommand(context.Context, *v1.DoCommandRequest) (*v1.DoCommandResponse, error)
	// contains filtered or unexported methods
}

ButtonServiceServer is the server API for ButtonService service. All implementations must embed UnimplementedButtonServiceServer for forward compatibility

type PushRequest

type PushRequest struct {
	Name  string           `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Extra *structpb.Struct `protobuf:"bytes,99,opt,name=extra,proto3" json:"extra,omitempty"`
	// contains filtered or unexported fields
}

func (*PushRequest) Descriptor deprecated

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

Deprecated: Use PushRequest.ProtoReflect.Descriptor instead.

func (*PushRequest) GetExtra

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

func (*PushRequest) GetName

func (x *PushRequest) GetName() string

func (*PushRequest) ProtoMessage

func (*PushRequest) ProtoMessage()

func (*PushRequest) ProtoReflect

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

func (*PushRequest) Reset

func (x *PushRequest) Reset()

func (*PushRequest) String

func (x *PushRequest) String() string

type PushResponse

type PushResponse struct {
	// contains filtered or unexported fields
}

func (*PushResponse) Descriptor deprecated

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

Deprecated: Use PushResponse.ProtoReflect.Descriptor instead.

func (*PushResponse) ProtoMessage

func (*PushResponse) ProtoMessage()

func (*PushResponse) ProtoReflect

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

func (*PushResponse) Reset

func (x *PushResponse) Reset()

func (*PushResponse) String

func (x *PushResponse) String() string

type UnimplementedButtonServiceServer

type UnimplementedButtonServiceServer struct {
}

UnimplementedButtonServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedButtonServiceServer) DoCommand

func (UnimplementedButtonServiceServer) Push

type UnsafeButtonServiceServer

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

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

Jump to

Keyboard shortcuts

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