grpc

package
v0.0.0-...-fa9ebcd Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

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

type HTTPClient struct {
	BaseURL string
	Client  *http.Client
}

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.

Jump to

Keyboard shortcuts

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