Documentation ¶
Index ¶
- Constants
- func NewMenuServiceHandler(svc MenuServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)
- func NewRestaurantServiceHandler(svc RestaurantServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)
- type MenuServiceClient
- type MenuServiceHandler
- type RestaurantServiceClient
- type RestaurantServiceHandler
- type UnimplementedMenuServiceHandler
- func (UnimplementedMenuServiceHandler) AddMenuItem(context.Context, *connect.Request[biz.AddMenuItemRequest]) (*connect.Response[model.MenuItem], error)
- func (UnimplementedMenuServiceHandler) GetMenuItem(context.Context, *connect.Request[biz.GetMenuItemRequest]) (*connect.Response[model.MenuItem], error)
- func (UnimplementedMenuServiceHandler) ListMenuItems(context.Context, *connect.Request[biz.ListMenuItemsRequest], ...) error
- type UnimplementedRestaurantServiceHandler
- func (UnimplementedRestaurantServiceHandler) CreateRestaurant(context.Context, *connect.Request[biz.CreateRestaurantRequest]) (*connect.Response[model.Restaurant], error)
- func (UnimplementedRestaurantServiceHandler) GetRestaurant(context.Context, *connect.Request[biz.GetRestaurantRequest]) (*connect.Response[model.Restaurant], error)
- func (UnimplementedRestaurantServiceHandler) ListOrders(context.Context, *connect.Request[biz.ListOrdersRequest], ...) error
- func (UnimplementedRestaurantServiceHandler) ListRestaurants(context.Context, *connect.Request[biz.ListRestaurantsRequest], ...) error
- func (UnimplementedRestaurantServiceHandler) ListRestaurantsNonStream(context.Context, *connect.Request[biz.ListRestaurantsRequest]) (*connect.Response[biz.ListRestaurantsResponse], error)
- func (UnimplementedRestaurantServiceHandler) PlaceOrder(context.Context, *connect.Request[biz.PlaceOrderRequest]) (*connect.Response[biz.PlaceOrderResponse], error)
Constants ¶
const ( // MenuServiceAddMenuItemProcedure is the fully-qualified name of the MenuService's AddMenuItem RPC. MenuServiceAddMenuItemProcedure = "/restaurant.MenuService/AddMenuItem" // MenuServiceGetMenuItemProcedure is the fully-qualified name of the MenuService's GetMenuItem RPC. MenuServiceGetMenuItemProcedure = "/restaurant.MenuService/GetMenuItem" // MenuServiceListMenuItemsProcedure is the fully-qualified name of the MenuService's ListMenuItems // RPC. MenuServiceListMenuItemsProcedure = "/restaurant.MenuService/ListMenuItems" )
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 ( // RestaurantServiceCreateRestaurantProcedure is the fully-qualified name of the RestaurantService's // CreateRestaurant RPC. RestaurantServiceCreateRestaurantProcedure = "/restaurant.RestaurantService/CreateRestaurant" // RestaurantServiceListRestaurantsProcedure is the fully-qualified name of the RestaurantService's // ListRestaurants RPC. RestaurantServiceListRestaurantsProcedure = "/restaurant.RestaurantService/ListRestaurants" // RestaurantServiceGetRestaurantProcedure is the fully-qualified name of the RestaurantService's // GetRestaurant RPC. RestaurantServiceGetRestaurantProcedure = "/restaurant.RestaurantService/GetRestaurant" // RestaurantServiceListRestaurantsNonStreamProcedure is the fully-qualified name of the // RestaurantService's ListRestaurantsNonStream RPC. RestaurantServiceListRestaurantsNonStreamProcedure = "/restaurant.RestaurantService/ListRestaurantsNonStream" // RestaurantServicePlaceOrderProcedure is the fully-qualified name of the RestaurantService's // PlaceOrder RPC. RestaurantServicePlaceOrderProcedure = "/restaurant.RestaurantService/PlaceOrder" // RestaurantServiceListOrdersProcedure is the fully-qualified name of the RestaurantService's // ListOrders RPC. RestaurantServiceListOrdersProcedure = "/restaurant.RestaurantService/ListOrders" )
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 (
// MenuServiceName is the fully-qualified name of the MenuService service.
MenuServiceName = "restaurant.MenuService"
)
const (
// RestaurantServiceName is the fully-qualified name of the RestaurantService service.
RestaurantServiceName = "restaurant.RestaurantService"
)
Variables ¶
This section is empty.
Functions ¶
func NewMenuServiceHandler ¶
func NewMenuServiceHandler(svc MenuServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)
NewMenuServiceHandler 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.
func NewRestaurantServiceHandler ¶
func NewRestaurantServiceHandler(svc RestaurantServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)
NewRestaurantServiceHandler 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 MenuServiceClient ¶
type MenuServiceClient interface { AddMenuItem(context.Context, *connect.Request[biz.AddMenuItemRequest]) (*connect.Response[model.MenuItem], error) GetMenuItem(context.Context, *connect.Request[biz.GetMenuItemRequest]) (*connect.Response[model.MenuItem], error) ListMenuItems(context.Context, *connect.Request[biz.ListMenuItemsRequest]) (*connect.ServerStreamForClient[model.MenuItem], error) }
MenuServiceClient is a client for the restaurant.MenuService service.
func NewMenuServiceClient ¶
func NewMenuServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) MenuServiceClient
NewMenuServiceClient constructs a client for the restaurant.MenuService 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 MenuServiceHandler ¶
type MenuServiceHandler interface { AddMenuItem(context.Context, *connect.Request[biz.AddMenuItemRequest]) (*connect.Response[model.MenuItem], error) GetMenuItem(context.Context, *connect.Request[biz.GetMenuItemRequest]) (*connect.Response[model.MenuItem], error) ListMenuItems(context.Context, *connect.Request[biz.ListMenuItemsRequest], *connect.ServerStream[model.MenuItem]) error }
MenuServiceHandler is an implementation of the restaurant.MenuService service.
type RestaurantServiceClient ¶
type RestaurantServiceClient interface { CreateRestaurant(context.Context, *connect.Request[biz.CreateRestaurantRequest]) (*connect.Response[model.Restaurant], error) ListRestaurants(context.Context, *connect.Request[biz.ListRestaurantsRequest]) (*connect.ServerStreamForClient[model.Restaurant], error) GetRestaurant(context.Context, *connect.Request[biz.GetRestaurantRequest]) (*connect.Response[model.Restaurant], error) ListRestaurantsNonStream(context.Context, *connect.Request[biz.ListRestaurantsRequest]) (*connect.Response[biz.ListRestaurantsResponse], error) PlaceOrder(context.Context, *connect.Request[biz.PlaceOrderRequest]) (*connect.Response[biz.PlaceOrderResponse], error) ListOrders(context.Context, *connect.Request[biz.ListOrdersRequest]) (*connect.ServerStreamForClient[model.Order], error) }
RestaurantServiceClient is a client for the restaurant.RestaurantService service.
func NewRestaurantServiceClient ¶
func NewRestaurantServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) RestaurantServiceClient
NewRestaurantServiceClient constructs a client for the restaurant.RestaurantService 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 RestaurantServiceHandler ¶
type RestaurantServiceHandler interface { CreateRestaurant(context.Context, *connect.Request[biz.CreateRestaurantRequest]) (*connect.Response[model.Restaurant], error) ListRestaurants(context.Context, *connect.Request[biz.ListRestaurantsRequest], *connect.ServerStream[model.Restaurant]) error GetRestaurant(context.Context, *connect.Request[biz.GetRestaurantRequest]) (*connect.Response[model.Restaurant], error) ListRestaurantsNonStream(context.Context, *connect.Request[biz.ListRestaurantsRequest]) (*connect.Response[biz.ListRestaurantsResponse], error) PlaceOrder(context.Context, *connect.Request[biz.PlaceOrderRequest]) (*connect.Response[biz.PlaceOrderResponse], error) ListOrders(context.Context, *connect.Request[biz.ListOrdersRequest], *connect.ServerStream[model.Order]) error }
RestaurantServiceHandler is an implementation of the restaurant.RestaurantService service.
type UnimplementedMenuServiceHandler ¶
type UnimplementedMenuServiceHandler struct{}
UnimplementedMenuServiceHandler returns CodeUnimplemented from all methods.
func (UnimplementedMenuServiceHandler) AddMenuItem ¶
func (UnimplementedMenuServiceHandler) GetMenuItem ¶
func (UnimplementedMenuServiceHandler) ListMenuItems ¶
func (UnimplementedMenuServiceHandler) ListMenuItems(context.Context, *connect.Request[biz.ListMenuItemsRequest], *connect.ServerStream[model.MenuItem]) error
type UnimplementedRestaurantServiceHandler ¶
type UnimplementedRestaurantServiceHandler struct{}
UnimplementedRestaurantServiceHandler returns CodeUnimplemented from all methods.
func (UnimplementedRestaurantServiceHandler) CreateRestaurant ¶
func (UnimplementedRestaurantServiceHandler) CreateRestaurant(context.Context, *connect.Request[biz.CreateRestaurantRequest]) (*connect.Response[model.Restaurant], error)
func (UnimplementedRestaurantServiceHandler) GetRestaurant ¶
func (UnimplementedRestaurantServiceHandler) GetRestaurant(context.Context, *connect.Request[biz.GetRestaurantRequest]) (*connect.Response[model.Restaurant], error)
func (UnimplementedRestaurantServiceHandler) ListOrders ¶
func (UnimplementedRestaurantServiceHandler) ListOrders(context.Context, *connect.Request[biz.ListOrdersRequest], *connect.ServerStream[model.Order]) error
func (UnimplementedRestaurantServiceHandler) ListRestaurants ¶
func (UnimplementedRestaurantServiceHandler) ListRestaurants(context.Context, *connect.Request[biz.ListRestaurantsRequest], *connect.ServerStream[model.Restaurant]) error
func (UnimplementedRestaurantServiceHandler) ListRestaurantsNonStream ¶
func (UnimplementedRestaurantServiceHandler) ListRestaurantsNonStream(context.Context, *connect.Request[biz.ListRestaurantsRequest]) (*connect.Response[biz.ListRestaurantsResponse], error)
func (UnimplementedRestaurantServiceHandler) PlaceOrder ¶
func (UnimplementedRestaurantServiceHandler) PlaceOrder(context.Context, *connect.Request[biz.PlaceOrderRequest]) (*connect.Response[biz.PlaceOrderResponse], error)