pluginutils

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GRPCDialWithTimeout

func GRPCDialWithTimeout(target string, timeout time.Duration) (*grpc.ClientConn, error)

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 Recv

func Recv(conn net.Conn, timeout time.Duration) ([]byte, error)

func RecvFrom

func RecvFrom(conn net.PacketConn, timeout time.Duration) ([]byte, net.Addr, error)

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 Send

func Send(conn net.Conn, data []byte, timeout time.Duration) error

func SendRecv

func SendRecv(conn net.Conn, data []byte, timeout time.Duration) ([]byte, 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.

func SendTo

func SendTo(conn net.PacketConn, data []byte, addr net.Addr, timeout time.Duration) error

SendTo sends data via an unconnected PacketConn to a specific address.

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

type InvalidResponseErrorInfo struct {
	Service string
	Info    string
}

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 ReadError

type ReadError struct {
	Info         string
	WrappedError error
}

func (*ReadError) Error

func (e *ReadError) Error() string

func (*ReadError) Unwrap

func (e *ReadError) Unwrap() 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

Jump to

Keyboard shortcuts

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