proto

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2025 License: MIT Imports: 9 Imported by: 0

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 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" 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) 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 {
	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) Descriptor() ([]byte, []int)

Deprecated: Use CANFrame.ProtoReflect.Descriptor instead.

func (*CANFrame) GetData

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

func (*CANFrame) GetExtended

func (x *CANFrame) GetExtended() bool

func (*CANFrame) GetFrameType

func (x *CANFrame) GetFrameType() *CANFrameType

func (*CANFrame) GetId

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

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