Documentation
¶
Overview ¶
Package api provides the gRPC server implementation for SerialLink agent.
Index ¶
- Variables
- func StreamLoggingInterceptor(logger *log.Logger) grpc.StreamServerInterceptor
- func UnaryLoggingInterceptor(logger *log.Logger) grpc.UnaryServerInterceptor
- type SerialServer
- func (s *SerialServer) BiDirectionalStream(stream pb.SerialService_BiDirectionalStreamServer) error
- func (s *SerialServer) ClosePort(ctx context.Context, req *pb.ClosePortRequest) (*pb.ClosePortResponse, error)
- func (s *SerialServer) ConfigurePort(ctx context.Context, req *pb.ConfigurePortRequest) (*pb.ConfigurePortResponse, error)
- func (s *SerialServer) GetAgentInfo(ctx context.Context, req *pb.GetAgentInfoRequest) (*pb.GetAgentInfoResponse, error)
- func (s *SerialServer) GetPortConfig(ctx context.Context, req *pb.GetPortConfigRequest) (*pb.GetPortConfigResponse, error)
- func (s *SerialServer) GetPortInfo(ctx context.Context, req *pb.GetPortInfoRequest) (*pb.GetPortInfoResponse, error)
- func (s *SerialServer) GetPortStatus(ctx context.Context, req *pb.GetPortStatusRequest) (*pb.GetPortStatusResponse, error)
- func (s *SerialServer) ListPorts(ctx context.Context, req *pb.ListPortsRequest) (*pb.ListPortsResponse, error)
- func (s *SerialServer) OpenPort(ctx context.Context, req *pb.OpenPortRequest) (*pb.OpenPortResponse, error)
- func (s *SerialServer) Ping(ctx context.Context, req *pb.PingRequest) (*pb.PingResponse, error)
- func (s *SerialServer) Read(ctx context.Context, req *pb.ReadRequest) (*pb.ReadResponse, error)
- func (s *SerialServer) StreamRead(req *pb.StreamReadRequest, stream pb.SerialService_StreamReadServer) error
- func (s *SerialServer) StreamWrite(stream pb.SerialService_StreamWriteServer) error
- func (s *SerialServer) Write(ctx context.Context, req *pb.WriteRequest) (*pb.WriteResponse, error)
Constants ¶
This section is empty.
Variables ¶
var ( Version = "dev" Commit = "none" BuildDate = "unknown" )
Version information (set at build time)
Functions ¶
func StreamLoggingInterceptor ¶ added in v0.0.2
func StreamLoggingInterceptor(logger *log.Logger) grpc.StreamServerInterceptor
StreamLoggingInterceptor returns a gRPC stream interceptor for logging
func UnaryLoggingInterceptor ¶ added in v0.0.2
func UnaryLoggingInterceptor(logger *log.Logger) grpc.UnaryServerInterceptor
UnaryLoggingInterceptor returns a gRPC unary interceptor for logging requests
Types ¶
type SerialServer ¶
type SerialServer struct {
pb.UnimplementedSerialServiceServer
// contains filtered or unexported fields
}
SerialServer implements the gRPC SerialService
func NewSerialServer ¶
func NewSerialServer(manager *serial.Manager, scanner *serial.Scanner, cfg *config.Config, logger *log.Logger) *SerialServer
NewSerialServer creates a new SerialServer
func (*SerialServer) BiDirectionalStream ¶
func (s *SerialServer) BiDirectionalStream(stream pb.SerialService_BiDirectionalStreamServer) error
BiDirectionalStream handles bidirectional streaming
func (*SerialServer) ClosePort ¶
func (s *SerialServer) ClosePort(ctx context.Context, req *pb.ClosePortRequest) (*pb.ClosePortResponse, error)
ClosePort closes a serial port
func (*SerialServer) ConfigurePort ¶
func (s *SerialServer) ConfigurePort(ctx context.Context, req *pb.ConfigurePortRequest) (*pb.ConfigurePortResponse, error)
ConfigurePort configures a port
func (*SerialServer) GetAgentInfo ¶
func (s *SerialServer) GetAgentInfo(ctx context.Context, req *pb.GetAgentInfoRequest) (*pb.GetAgentInfoResponse, error)
GetAgentInfo returns information about the agent
func (*SerialServer) GetPortConfig ¶
func (s *SerialServer) GetPortConfig(ctx context.Context, req *pb.GetPortConfigRequest) (*pb.GetPortConfigResponse, error)
GetPortConfig returns the current configuration of a port
func (*SerialServer) GetPortInfo ¶
func (s *SerialServer) GetPortInfo(ctx context.Context, req *pb.GetPortInfoRequest) (*pb.GetPortInfoResponse, error)
GetPortInfo returns information about a specific port
func (*SerialServer) GetPortStatus ¶
func (s *SerialServer) GetPortStatus(ctx context.Context, req *pb.GetPortStatusRequest) (*pb.GetPortStatusResponse, error)
GetPortStatus returns the status of a port
func (*SerialServer) ListPorts ¶
func (s *SerialServer) ListPorts(ctx context.Context, req *pb.ListPortsRequest) (*pb.ListPortsResponse, error)
ListPorts returns all available serial ports
func (*SerialServer) OpenPort ¶
func (s *SerialServer) OpenPort(ctx context.Context, req *pb.OpenPortRequest) (*pb.OpenPortResponse, error)
OpenPort opens a serial port
func (*SerialServer) Ping ¶
func (s *SerialServer) Ping(ctx context.Context, req *pb.PingRequest) (*pb.PingResponse, error)
Ping checks if the server is alive
func (*SerialServer) Read ¶
func (s *SerialServer) Read(ctx context.Context, req *pb.ReadRequest) (*pb.ReadResponse, error)
Read reads data from a port
func (*SerialServer) StreamRead ¶
func (s *SerialServer) StreamRead(req *pb.StreamReadRequest, stream pb.SerialService_StreamReadServer) error
StreamRead streams data from a port
func (*SerialServer) StreamWrite ¶
func (s *SerialServer) StreamWrite(stream pb.SerialService_StreamWriteServer) error
StreamWrite writes streaming data to a port
func (*SerialServer) Write ¶
func (s *SerialServer) Write(ctx context.Context, req *pb.WriteRequest) (*pb.WriteResponse, error)
============================================================================ Data Transfer ============================================================================ Write writes data to a port