Documentation
¶
Index ¶
- func Call[Req, Resp any, ReqPtr mix.ProtoMessage[Req], RespPtr mix.ProtoMessage[Resp]](ctx context.Context, c *HTTPClient, method string, req ReqPtr) (RespPtr, error)
- func NewClient(addr string, opts ...grpc.DialOption) (*grpc.ClientConn, error)
- func NewClientTLS(addr string, opts ...grpc.DialOption) (*grpc.ClientConn, error)
- type HTTPClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Call ¶
func Call[Req, Resp any, ReqPtr mix.ProtoMessage[Req], RespPtr mix.ProtoMessage[Resp]]( ctx context.Context, c *HTTPClient, method string, req ReqPtr, ) (RespPtr, error)
Call invokes a gRPC unary method over HTTP/2 without the gRPC-Go runtime. method should be in the form /package.Service/Method, e.g. /user.UserService/GetUser.
func NewClient ¶
func NewClient(addr string, opts ...grpc.DialOption) (*grpc.ClientConn, error)
NewClient creates a gRPC client connection with insecure transport credentials.
func NewClientTLS ¶
func NewClientTLS(addr string, opts ...grpc.DialOption) (*grpc.ClientConn, error)
NewClientTLS creates a gRPC client connection with TLS, skipping server certificate verification.
Types ¶
type HTTPClient ¶
HTTPClient is a lightweight gRPC client that uses HTTP/2 directly, without the gRPC-Go runtime.
func NewHTTPClient ¶
func NewHTTPClient(baseURL string) *HTTPClient
NewHTTPClient creates an HTTPClient, automatically selecting h2c or TLS based on the baseURL scheme.
func NewHTTPClientWithClient ¶
func NewHTTPClientWithClient(baseURL string, client *http.Client) *HTTPClient
NewHTTPClientWithClient creates an HTTPClient using the provided http.Client.
Click to show internal directories.
Click to hide internal directories.