proto

package
v1.4.5 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2026 License: MIT Imports: 10 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	Gocan_SendCommand_FullMethodName    = "/Gocan/SendCommand"
	Gocan_GetSerialPorts_FullMethodName = "/Gocan/GetSerialPorts"
	Gocan_GetAdapters_FullMethodName    = "/Gocan/GetAdapters"
	Gocan_Stream_FullMethodName         = "/Gocan/Stream"
)

Variables

View Source
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.

View Source
var (
	EventLevel_name = map[int32]string{
		0: "EVENT_DEBUG",
		1: "EVENT_INFO",
		2: "EVENT_WARN",
		3: "EVENT_ERROR",
		4: "EVENT_FATAL",
	}
	EventLevel_value = map[string]int32{
		"EVENT_DEBUG": 0,
		"EVENT_INFO":  1,
		"EVENT_WARN":  2,
		"EVENT_ERROR": 3,
		"EVENT_FATAL": 4,
	}
)

Enum value maps for EventLevel.

View Source
var File_proto_server_proto protoreflect.FileDescriptor
View Source
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,proto3" json:"HSCAN,omitempty"`
	SWCAN bool `protobuf:"varint,2,opt,name=SWCAN,proto3" json:"SWCAN,omitempty"`
	KLine bool `protobuf:"varint,3,opt,name=KLine,proto3" 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,opt,name=Name,proto3" json:"Name,omitempty"`
	Description       string               `protobuf:"bytes,2,opt,name=Description,proto3" json:"Description,omitempty"`
	Capabilities      *AdapterCapabilities `protobuf:"bytes,3,opt,name=Capabilities,proto3" json:"Capabilities,omitempty"`
	RequireSerialPort bool                 `protobuf:"varint,4,opt,name=RequireSerialPort,proto3" 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,proto3" json:"adapters,omitempty"`
	// contains filtered or unexported fields
}

func (*Adapters) Descriptor deprecated

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

Deprecated: Use Adapters.ProtoReflect.Descriptor instead.

func (*Adapters) GetAdapters

func (x *Adapters) GetAdapters() []*AdapterInfo

func (*Adapters) ProtoMessage

func (*Adapters) ProtoMessage()

func (*Adapters) ProtoReflect

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

func (*Adapters) Reset

func (x *Adapters) Reset()

func (*Adapters) String

func (x *Adapters) String() string

type CANFrame

type CANFrame struct {
	Id        uint32           `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Data      []byte           `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	FrameType CANFrameTypeEnum `protobuf:"varint,3,opt,name=frame_type,json=frameType,proto3,enum=CANFrameTypeEnum" json:"frame_type,omitempty"`
	Responses uint32           `protobuf:"varint,4,opt,name=responses,proto3" json:"responses,omitempty"`
	// contains filtered or unexported fields
}

CANFrame is the flat representation of a single CAN frame. Frame-type and response-count are inlined (previously a nested CANFrameType message) so the hot streaming path allocates a single message with scalar (value) fields.

func (*CANFrame) Descriptor deprecated

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

Deprecated: Use CANFrame.ProtoReflect.Descriptor instead.

func (*CANFrame) GetData

func (x *CANFrame) GetData() []byte

func (*CANFrame) GetFrameType

func (x *CANFrame) GetFrameType() CANFrameTypeEnum

func (*CANFrame) GetId

func (x *CANFrame) GetId() uint32

func (*CANFrame) GetResponses added in v1.4.1

func (x *CANFrame) GetResponses() uint32

func (*CANFrame) ProtoMessage

func (*CANFrame) ProtoMessage()

func (*CANFrame) ProtoReflect

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

func (*CANFrame) Reset

func (x *CANFrame) Reset()

func (*CANFrame) String

func (x *CANFrame) 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) Enum

func (CANFrameTypeEnum) EnumDescriptor deprecated

func (CANFrameTypeEnum) EnumDescriptor() ([]byte, []int)

Deprecated: Use CANFrameTypeEnum.Descriptor instead.

func (CANFrameTypeEnum) Number

func (CANFrameTypeEnum) String

func (x CANFrameTypeEnum) String() string

func (CANFrameTypeEnum) Type

type Command

type Command struct {
	Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*Command) Descriptor deprecated

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

Deprecated: Use Command.ProtoReflect.Descriptor instead.

func (*Command) GetData

func (x *Command) GetData() []byte

func (*Command) ProtoMessage

func (*Command) ProtoMessage()

func (*Command) ProtoReflect

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

func (*Command) Reset

func (x *Command) Reset()

func (*Command) String

func (x *Command) String() string

type CommandResponse

type CommandResponse struct {
	Data []byte `protobuf:"bytes,1,opt,name=data,proto3" 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 Event added in v1.4.1

type Event struct {
	Level   EventLevel `protobuf:"varint,1,opt,name=level,proto3,enum=EventLevel" json:"level,omitempty"`
	Message string     `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*Event) Descriptor deprecated added in v1.4.1

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

Deprecated: Use Event.ProtoReflect.Descriptor instead.

func (*Event) GetLevel added in v1.4.1

func (x *Event) GetLevel() EventLevel

func (*Event) GetMessage added in v1.4.1

func (x *Event) GetMessage() string

func (*Event) ProtoMessage added in v1.4.1

func (*Event) ProtoMessage()

func (*Event) ProtoReflect added in v1.4.1

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

func (*Event) Reset added in v1.4.1

func (x *Event) Reset()

func (*Event) String added in v1.4.1

func (x *Event) String() string

type EventLevel added in v1.4.1

type EventLevel int32

EventLevel mirrors gocan.EventType so adapter event severity survives the wire instead of being collapsed to a single "info" system message.

const (
	EventLevel_EVENT_DEBUG EventLevel = 0
	EventLevel_EVENT_INFO  EventLevel = 1
	EventLevel_EVENT_WARN  EventLevel = 2
	EventLevel_EVENT_ERROR EventLevel = 3
	EventLevel_EVENT_FATAL EventLevel = 4
)

func (EventLevel) Descriptor added in v1.4.1

func (EventLevel) Descriptor() protoreflect.EnumDescriptor

func (EventLevel) Enum added in v1.4.1

func (x EventLevel) Enum() *EventLevel

func (EventLevel) EnumDescriptor deprecated added in v1.4.1

func (EventLevel) EnumDescriptor() ([]byte, []int)

Deprecated: Use EventLevel.Descriptor instead.

func (EventLevel) Number added in v1.4.1

func (x EventLevel) Number() protoreflect.EnumNumber

func (EventLevel) String added in v1.4.1

func (x EventLevel) String() string

func (EventLevel) Type added in v1.4.1

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, StreamMessage], 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, StreamMessage]) 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, StreamMessage]

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, StreamMessage]

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,opt,name=Name,proto3" json:"Name,omitempty"`
	Description string `protobuf:"bytes,2,opt,name=Description,proto3" 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,proto3" 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 StreamMessage added in v1.4.1

type StreamMessage struct {

	// Types that are valid to be assigned to Payload:
	//
	//	*StreamMessage_Frame
	//	*StreamMessage_Event
	Payload isStreamMessage_Payload `protobuf_oneof:"payload"`
	// contains filtered or unexported fields
}

StreamMessage is what the gateway sends to the client: either a CAN frame or a typed event/error. The client→gateway direction stays a plain CANFrame.

func (*StreamMessage) Descriptor deprecated added in v1.4.1

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

Deprecated: Use StreamMessage.ProtoReflect.Descriptor instead.

func (*StreamMessage) GetEvent added in v1.4.1

func (x *StreamMessage) GetEvent() *Event

func (*StreamMessage) GetFrame added in v1.4.1

func (x *StreamMessage) GetFrame() *CANFrame

func (*StreamMessage) GetPayload added in v1.4.1

func (x *StreamMessage) GetPayload() isStreamMessage_Payload

func (*StreamMessage) ProtoMessage added in v1.4.1

func (*StreamMessage) ProtoMessage()

func (*StreamMessage) ProtoReflect added in v1.4.1

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

func (*StreamMessage) Reset added in v1.4.1

func (x *StreamMessage) Reset()

func (*StreamMessage) String added in v1.4.1

func (x *StreamMessage) String() string

type StreamMessage_Event added in v1.4.1

type StreamMessage_Event struct {
	Event *Event `protobuf:"bytes,2,opt,name=event,proto3,oneof"`
}

type StreamMessage_Frame added in v1.4.1

type StreamMessage_Frame struct {
	Frame *CANFrame `protobuf:"bytes,1,opt,name=frame,proto3,oneof"`
}

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) SendCommand

func (UnimplementedGocanServer) Stream

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.

Jump to

Keyboard shortcuts

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