v1

package
v0.1.345 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: Apache-2.0 Imports: 17 Imported by: 3

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_module_v1_module_proto protoreflect.FileDescriptor
View Source
var ModuleService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "viam.module.v1.ModuleService",
	HandlerType: (*ModuleServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "AddResource",
			Handler:    _ModuleService_AddResource_Handler,
		},
		{
			MethodName: "ReconfigureResource",
			Handler:    _ModuleService_ReconfigureResource_Handler,
		},
		{
			MethodName: "RemoveResource",
			Handler:    _ModuleService_RemoveResource_Handler,
		},
		{
			MethodName: "Ready",
			Handler:    _ModuleService_Ready_Handler,
		},
		{
			MethodName: "ValidateConfig",
			Handler:    _ModuleService_ValidateConfig_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "module/v1/module.proto",
}

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

Functions

func RegisterModuleServiceHandler

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

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

func RegisterModuleServiceHandlerClient

func RegisterModuleServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ModuleServiceClient) error

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

func RegisterModuleServiceHandlerFromEndpoint

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

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

func RegisterModuleServiceHandlerServer

func RegisterModuleServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ModuleServiceServer) error

RegisterModuleServiceHandlerServer registers the http handlers for service ModuleService to "mux". UnaryRPC :call ModuleServiceServer 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 RegisterModuleServiceHandlerFromEndpoint instead.

func RegisterModuleServiceServer

func RegisterModuleServiceServer(s grpc.ServiceRegistrar, srv ModuleServiceServer)

Types

type AddResourceRequest

type AddResourceRequest struct {
	Config       *v1.ComponentConfig `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"`
	Dependencies []string            `protobuf:"bytes,2,rep,name=dependencies,proto3" json:"dependencies,omitempty"`
	// contains filtered or unexported fields
}

func (*AddResourceRequest) Descriptor deprecated

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

Deprecated: Use AddResourceRequest.ProtoReflect.Descriptor instead.

func (*AddResourceRequest) GetConfig

func (x *AddResourceRequest) GetConfig() *v1.ComponentConfig

func (*AddResourceRequest) GetDependencies

func (x *AddResourceRequest) GetDependencies() []string

func (*AddResourceRequest) ProtoMessage

func (*AddResourceRequest) ProtoMessage()

func (*AddResourceRequest) ProtoReflect

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

func (*AddResourceRequest) Reset

func (x *AddResourceRequest) Reset()

func (*AddResourceRequest) String

func (x *AddResourceRequest) String() string

type AddResourceResponse

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

func (*AddResourceResponse) Descriptor deprecated

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

Deprecated: Use AddResourceResponse.ProtoReflect.Descriptor instead.

func (*AddResourceResponse) ProtoMessage

func (*AddResourceResponse) ProtoMessage()

func (*AddResourceResponse) ProtoReflect

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

func (*AddResourceResponse) Reset

func (x *AddResourceResponse) Reset()

func (*AddResourceResponse) String

func (x *AddResourceResponse) String() string

type HandlerDefinition

type HandlerDefinition struct {
	Subtype *v11.ResourceRPCSubtype `protobuf:"bytes,1,opt,name=subtype,proto3" json:"subtype,omitempty"`
	Models  []string                `protobuf:"bytes,2,rep,name=models,proto3" json:"models,omitempty"`
	// contains filtered or unexported fields
}

func (*HandlerDefinition) Descriptor deprecated

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

Deprecated: Use HandlerDefinition.ProtoReflect.Descriptor instead.

func (*HandlerDefinition) GetModels

func (x *HandlerDefinition) GetModels() []string

func (*HandlerDefinition) GetSubtype

func (x *HandlerDefinition) GetSubtype() *v11.ResourceRPCSubtype

func (*HandlerDefinition) ProtoMessage

func (*HandlerDefinition) ProtoMessage()

func (*HandlerDefinition) ProtoReflect

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

func (*HandlerDefinition) Reset

func (x *HandlerDefinition) Reset()

func (*HandlerDefinition) String

func (x *HandlerDefinition) String() string

type HandlerMap

type HandlerMap struct {
	Handlers []*HandlerDefinition `protobuf:"bytes,1,rep,name=handlers,proto3" json:"handlers,omitempty"`
	// contains filtered or unexported fields
}

func (*HandlerMap) Descriptor deprecated

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

Deprecated: Use HandlerMap.ProtoReflect.Descriptor instead.

func (*HandlerMap) GetHandlers

func (x *HandlerMap) GetHandlers() []*HandlerDefinition

func (*HandlerMap) ProtoMessage

func (*HandlerMap) ProtoMessage()

func (*HandlerMap) ProtoReflect

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

func (*HandlerMap) Reset

func (x *HandlerMap) Reset()

func (*HandlerMap) String

func (x *HandlerMap) String() string

type ModuleServiceClient

type ModuleServiceClient interface {
	// AddResource tells a module about a new resource to handle
	AddResource(ctx context.Context, in *AddResourceRequest, opts ...grpc.CallOption) (*AddResourceResponse, error)
	// ReconfigureResource tells a module to reconfigure an existing resource
	ReconfigureResource(ctx context.Context, in *ReconfigureResourceRequest, opts ...grpc.CallOption) (*ReconfigureResourceResponse, error)
	// RemoveResource tells a module to close/stop a component/service and remove it
	RemoveResource(ctx context.Context, in *RemoveResourceRequest, opts ...grpc.CallOption) (*RemoveResourceResponse, error)
	// Ready determines if the server is started and ready to recieve resource configurations.
	Ready(ctx context.Context, in *ReadyRequest, opts ...grpc.CallOption) (*ReadyResponse, error)
	// ValidateConfig determines whether the given config is valid and registers/returns implicit
	// dependencies.
	ValidateConfig(ctx context.Context, in *ValidateConfigRequest, opts ...grpc.CallOption) (*ValidateConfigResponse, error)
}

ModuleServiceClient is the client API for ModuleService 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 ModuleServiceServer

type ModuleServiceServer interface {
	// AddResource tells a module about a new resource to handle
	AddResource(context.Context, *AddResourceRequest) (*AddResourceResponse, error)
	// ReconfigureResource tells a module to reconfigure an existing resource
	ReconfigureResource(context.Context, *ReconfigureResourceRequest) (*ReconfigureResourceResponse, error)
	// RemoveResource tells a module to close/stop a component/service and remove it
	RemoveResource(context.Context, *RemoveResourceRequest) (*RemoveResourceResponse, error)
	// Ready determines if the server is started and ready to recieve resource configurations.
	Ready(context.Context, *ReadyRequest) (*ReadyResponse, error)
	// ValidateConfig determines whether the given config is valid and registers/returns implicit
	// dependencies.
	ValidateConfig(context.Context, *ValidateConfigRequest) (*ValidateConfigResponse, error)
	// contains filtered or unexported methods
}

ModuleServiceServer is the server API for ModuleService service. All implementations must embed UnimplementedModuleServiceServer for forward compatibility

type ReadyRequest

type ReadyRequest struct {
	ParentAddress string `protobuf:"bytes,1,opt,name=parent_address,json=parentAddress,proto3" json:"parent_address,omitempty"`
	WebrtcOffer   string `protobuf:"bytes,2,opt,name=webrtc_offer,json=webrtcOffer,proto3" json:"webrtc_offer,omitempty"`
	// contains filtered or unexported fields
}

func (*ReadyRequest) Descriptor deprecated

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

Deprecated: Use ReadyRequest.ProtoReflect.Descriptor instead.

func (*ReadyRequest) GetParentAddress

func (x *ReadyRequest) GetParentAddress() string

func (*ReadyRequest) GetWebrtcOffer added in v0.1.277

func (x *ReadyRequest) GetWebrtcOffer() string

func (*ReadyRequest) ProtoMessage

func (*ReadyRequest) ProtoMessage()

func (*ReadyRequest) ProtoReflect

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

func (*ReadyRequest) Reset

func (x *ReadyRequest) Reset()

func (*ReadyRequest) String

func (x *ReadyRequest) String() string

type ReadyResponse

type ReadyResponse struct {
	Ready        bool        `protobuf:"varint,1,opt,name=ready,proto3" json:"ready,omitempty"`
	Handlermap   *HandlerMap `protobuf:"bytes,2,opt,name=handlermap,proto3" json:"handlermap,omitempty"`
	WebrtcAnswer string      `protobuf:"bytes,3,opt,name=webrtc_answer,json=webrtcAnswer,proto3" json:"webrtc_answer,omitempty"`
	// contains filtered or unexported fields
}

func (*ReadyResponse) Descriptor deprecated

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

Deprecated: Use ReadyResponse.ProtoReflect.Descriptor instead.

func (*ReadyResponse) GetHandlermap

func (x *ReadyResponse) GetHandlermap() *HandlerMap

func (*ReadyResponse) GetReady

func (x *ReadyResponse) GetReady() bool

func (*ReadyResponse) GetWebrtcAnswer added in v0.1.277

func (x *ReadyResponse) GetWebrtcAnswer() string

func (*ReadyResponse) ProtoMessage

func (*ReadyResponse) ProtoMessage()

func (*ReadyResponse) ProtoReflect

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

func (*ReadyResponse) Reset

func (x *ReadyResponse) Reset()

func (*ReadyResponse) String

func (x *ReadyResponse) String() string

type ReconfigureResourceRequest

type ReconfigureResourceRequest struct {
	Config       *v1.ComponentConfig `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"`
	Dependencies []string            `protobuf:"bytes,2,rep,name=dependencies,proto3" json:"dependencies,omitempty"`
	// contains filtered or unexported fields
}

func (*ReconfigureResourceRequest) Descriptor deprecated

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

Deprecated: Use ReconfigureResourceRequest.ProtoReflect.Descriptor instead.

func (*ReconfigureResourceRequest) GetConfig

func (*ReconfigureResourceRequest) GetDependencies

func (x *ReconfigureResourceRequest) GetDependencies() []string

func (*ReconfigureResourceRequest) ProtoMessage

func (*ReconfigureResourceRequest) ProtoMessage()

func (*ReconfigureResourceRequest) ProtoReflect

func (*ReconfigureResourceRequest) Reset

func (x *ReconfigureResourceRequest) Reset()

func (*ReconfigureResourceRequest) String

func (x *ReconfigureResourceRequest) String() string

type ReconfigureResourceResponse

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

func (*ReconfigureResourceResponse) Descriptor deprecated

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

Deprecated: Use ReconfigureResourceResponse.ProtoReflect.Descriptor instead.

func (*ReconfigureResourceResponse) ProtoMessage

func (*ReconfigureResourceResponse) ProtoMessage()

func (*ReconfigureResourceResponse) ProtoReflect

func (*ReconfigureResourceResponse) Reset

func (x *ReconfigureResourceResponse) Reset()

func (*ReconfigureResourceResponse) String

func (x *ReconfigureResourceResponse) String() string

type RemoveResourceRequest

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

func (*RemoveResourceRequest) Descriptor deprecated

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

Deprecated: Use RemoveResourceRequest.ProtoReflect.Descriptor instead.

func (*RemoveResourceRequest) GetName

func (x *RemoveResourceRequest) GetName() string

func (*RemoveResourceRequest) ProtoMessage

func (*RemoveResourceRequest) ProtoMessage()

func (*RemoveResourceRequest) ProtoReflect

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

func (*RemoveResourceRequest) Reset

func (x *RemoveResourceRequest) Reset()

func (*RemoveResourceRequest) String

func (x *RemoveResourceRequest) String() string

type RemoveResourceResponse

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

func (*RemoveResourceResponse) Descriptor deprecated

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

Deprecated: Use RemoveResourceResponse.ProtoReflect.Descriptor instead.

func (*RemoveResourceResponse) ProtoMessage

func (*RemoveResourceResponse) ProtoMessage()

func (*RemoveResourceResponse) ProtoReflect

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

func (*RemoveResourceResponse) Reset

func (x *RemoveResourceResponse) Reset()

func (*RemoveResourceResponse) String

func (x *RemoveResourceResponse) String() string

type UnimplementedModuleServiceServer

type UnimplementedModuleServiceServer struct {
}

UnimplementedModuleServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedModuleServiceServer) AddResource

func (UnimplementedModuleServiceServer) Ready

func (UnimplementedModuleServiceServer) RemoveResource

func (UnimplementedModuleServiceServer) ValidateConfig added in v0.1.87

type UnsafeModuleServiceServer

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

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

type ValidateConfigRequest added in v0.1.87

type ValidateConfigRequest struct {
	Config *v1.ComponentConfig `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"`
	// contains filtered or unexported fields
}

func (*ValidateConfigRequest) Descriptor deprecated added in v0.1.87

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

Deprecated: Use ValidateConfigRequest.ProtoReflect.Descriptor instead.

func (*ValidateConfigRequest) GetConfig added in v0.1.87

func (x *ValidateConfigRequest) GetConfig() *v1.ComponentConfig

func (*ValidateConfigRequest) ProtoMessage added in v0.1.87

func (*ValidateConfigRequest) ProtoMessage()

func (*ValidateConfigRequest) ProtoReflect added in v0.1.87

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

func (*ValidateConfigRequest) Reset added in v0.1.87

func (x *ValidateConfigRequest) Reset()

func (*ValidateConfigRequest) String added in v0.1.87

func (x *ValidateConfigRequest) String() string

type ValidateConfigResponse added in v0.1.87

type ValidateConfigResponse struct {
	Dependencies []string `protobuf:"bytes,1,rep,name=dependencies,proto3" json:"dependencies,omitempty"`
	// contains filtered or unexported fields
}

func (*ValidateConfigResponse) Descriptor deprecated added in v0.1.87

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

Deprecated: Use ValidateConfigResponse.ProtoReflect.Descriptor instead.

func (*ValidateConfigResponse) GetDependencies added in v0.1.87

func (x *ValidateConfigResponse) GetDependencies() []string

func (*ValidateConfigResponse) ProtoMessage added in v0.1.87

func (*ValidateConfigResponse) ProtoMessage()

func (*ValidateConfigResponse) ProtoReflect added in v0.1.87

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

func (*ValidateConfigResponse) Reset added in v0.1.87

func (x *ValidateConfigResponse) Reset()

func (*ValidateConfigResponse) String added in v0.1.87

func (x *ValidateConfigResponse) String() string

Jump to

Keyboard shortcuts

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