Documentation
¶
Index ¶
- func GRPCDialWithTimeout(target string, timeout time.Duration) (*grpc.ClientConn, error)
- func GRPCInvokeUnary(conn *grpc.ClientConn, method string, request []byte, timeout time.Duration, ...) ([]byte, error)
- func Recv(conn net.Conn, timeout time.Duration) ([]byte, error)
- func RecvFrom(conn net.PacketConn, timeout time.Duration) ([]byte, net.Addr, error)
- func Send(conn net.Conn, data []byte, timeout time.Duration) error
- func SendRecv(conn net.Conn, data []byte, timeout time.Duration) ([]byte, error)
- func SendRecvFrom(conn net.PacketConn, data []byte, addr net.Addr, timeout time.Duration) ([]byte, net.Addr, error)
- func SendTo(conn net.PacketConn, data []byte, addr net.Addr, timeout time.Duration) error
- type CloseDialError
- type CreateDialError
- type InvalidAddrProvided
- type InvalidResponseError
- type InvalidResponseErrorInfo
- type RandomizeError
- type RawBytesCodec
- type ReadError
- type ReadTimeoutError
- type RequestError
- type ServerNotEnable
- type WriteError
- type WriteTimeoutError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GRPCDialWithTimeout ¶
GRPCDialWithTimeout establishes a plaintext gRPC connection to the specified target with a timeout. This is the foundational function for gRPC-based fingerprinting.
Parameters:
- target: Address to connect to (e.g., "localhost:19530")
- timeout: Connection timeout duration
Returns:
- *grpc.ClientConn: Established connection
- error: Connection error if failed
func GRPCInvokeUnary ¶
func GRPCInvokeUnary(conn *grpc.ClientConn, method string, request []byte, timeout time.Duration, opts ...grpc.CallOption) ([]byte, error)
GRPCInvokeUnary invokes a unary gRPC method with raw byte marshaling. This is useful when you don't want to import full proto definitions.
Parameters:
- conn: Established gRPC connection
- method: Full method name (e.g., "/milvus.proto.milvus.MilvusService/GetVersion")
- request: Marshaled request bytes (can be empty for methods with no input)
- timeout: RPC timeout duration
Returns:
- []byte: Marshaled response bytes
- error: RPC error if failed
func RecvFrom ¶
RecvFrom receives a packet from an unconnected PacketConn (e.g., UDP listener). It returns the data, the source address of the packet, and an error.
func SendRecvFrom ¶
func SendRecvFrom(conn net.PacketConn, data []byte, addr net.Addr, timeout time.Duration) ([]byte, net.Addr, error)
SendRecvFrom sends data to a specific address via PacketConn and receives the response from any source. This is needed for protocols like TFTP where the server responds from a different port than the one the request was sent to.
Types ¶
type CloseDialError ¶
type CloseDialError struct {
}
func (*CloseDialError) Error ¶
func (e *CloseDialError) Error() string
type CreateDialError ¶
type CreateDialError struct {
Message string
}
func (*CreateDialError) Error ¶
func (e *CreateDialError) Error() string
type InvalidAddrProvided ¶
type InvalidAddrProvided struct {
Service string
}
func (*InvalidAddrProvided) Error ¶
func (e *InvalidAddrProvided) Error() string
type InvalidResponseError ¶
type InvalidResponseError struct {
Service string
}
func (*InvalidResponseError) Error ¶
func (e *InvalidResponseError) Error() string
type InvalidResponseErrorInfo ¶
func (*InvalidResponseErrorInfo) Error ¶
func (e *InvalidResponseErrorInfo) Error() string
type RandomizeError ¶
type RandomizeError struct {
Message string
}
func (*RandomizeError) Error ¶
func (e *RandomizeError) Error() string
type RawBytesCodec ¶ added in v1.4.1
type RawBytesCodec struct{}
RawBytesCodec is a gRPC codec that passes raw bytes through without protobuf marshaling. Used for fingerprinting where we craft raw protobuf bytes manually to avoid importing full proto definitions.
func (RawBytesCodec) Marshal ¶ added in v1.4.1
func (RawBytesCodec) Marshal(v interface{}) ([]byte, error)
func (RawBytesCodec) Name ¶ added in v1.4.1
func (RawBytesCodec) Name() string
func (RawBytesCodec) Unmarshal ¶ added in v1.4.1
func (RawBytesCodec) Unmarshal(data []byte, v interface{}) error
type ReadTimeoutError ¶
type ReadTimeoutError struct {
WrappedError error
}
func (*ReadTimeoutError) Error ¶
func (e *ReadTimeoutError) Error() string
func (*ReadTimeoutError) Unwrap ¶
func (e *ReadTimeoutError) Unwrap() error
type RequestError ¶
type RequestError struct {
Message string
}
func (*RequestError) Error ¶
func (e *RequestError) Error() string
type ServerNotEnable ¶
type ServerNotEnable struct {
}
func (*ServerNotEnable) Error ¶
func (e *ServerNotEnable) Error() string
type WriteError ¶
type WriteError struct {
WrappedError error
}
func (*WriteError) Error ¶
func (e *WriteError) Error() string
func (*WriteError) Unwrap ¶
func (e *WriteError) Unwrap() error
type WriteTimeoutError ¶
type WriteTimeoutError struct {
WrappedError error
}
func (*WriteTimeoutError) Error ¶
func (e *WriteTimeoutError) Error() string
func (*WriteTimeoutError) Unwrap ¶
func (e *WriteTimeoutError) Unwrap() error