v1

package
v0.1.383 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2025 License: Apache-2.0 Imports: 19 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 DiscoveryService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "viam.service.discovery.v1.DiscoveryService",
	HandlerType: (*DiscoveryServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "DiscoverResources",
			Handler:    _DiscoveryService_DiscoverResources_Handler,
		},
		{
			MethodName: "DoCommand",
			Handler:    _DiscoveryService_DoCommand_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "service/discovery/v1/discovery.proto",
}

DiscoveryService_ServiceDesc is the grpc.ServiceDesc for DiscoveryService 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_service_discovery_v1_discovery_proto protoreflect.FileDescriptor

Functions

func RegisterDiscoveryServiceHandler

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

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

func RegisterDiscoveryServiceHandlerClient

func RegisterDiscoveryServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client DiscoveryServiceClient) error

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

func RegisterDiscoveryServiceHandlerFromEndpoint

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

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

func RegisterDiscoveryServiceHandlerServer

func RegisterDiscoveryServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server DiscoveryServiceServer) error

RegisterDiscoveryServiceHandlerServer registers the http handlers for service DiscoveryService to "mux". UnaryRPC :call DiscoveryServiceServer 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 RegisterDiscoveryServiceHandlerFromEndpoint instead.

func RegisterDiscoveryServiceServer

func RegisterDiscoveryServiceServer(s grpc.ServiceRegistrar, srv DiscoveryServiceServer)

Types

type DiscoverResourcesRequest

type DiscoverResourcesRequest struct {

	// name of the discover service
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,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 (*DiscoverResourcesRequest) Descriptor deprecated

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

Deprecated: Use DiscoverResourcesRequest.ProtoReflect.Descriptor instead.

func (*DiscoverResourcesRequest) GetExtra

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

func (*DiscoverResourcesRequest) GetName

func (x *DiscoverResourcesRequest) GetName() string

func (*DiscoverResourcesRequest) ProtoMessage

func (*DiscoverResourcesRequest) ProtoMessage()

func (*DiscoverResourcesRequest) ProtoReflect

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

func (*DiscoverResourcesRequest) Reset

func (x *DiscoverResourcesRequest) Reset()

func (*DiscoverResourcesRequest) String

func (x *DiscoverResourcesRequest) String() string

type DiscoverResourcesResponse

type DiscoverResourcesResponse struct {

	// list of ComponentConfigs that describe the components found by a discover service.
	Discoveries []*v1.ComponentConfig `protobuf:"bytes,1,rep,name=discoveries,proto3" json:"discoveries,omitempty"`
	// contains filtered or unexported fields
}

func (*DiscoverResourcesResponse) Descriptor deprecated

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

Deprecated: Use DiscoverResourcesResponse.ProtoReflect.Descriptor instead.

func (*DiscoverResourcesResponse) GetDiscoveries

func (x *DiscoverResourcesResponse) GetDiscoveries() []*v1.ComponentConfig

func (*DiscoverResourcesResponse) ProtoMessage

func (*DiscoverResourcesResponse) ProtoMessage()

func (*DiscoverResourcesResponse) ProtoReflect

func (*DiscoverResourcesResponse) Reset

func (x *DiscoverResourcesResponse) Reset()

func (*DiscoverResourcesResponse) String

func (x *DiscoverResourcesResponse) String() string

type DiscoveryServiceClient

type DiscoveryServiceClient interface {
	// DiscoverResources returns the list of all discovered viam resources connected to the viam-server machine.
	DiscoverResources(ctx context.Context, in *DiscoverResourcesRequest, opts ...grpc.CallOption) (*DiscoverResourcesResponse, error)
	// DoCommand sends/receives arbitrary commands
	DoCommand(ctx context.Context, in *v1.DoCommandRequest, opts ...grpc.CallOption) (*v1.DoCommandResponse, error)
}

DiscoveryServiceClient is the client API for DiscoveryService 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 DiscoveryServiceServer

type DiscoveryServiceServer interface {
	// DiscoverResources returns the list of all discovered viam resources connected to the viam-server machine.
	DiscoverResources(context.Context, *DiscoverResourcesRequest) (*DiscoverResourcesResponse, error)
	// DoCommand sends/receives arbitrary commands
	DoCommand(context.Context, *v1.DoCommandRequest) (*v1.DoCommandResponse, error)
	// contains filtered or unexported methods
}

DiscoveryServiceServer is the server API for DiscoveryService service. All implementations must embed UnimplementedDiscoveryServiceServer for forward compatibility

type UnimplementedDiscoveryServiceServer

type UnimplementedDiscoveryServiceServer struct {
}

UnimplementedDiscoveryServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedDiscoveryServiceServer) DiscoverResources

func (UnimplementedDiscoveryServiceServer) DoCommand

type UnsafeDiscoveryServiceServer

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

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

Jump to

Keyboard shortcuts

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