Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterGocanServer(s grpc.ServiceRegistrar, srv GocanServer)
- type AdapterCapabilities
- func (*AdapterCapabilities) Descriptor() ([]byte, []int)deprecated
- func (x *AdapterCapabilities) GetHSCAN() bool
- func (x *AdapterCapabilities) GetKLine() bool
- func (x *AdapterCapabilities) GetSWCAN() bool
- func (*AdapterCapabilities) ProtoMessage()
- func (x *AdapterCapabilities) ProtoReflect() protoreflect.Message
- func (x *AdapterCapabilities) Reset()
- func (x *AdapterCapabilities) String() string
- type AdapterInfo
- func (*AdapterInfo) Descriptor() ([]byte, []int)deprecated
- func (x *AdapterInfo) GetCapabilities() *AdapterCapabilities
- func (x *AdapterInfo) GetDescription() string
- func (x *AdapterInfo) GetName() string
- func (x *AdapterInfo) GetRequireSerialPort() bool
- func (*AdapterInfo) ProtoMessage()
- func (x *AdapterInfo) ProtoReflect() protoreflect.Message
- func (x *AdapterInfo) Reset()
- func (x *AdapterInfo) String() string
- type Adapters
- type CANFrame
- func (*CANFrame) Descriptor() ([]byte, []int)deprecated
- func (x *CANFrame) GetData() []byte
- func (x *CANFrame) GetExtended() bool
- func (x *CANFrame) GetFrameType() *CANFrameType
- func (x *CANFrame) GetId() uint32
- func (*CANFrame) ProtoMessage()
- func (x *CANFrame) ProtoReflect() protoreflect.Message
- func (x *CANFrame) Reset()
- func (x *CANFrame) String() string
- type CANFrameType
- func (*CANFrameType) Descriptor() ([]byte, []int)deprecated
- func (x *CANFrameType) GetFrameType() CANFrameTypeEnum
- func (x *CANFrameType) GetResponses() uint32
- func (*CANFrameType) ProtoMessage()
- func (x *CANFrameType) ProtoReflect() protoreflect.Message
- func (x *CANFrameType) Reset()
- func (x *CANFrameType) String() string
- type CANFrameTypeEnum
- func (CANFrameTypeEnum) Descriptor() protoreflect.EnumDescriptor
- func (x CANFrameTypeEnum) Enum() *CANFrameTypeEnum
- func (CANFrameTypeEnum) EnumDescriptor() ([]byte, []int)deprecated
- func (x CANFrameTypeEnum) Number() protoreflect.EnumNumber
- func (x CANFrameTypeEnum) String() string
- func (CANFrameTypeEnum) Type() protoreflect.EnumType
- func (x *CANFrameTypeEnum) UnmarshalJSON(b []byte) errordeprecated
- type Command
- type CommandResponse
- type GocanClient
- type GocanServer
- type Gocan_StreamClient
- type Gocan_StreamServer
- type SerialPort
- type SerialPorts
- type UnimplementedGocanServer
- func (UnimplementedGocanServer) GetAdapters(context.Context, *emptypb.Empty) (*Adapters, error)
- func (UnimplementedGocanServer) GetSerialPorts(context.Context, *emptypb.Empty) (*SerialPorts, error)
- func (UnimplementedGocanServer) SendCommand(context.Context, *Command) (*CommandResponse, error)
- func (UnimplementedGocanServer) Stream(grpc.BidiStreamingServer[CANFrame, CANFrame]) error
- type UnsafeGocanServer
Constants ¶
const ( Gocan_SendCommand_FullMethodName = "/Gocan/SendCommand" Gocan_GetSerialPorts_FullMethodName = "/Gocan/GetSerialPorts" Gocan_GetAdapters_FullMethodName = "/Gocan/GetAdapters" Gocan_Stream_FullMethodName = "/Gocan/Stream" )
Variables ¶
var ( CANFrameTypeEnum_name = map[int32]string{ 0: "Incoming", 1: "Outgoing", 2: "OutgoingResponseRequired", } CANFrameTypeEnum_value = map[string]int32{ "Incoming": 0, "Outgoing": 1, "OutgoingResponseRequired": 2, } )
Enum value maps for CANFrameTypeEnum.
var File_proto_server_proto protoreflect.FileDescriptor
var Gocan_ServiceDesc = grpc.ServiceDesc{ ServiceName: "Gocan", HandlerType: (*GocanServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "SendCommand", Handler: _Gocan_SendCommand_Handler, }, { MethodName: "GetSerialPorts", Handler: _Gocan_GetSerialPorts_Handler, }, { MethodName: "GetAdapters", Handler: _Gocan_GetAdapters_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "Stream", Handler: _Gocan_Stream_Handler, ServerStreams: true, ClientStreams: true, }, }, Metadata: "proto/server.proto", }
Gocan_ServiceDesc is the grpc.ServiceDesc for Gocan service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterGocanServer ¶
func RegisterGocanServer(s grpc.ServiceRegistrar, srv GocanServer)
Types ¶
type AdapterCapabilities ¶
type AdapterCapabilities struct { HSCAN *bool `protobuf:"varint,1,opt,name=HSCAN" json:"HSCAN,omitempty"` SWCAN *bool `protobuf:"varint,2,opt,name=SWCAN" json:"SWCAN,omitempty"` KLine *bool `protobuf:"varint,3,opt,name=KLine" json:"KLine,omitempty"` // contains filtered or unexported fields }
func (*AdapterCapabilities) Descriptor
deprecated
func (*AdapterCapabilities) Descriptor() ([]byte, []int)
Deprecated: Use AdapterCapabilities.ProtoReflect.Descriptor instead.
func (*AdapterCapabilities) GetHSCAN ¶
func (x *AdapterCapabilities) GetHSCAN() bool
func (*AdapterCapabilities) GetKLine ¶
func (x *AdapterCapabilities) GetKLine() bool
func (*AdapterCapabilities) GetSWCAN ¶
func (x *AdapterCapabilities) GetSWCAN() bool
func (*AdapterCapabilities) ProtoMessage ¶
func (*AdapterCapabilities) ProtoMessage()
func (*AdapterCapabilities) ProtoReflect ¶
func (x *AdapterCapabilities) ProtoReflect() protoreflect.Message
func (*AdapterCapabilities) Reset ¶
func (x *AdapterCapabilities) Reset()
func (*AdapterCapabilities) String ¶
func (x *AdapterCapabilities) String() string
type AdapterInfo ¶
type AdapterInfo struct { Name *string `protobuf:"bytes,1,req,name=Name" json:"Name,omitempty"` Description *string `protobuf:"bytes,2,opt,name=Description" json:"Description,omitempty"` Capabilities *AdapterCapabilities `protobuf:"bytes,3,req,name=Capabilities" json:"Capabilities,omitempty"` RequireSerialPort *bool `protobuf:"varint,4,req,name=RequireSerialPort" json:"RequireSerialPort,omitempty"` // contains filtered or unexported fields }
func (*AdapterInfo) Descriptor
deprecated
func (*AdapterInfo) Descriptor() ([]byte, []int)
Deprecated: Use AdapterInfo.ProtoReflect.Descriptor instead.
func (*AdapterInfo) GetCapabilities ¶
func (x *AdapterInfo) GetCapabilities() *AdapterCapabilities
func (*AdapterInfo) GetDescription ¶
func (x *AdapterInfo) GetDescription() string
func (*AdapterInfo) GetName ¶
func (x *AdapterInfo) GetName() string
func (*AdapterInfo) GetRequireSerialPort ¶
func (x *AdapterInfo) GetRequireSerialPort() bool
func (*AdapterInfo) ProtoMessage ¶
func (*AdapterInfo) ProtoMessage()
func (*AdapterInfo) ProtoReflect ¶
func (x *AdapterInfo) ProtoReflect() protoreflect.Message
func (*AdapterInfo) Reset ¶
func (x *AdapterInfo) Reset()
func (*AdapterInfo) String ¶
func (x *AdapterInfo) String() string
type Adapters ¶
type Adapters struct { Adapters []*AdapterInfo `protobuf:"bytes,1,rep,name=adapters" json:"adapters,omitempty"` // contains filtered or unexported fields }
func (*Adapters) Descriptor
deprecated
func (*Adapters) GetAdapters ¶
func (x *Adapters) GetAdapters() []*AdapterInfo
func (*Adapters) ProtoMessage ¶
func (*Adapters) ProtoMessage()
func (*Adapters) ProtoReflect ¶
func (x *Adapters) ProtoReflect() protoreflect.Message
type CANFrame ¶
type CANFrame struct { Extended *bool `protobuf:"varint,1,opt,name=extended" json:"extended,omitempty"` Id *uint32 `protobuf:"varint,2,req,name=id" json:"id,omitempty"` Data []byte `protobuf:"bytes,3,req,name=data" json:"data,omitempty"` FrameType *CANFrameType `protobuf:"bytes,4,req,name=frameType" json:"frameType,omitempty"` // contains filtered or unexported fields }
func (*CANFrame) Descriptor
deprecated
func (*CANFrame) GetExtended ¶
func (*CANFrame) GetFrameType ¶
func (x *CANFrame) GetFrameType() *CANFrameType
func (*CANFrame) ProtoMessage ¶
func (*CANFrame) ProtoMessage()
func (*CANFrame) ProtoReflect ¶
func (x *CANFrame) ProtoReflect() protoreflect.Message
type CANFrameType ¶
type CANFrameType struct { FrameType *CANFrameTypeEnum `protobuf:"varint,1,req,name=FrameType,enum=CANFrameTypeEnum" json:"FrameType,omitempty"` Responses *uint32 `protobuf:"varint,2,req,name=Responses" json:"Responses,omitempty"` // contains filtered or unexported fields }
func (*CANFrameType) Descriptor
deprecated
func (*CANFrameType) Descriptor() ([]byte, []int)
Deprecated: Use CANFrameType.ProtoReflect.Descriptor instead.
func (*CANFrameType) GetFrameType ¶
func (x *CANFrameType) GetFrameType() CANFrameTypeEnum
func (*CANFrameType) GetResponses ¶
func (x *CANFrameType) GetResponses() uint32
func (*CANFrameType) ProtoMessage ¶
func (*CANFrameType) ProtoMessage()
func (*CANFrameType) ProtoReflect ¶
func (x *CANFrameType) ProtoReflect() protoreflect.Message
func (*CANFrameType) Reset ¶
func (x *CANFrameType) Reset()
func (*CANFrameType) String ¶
func (x *CANFrameType) String() string
type CANFrameTypeEnum ¶
type CANFrameTypeEnum int32
const ( CANFrameTypeEnum_Incoming CANFrameTypeEnum = 0 CANFrameTypeEnum_Outgoing CANFrameTypeEnum = 1 CANFrameTypeEnum_OutgoingResponseRequired CANFrameTypeEnum = 2 )
func (CANFrameTypeEnum) Descriptor ¶
func (CANFrameTypeEnum) Descriptor() protoreflect.EnumDescriptor
func (CANFrameTypeEnum) Enum ¶
func (x CANFrameTypeEnum) Enum() *CANFrameTypeEnum
func (CANFrameTypeEnum) EnumDescriptor
deprecated
func (CANFrameTypeEnum) EnumDescriptor() ([]byte, []int)
Deprecated: Use CANFrameTypeEnum.Descriptor instead.
func (CANFrameTypeEnum) Number ¶
func (x CANFrameTypeEnum) Number() protoreflect.EnumNumber
func (CANFrameTypeEnum) String ¶
func (x CANFrameTypeEnum) String() string
func (CANFrameTypeEnum) Type ¶
func (CANFrameTypeEnum) Type() protoreflect.EnumType
func (*CANFrameTypeEnum) UnmarshalJSON
deprecated
func (x *CANFrameTypeEnum) UnmarshalJSON(b []byte) error
Deprecated: Do not use.
type Command ¶
type Command struct { Data []byte `protobuf:"bytes,1,req,name=data" json:"data,omitempty"` // contains filtered or unexported fields }
func (*Command) Descriptor
deprecated
func (*Command) ProtoMessage ¶
func (*Command) ProtoMessage()
func (*Command) ProtoReflect ¶
func (x *Command) ProtoReflect() protoreflect.Message
type CommandResponse ¶
type CommandResponse struct { Data []byte `protobuf:"bytes,1,req,name=data" json:"data,omitempty"` // contains filtered or unexported fields }
func (*CommandResponse) Descriptor
deprecated
func (*CommandResponse) Descriptor() ([]byte, []int)
Deprecated: Use CommandResponse.ProtoReflect.Descriptor instead.
func (*CommandResponse) GetData ¶
func (x *CommandResponse) GetData() []byte
func (*CommandResponse) ProtoMessage ¶
func (*CommandResponse) ProtoMessage()
func (*CommandResponse) ProtoReflect ¶
func (x *CommandResponse) ProtoReflect() protoreflect.Message
func (*CommandResponse) Reset ¶
func (x *CommandResponse) Reset()
func (*CommandResponse) String ¶
func (x *CommandResponse) String() string
type GocanClient ¶
type GocanClient interface { SendCommand(ctx context.Context, in *Command, opts ...grpc.CallOption) (*CommandResponse, error) GetSerialPorts(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*SerialPorts, error) GetAdapters(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Adapters, error) Stream(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[CANFrame, CANFrame], error) }
GocanClient is the client API for Gocan 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.
func NewGocanClient ¶
func NewGocanClient(cc grpc.ClientConnInterface) GocanClient
type GocanServer ¶
type GocanServer interface { SendCommand(context.Context, *Command) (*CommandResponse, error) GetSerialPorts(context.Context, *emptypb.Empty) (*SerialPorts, error) GetAdapters(context.Context, *emptypb.Empty) (*Adapters, error) Stream(grpc.BidiStreamingServer[CANFrame, CANFrame]) error // contains filtered or unexported methods }
GocanServer is the server API for Gocan service. All implementations must embed UnimplementedGocanServer for forward compatibility.
type Gocan_StreamClient ¶
type Gocan_StreamClient = grpc.BidiStreamingClient[CANFrame, CANFrame]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Gocan_StreamServer ¶
type Gocan_StreamServer = grpc.BidiStreamingServer[CANFrame, CANFrame]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type SerialPort ¶
type SerialPort struct { Name *string `protobuf:"bytes,1,req,name=Name" json:"Name,omitempty"` Description *string `protobuf:"bytes,2,opt,name=Description" json:"Description,omitempty"` // contains filtered or unexported fields }
func (*SerialPort) Descriptor
deprecated
func (*SerialPort) Descriptor() ([]byte, []int)
Deprecated: Use SerialPort.ProtoReflect.Descriptor instead.
func (*SerialPort) GetDescription ¶
func (x *SerialPort) GetDescription() string
func (*SerialPort) GetName ¶
func (x *SerialPort) GetName() string
func (*SerialPort) ProtoMessage ¶
func (*SerialPort) ProtoMessage()
func (*SerialPort) ProtoReflect ¶
func (x *SerialPort) ProtoReflect() protoreflect.Message
func (*SerialPort) Reset ¶
func (x *SerialPort) Reset()
func (*SerialPort) String ¶
func (x *SerialPort) String() string
type SerialPorts ¶
type SerialPorts struct { Ports []*SerialPort `protobuf:"bytes,1,rep,name=ports" json:"ports,omitempty"` // contains filtered or unexported fields }
func (*SerialPorts) Descriptor
deprecated
func (*SerialPorts) Descriptor() ([]byte, []int)
Deprecated: Use SerialPorts.ProtoReflect.Descriptor instead.
func (*SerialPorts) GetPorts ¶
func (x *SerialPorts) GetPorts() []*SerialPort
func (*SerialPorts) ProtoMessage ¶
func (*SerialPorts) ProtoMessage()
func (*SerialPorts) ProtoReflect ¶
func (x *SerialPorts) ProtoReflect() protoreflect.Message
func (*SerialPorts) Reset ¶
func (x *SerialPorts) Reset()
func (*SerialPorts) String ¶
func (x *SerialPorts) String() string
type UnimplementedGocanServer ¶
type UnimplementedGocanServer struct{}
UnimplementedGocanServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedGocanServer) GetAdapters ¶
func (UnimplementedGocanServer) GetSerialPorts ¶
func (UnimplementedGocanServer) GetSerialPorts(context.Context, *emptypb.Empty) (*SerialPorts, error)
func (UnimplementedGocanServer) SendCommand ¶
func (UnimplementedGocanServer) SendCommand(context.Context, *Command) (*CommandResponse, error)
func (UnimplementedGocanServer) Stream ¶
func (UnimplementedGocanServer) Stream(grpc.BidiStreamingServer[CANFrame, CANFrame]) error
type UnsafeGocanServer ¶
type UnsafeGocanServer interface {
// contains filtered or unexported methods
}
UnsafeGocanServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to GocanServer will result in compilation errors.