Documentation ¶
Index ¶
- Constants
- func NewProductServiceHandler(svc ProductServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)
- type ProductServiceClient
- type ProductServiceHandler
- type UnimplementedProductServiceHandler
- func (UnimplementedProductServiceHandler) Delete(context.Context, *connect.Request[v1.DeleteRequest]) (*connect.Response[v1.DeleteResponse], error)
- func (UnimplementedProductServiceHandler) Get(context.Context, *connect.Request[v1.GetRequest]) (*connect.Response[v1.GetResponse], error)
- func (UnimplementedProductServiceHandler) List(context.Context, *connect.Request[v1.ListRequest]) (*connect.Response[v1.ListResponse], error)
- func (UnimplementedProductServiceHandler) New(context.Context, *connect.Request[v1.NewRequest]) (*connect.Response[v1.NewResponse], error)
- func (UnimplementedProductServiceHandler) Update(context.Context, *connect.Request[v1.UpdateRequest]) (*connect.Response[v1.UpdateResponse], error)
Constants ¶
const ( // ProductServiceNewProcedure is the fully-qualified name of the ProductService's New RPC. ProductServiceNewProcedure = "/product.v1.ProductService/New" // ProductServiceGetProcedure is the fully-qualified name of the ProductService's Get RPC. ProductServiceGetProcedure = "/product.v1.ProductService/Get" // ProductServiceUpdateProcedure is the fully-qualified name of the ProductService's Update RPC. ProductServiceUpdateProcedure = "/product.v1.ProductService/Update" // ProductServiceListProcedure is the fully-qualified name of the ProductService's List RPC. ProductServiceListProcedure = "/product.v1.ProductService/List" // ProductServiceDeleteProcedure is the fully-qualified name of the ProductService's Delete RPC. ProductServiceDeleteProcedure = "/product.v1.ProductService/Delete" )
These constants are the fully-qualified names of the RPCs defined in this package. They're exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.
Note that these are different from the fully-qualified method names used by google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to reflection-formatted method names, remove the leading slash and convert the remaining slash to a period.
const (
// ProductServiceName is the fully-qualified name of the ProductService service.
ProductServiceName = "product.v1.ProductService"
)
Variables ¶
This section is empty.
Functions ¶
func NewProductServiceHandler ¶
func NewProductServiceHandler(svc ProductServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)
NewProductServiceHandler builds an HTTP handler from the service implementation. It returns the path on which to mount the handler and the handler itself.
By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf and JSON codecs. They also support gzip compression.
Types ¶
type ProductServiceClient ¶
type ProductServiceClient interface { New(context.Context, *connect.Request[v1.NewRequest]) (*connect.Response[v1.NewResponse], error) Get(context.Context, *connect.Request[v1.GetRequest]) (*connect.Response[v1.GetResponse], error) Update(context.Context, *connect.Request[v1.UpdateRequest]) (*connect.Response[v1.UpdateResponse], error) List(context.Context, *connect.Request[v1.ListRequest]) (*connect.Response[v1.ListResponse], error) Delete(context.Context, *connect.Request[v1.DeleteRequest]) (*connect.Response[v1.DeleteResponse], error) }
ProductServiceClient is a client for the product.v1.ProductService service.
func NewProductServiceClient ¶
func NewProductServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) ProductServiceClient
NewProductServiceClient constructs a client for the product.v1.ProductService service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options.
The URL supplied here should be the base URL for the Connect or gRPC server (for example, http://api.acme.com or https://acme.com/grpc).
type ProductServiceHandler ¶
type ProductServiceHandler interface { New(context.Context, *connect.Request[v1.NewRequest]) (*connect.Response[v1.NewResponse], error) Get(context.Context, *connect.Request[v1.GetRequest]) (*connect.Response[v1.GetResponse], error) Update(context.Context, *connect.Request[v1.UpdateRequest]) (*connect.Response[v1.UpdateResponse], error) List(context.Context, *connect.Request[v1.ListRequest]) (*connect.Response[v1.ListResponse], error) Delete(context.Context, *connect.Request[v1.DeleteRequest]) (*connect.Response[v1.DeleteResponse], error) }
ProductServiceHandler is an implementation of the product.v1.ProductService service.
type UnimplementedProductServiceHandler ¶
type UnimplementedProductServiceHandler struct{}
UnimplementedProductServiceHandler returns CodeUnimplemented from all methods.
func (UnimplementedProductServiceHandler) Delete ¶
func (UnimplementedProductServiceHandler) Delete(context.Context, *connect.Request[v1.DeleteRequest]) (*connect.Response[v1.DeleteResponse], error)
func (UnimplementedProductServiceHandler) Get ¶
func (UnimplementedProductServiceHandler) Get(context.Context, *connect.Request[v1.GetRequest]) (*connect.Response[v1.GetResponse], error)
func (UnimplementedProductServiceHandler) List ¶
func (UnimplementedProductServiceHandler) List(context.Context, *connect.Request[v1.ListRequest]) (*connect.Response[v1.ListResponse], error)
func (UnimplementedProductServiceHandler) New ¶
func (UnimplementedProductServiceHandler) New(context.Context, *connect.Request[v1.NewRequest]) (*connect.Response[v1.NewResponse], error)
func (UnimplementedProductServiceHandler) Update ¶
func (UnimplementedProductServiceHandler) Update(context.Context, *connect.Request[v1.UpdateRequest]) (*connect.Response[v1.UpdateResponse], error)