v1

package
v0.1.181 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

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_component_powersensor_powersensor_proto protoreflect.FileDescriptor
View Source
var PowerSensorService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "viam.component.powersensor.v1.PowerSensorService",
	HandlerType: (*PowerSensorServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetVoltage",
			Handler:    _PowerSensorService_GetVoltage_Handler,
		},
		{
			MethodName: "GetCurrent",
			Handler:    _PowerSensorService_GetCurrent_Handler,
		},
		{
			MethodName: "GetPower",
			Handler:    _PowerSensorService_GetPower_Handler,
		},
		{
			MethodName: "DoCommand",
			Handler:    _PowerSensorService_DoCommand_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "component/powersensor/powersensor.proto",
}

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

Functions

func RegisterPowerSensorServiceHandler

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

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

func RegisterPowerSensorServiceHandlerClient

func RegisterPowerSensorServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PowerSensorServiceClient) error

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

func RegisterPowerSensorServiceHandlerFromEndpoint

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

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

func RegisterPowerSensorServiceHandlerServer

func RegisterPowerSensorServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PowerSensorServiceServer) error

RegisterPowerSensorServiceHandlerServer registers the http handlers for service PowerSensorService to "mux". UnaryRPC :call PowerSensorServiceServer 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 RegisterPowerSensorServiceHandlerFromEndpoint instead.

func RegisterPowerSensorServiceServer

func RegisterPowerSensorServiceServer(s grpc.ServiceRegistrar, srv PowerSensorServiceServer)

Types

type GetCurrentRequest

type GetCurrentRequest struct {

	// Name of a power sensor
	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 (*GetCurrentRequest) Descriptor deprecated

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

Deprecated: Use GetCurrentRequest.ProtoReflect.Descriptor instead.

func (*GetCurrentRequest) GetExtra

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

func (*GetCurrentRequest) GetName

func (x *GetCurrentRequest) GetName() string

func (*GetCurrentRequest) ProtoMessage

func (*GetCurrentRequest) ProtoMessage()

func (*GetCurrentRequest) ProtoReflect

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

func (*GetCurrentRequest) Reset

func (x *GetCurrentRequest) Reset()

func (*GetCurrentRequest) String

func (x *GetCurrentRequest) String() string

type GetCurrentResponse

type GetCurrentResponse struct {

	// Current in amperes
	Amperes float64 `protobuf:"fixed64,1,opt,name=amperes,proto3" json:"amperes,omitempty"`
	// Bool descibing whether the current is DC or AC
	IsAc bool `protobuf:"varint,2,opt,name=is_ac,json=isAc,proto3" json:"is_ac,omitempty"`
	// contains filtered or unexported fields
}

func (*GetCurrentResponse) Descriptor deprecated

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

Deprecated: Use GetCurrentResponse.ProtoReflect.Descriptor instead.

func (*GetCurrentResponse) GetAmperes

func (x *GetCurrentResponse) GetAmperes() float64

func (*GetCurrentResponse) GetIsAc

func (x *GetCurrentResponse) GetIsAc() bool

func (*GetCurrentResponse) ProtoMessage

func (*GetCurrentResponse) ProtoMessage()

func (*GetCurrentResponse) ProtoReflect

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

func (*GetCurrentResponse) Reset

func (x *GetCurrentResponse) Reset()

func (*GetCurrentResponse) String

func (x *GetCurrentResponse) String() string

type GetPowerRequest

type GetPowerRequest struct {

	// Name of a power sensor
	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 (*GetPowerRequest) Descriptor deprecated

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

Deprecated: Use GetPowerRequest.ProtoReflect.Descriptor instead.

func (*GetPowerRequest) GetExtra

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

func (*GetPowerRequest) GetName

func (x *GetPowerRequest) GetName() string

func (*GetPowerRequest) ProtoMessage

func (*GetPowerRequest) ProtoMessage()

func (*GetPowerRequest) ProtoReflect

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

func (*GetPowerRequest) Reset

func (x *GetPowerRequest) Reset()

func (*GetPowerRequest) String

func (x *GetPowerRequest) String() string

type GetPowerResponse

type GetPowerResponse struct {

	// Power in watts
	Watts float64 `protobuf:"fixed64,1,opt,name=watts,proto3" json:"watts,omitempty"`
	// contains filtered or unexported fields
}

func (*GetPowerResponse) Descriptor deprecated

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

Deprecated: Use GetPowerResponse.ProtoReflect.Descriptor instead.

func (*GetPowerResponse) GetWatts

func (x *GetPowerResponse) GetWatts() float64

func (*GetPowerResponse) ProtoMessage

func (*GetPowerResponse) ProtoMessage()

func (*GetPowerResponse) ProtoReflect

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

func (*GetPowerResponse) Reset

func (x *GetPowerResponse) Reset()

func (*GetPowerResponse) String

func (x *GetPowerResponse) String() string

type GetVoltageRequest

type GetVoltageRequest struct {

	// Name of a power sensor
	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 (*GetVoltageRequest) Descriptor deprecated

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

Deprecated: Use GetVoltageRequest.ProtoReflect.Descriptor instead.

func (*GetVoltageRequest) GetExtra

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

func (*GetVoltageRequest) GetName

func (x *GetVoltageRequest) GetName() string

func (*GetVoltageRequest) ProtoMessage

func (*GetVoltageRequest) ProtoMessage()

func (*GetVoltageRequest) ProtoReflect

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

func (*GetVoltageRequest) Reset

func (x *GetVoltageRequest) Reset()

func (*GetVoltageRequest) String

func (x *GetVoltageRequest) String() string

type GetVoltageResponse

type GetVoltageResponse struct {

	// Voltage in volts
	Volts float64 `protobuf:"fixed64,1,opt,name=volts,proto3" json:"volts,omitempty"`
	// Bool describing whether the voltage is DC or AC
	IsAc bool `protobuf:"varint,2,opt,name=is_ac,json=isAc,proto3" json:"is_ac,omitempty"`
	// contains filtered or unexported fields
}

func (*GetVoltageResponse) Descriptor deprecated

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

Deprecated: Use GetVoltageResponse.ProtoReflect.Descriptor instead.

func (*GetVoltageResponse) GetIsAc

func (x *GetVoltageResponse) GetIsAc() bool

func (*GetVoltageResponse) GetVolts

func (x *GetVoltageResponse) GetVolts() float64

func (*GetVoltageResponse) ProtoMessage

func (*GetVoltageResponse) ProtoMessage()

func (*GetVoltageResponse) ProtoReflect

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

func (*GetVoltageResponse) Reset

func (x *GetVoltageResponse) Reset()

func (*GetVoltageResponse) String

func (x *GetVoltageResponse) String() string

type PowerSensorServiceClient

type PowerSensorServiceClient interface {
	// GetVoltage returns the voltage reading of a power sensor in volts
	GetVoltage(ctx context.Context, in *GetVoltageRequest, opts ...grpc.CallOption) (*GetVoltageResponse, error)
	// GetCurrent returns the current reading of a power sensor in amperes
	GetCurrent(ctx context.Context, in *GetCurrentRequest, opts ...grpc.CallOption) (*GetCurrentResponse, error)
	// GetPower returns the power reading of a power sensor in watts
	GetPower(ctx context.Context, in *GetPowerRequest, opts ...grpc.CallOption) (*GetPowerResponse, error)
	// DoCommand sends/receives arbitrary commands
	DoCommand(ctx context.Context, in *v1.DoCommandRequest, opts ...grpc.CallOption) (*v1.DoCommandResponse, error)
}

PowerSensorServiceClient is the client API for PowerSensorService 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 PowerSensorServiceServer

type PowerSensorServiceServer interface {
	// GetVoltage returns the voltage reading of a power sensor in volts
	GetVoltage(context.Context, *GetVoltageRequest) (*GetVoltageResponse, error)
	// GetCurrent returns the current reading of a power sensor in amperes
	GetCurrent(context.Context, *GetCurrentRequest) (*GetCurrentResponse, error)
	// GetPower returns the power reading of a power sensor in watts
	GetPower(context.Context, *GetPowerRequest) (*GetPowerResponse, error)
	// DoCommand sends/receives arbitrary commands
	DoCommand(context.Context, *v1.DoCommandRequest) (*v1.DoCommandResponse, error)
	// contains filtered or unexported methods
}

PowerSensorServiceServer is the server API for PowerSensorService service. All implementations must embed UnimplementedPowerSensorServiceServer for forward compatibility

type UnimplementedPowerSensorServiceServer

type UnimplementedPowerSensorServiceServer struct {
}

UnimplementedPowerSensorServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedPowerSensorServiceServer) DoCommand

func (UnimplementedPowerSensorServiceServer) GetCurrent

func (UnimplementedPowerSensorServiceServer) GetPower

func (UnimplementedPowerSensorServiceServer) GetVoltage

type UnsafePowerSensorServiceServer

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

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

Directories

Path Synopsis
Package v1 is a reverse proxy.
Package v1 is a reverse proxy.

Jump to

Keyboard shortcuts

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