orders

package
v0.0.0-...-f82f288 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package orders is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_api_orders_orders_service_proto protoreflect.FileDescriptor
View Source
var OrdersService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "orders_api.OrdersService",
	HandlerType: (*OrdersServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CancelItems",
			Handler:    _OrdersService_CancelItems_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "api/orders/orders_service.proto",
}

OrdersService_ServiceDesc is the grpc.ServiceDesc for OrdersService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterOrdersServiceHandler

func RegisterOrdersServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterOrdersServiceHandler registers the http handlers for service OrdersService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterOrdersServiceHandlerClient

func RegisterOrdersServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client OrdersServiceClient) error

RegisterOrdersServiceHandlerClient registers the http handlers for service OrdersService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "OrdersServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "OrdersServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "OrdersServiceClient" to call the correct interceptors.

func RegisterOrdersServiceHandlerFromEndpoint

func RegisterOrdersServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterOrdersServiceHandlerFromEndpoint is same as RegisterOrdersServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterOrdersServiceHandlerServer

func RegisterOrdersServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server OrdersServiceServer) error

RegisterOrdersServiceHandlerServer registers the http handlers for service OrdersService to "mux". UnaryRPC :call OrdersServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterOrdersServiceHandlerFromEndpoint instead.

func RegisterOrdersServiceServer

func RegisterOrdersServiceServer(s grpc.ServiceRegistrar, srv OrdersServiceServer)

Types

type CancelItemsRequest

type CancelItemsRequest struct {

	// The order ID used by your channel when creating the order
	ChannelOrderId string `protobuf:"bytes,1,opt,name=channel_order_id,json=channelOrderId,proto3" json:"channel_order_id,omitempty"`
	// A map of line item IDs to quantities to cancel
	CancelQuantities map[string]int64 `` /* 198-byte string literal not displayed */
	// contains filtered or unexported fields
}

CancelItemsRequest is the request to cancel items in an order.

func (*CancelItemsRequest) Descriptor deprecated

func (*CancelItemsRequest) Descriptor() ([]byte, []int)

Deprecated: Use CancelItemsRequest.ProtoReflect.Descriptor instead.

func (*CancelItemsRequest) GetCancelQuantities

func (x *CancelItemsRequest) GetCancelQuantities() map[string]int64

func (*CancelItemsRequest) GetChannelOrderId

func (x *CancelItemsRequest) GetChannelOrderId() string

func (*CancelItemsRequest) ProtoMessage

func (*CancelItemsRequest) ProtoMessage()

func (*CancelItemsRequest) ProtoReflect

func (x *CancelItemsRequest) ProtoReflect() protoreflect.Message

func (*CancelItemsRequest) Reset

func (x *CancelItemsRequest) Reset()

func (*CancelItemsRequest) String

func (x *CancelItemsRequest) String() string

type CancelItemsResponse

type CancelItemsResponse struct {
	// contains filtered or unexported fields
}

CancelItemsResponse is the response to a CancelItems request.

func (*CancelItemsResponse) Descriptor deprecated

func (*CancelItemsResponse) Descriptor() ([]byte, []int)

Deprecated: Use CancelItemsResponse.ProtoReflect.Descriptor instead.

func (*CancelItemsResponse) ProtoMessage

func (*CancelItemsResponse) ProtoMessage()

func (*CancelItemsResponse) ProtoReflect

func (x *CancelItemsResponse) ProtoReflect() protoreflect.Message

func (*CancelItemsResponse) Reset

func (x *CancelItemsResponse) Reset()

func (*CancelItemsResponse) String

func (x *CancelItemsResponse) String() string

type OrdersServiceClient

type OrdersServiceClient interface {
	// CancelItems cancels items in an order.
	CancelItems(ctx context.Context, in *CancelItemsRequest, opts ...grpc.CallOption) (*CancelItemsResponse, error)
}

OrdersServiceClient is the client API for OrdersService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type OrdersServiceServer

type OrdersServiceServer interface {
	// CancelItems cancels items in an order.
	CancelItems(context.Context, *CancelItemsRequest) (*CancelItemsResponse, error)
}

OrdersServiceServer is the server API for OrdersService service. All implementations should embed UnimplementedOrdersServiceServer for forward compatibility

type UnimplementedOrdersServiceServer

type UnimplementedOrdersServiceServer struct {
}

UnimplementedOrdersServiceServer should be embedded to have forward compatible implementations.

func (UnimplementedOrdersServiceServer) CancelItems

type UnsafeOrdersServiceServer

type UnsafeOrdersServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeOrdersServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to OrdersServiceServer will result in compilation errors.

Jump to

Keyboard shortcuts

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