Documentation ¶
Overview ¶
Package tcp provides functionalities for a TCP client.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents a TCP client for interacting with remote services.
func (*Client) Connect ¶
Connect establishes a connection to a remote service.
Parameters: - address: string The address of the remote service. - port: string The port of the remote service.
Returns: - s: *service.Service The connected service. - error: An error if any.
func (*Client) Disconnect ¶
Disconnect closes connections to one or more services.
Parameters: - services: ...string A variadic list of service names to disconnect from.
Returns: - error: An error if any.
func (*Client) Send ¶
Send sends requests to remote services and handles the responses.
Parameters: - callback: func(...*generated.Response) A function to handle responses. - queries: ...*service.Exchange An array of service exchanges containing requests and their associated services.
Returns: - error: An error if any.
type Server ¶
type Server struct { Address string // Address to listen on // contains filtered or unexported fields }
Server represents a TCP server and contains information about the address it listens on and the underlying network listener.
func (*Server) Register ¶
func (s *Server) Register(api api.APInterface)
Register is a method for registering API handlers with the server.
Parameters: - api: api.APInterface - The API interface to register handlers from.