v1

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2026 License: MIT Imports: 30 Imported by: 0

Documentation

Overview

Package v1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	OrderService_CreateOrder_FullMethodName       = "/order.v1.OrderService/CreateOrder"
	OrderService_GetOrder_FullMethodName          = "/order.v1.OrderService/GetOrder"
	OrderService_ListOrders_FullMethodName        = "/order.v1.OrderService/ListOrders"
	OrderService_UpdateOrderStatus_FullMethodName = "/order.v1.OrderService/UpdateOrderStatus"
)

Variables

View Source
var (
	OrderStatus_name = map[int32]string{
		0: "ORDER_STATUS_UNSPECIFIED",
		1: "ORDER_STATUS_PENDING",
		2: "ORDER_STATUS_PAID",
		3: "ORDER_STATUS_SHIPPED",
		4: "ORDER_STATUS_DELIVERED",
		5: "ORDER_STATUS_CANCELLED",
	}
	OrderStatus_value = map[string]int32{
		"ORDER_STATUS_UNSPECIFIED": 0,
		"ORDER_STATUS_PENDING":     1,
		"ORDER_STATUS_PAID":        2,
		"ORDER_STATUS_SHIPPED":     3,
		"ORDER_STATUS_DELIVERED":   4,
		"ORDER_STATUS_CANCELLED":   5,
	}
)

Enum value maps for OrderStatus.

View Source
var File_order_v1_order_proto protoreflect.FileDescriptor
View Source
var OrderService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "order.v1.OrderService",
	HandlerType: (*OrderServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateOrder",
			Handler:    _OrderService_CreateOrder_Handler,
		},
		{
			MethodName: "GetOrder",
			Handler:    _OrderService_GetOrder_Handler,
		},
		{
			MethodName: "ListOrders",
			Handler:    _OrderService_ListOrders_Handler,
		},
		{
			MethodName: "UpdateOrderStatus",
			Handler:    _OrderService_UpdateOrderStatus_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "order/v1/order.proto",
}

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

Functions

func RegisterOrderServiceHandler added in v1.2.0

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

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

func RegisterOrderServiceHandlerClient added in v1.2.0

func RegisterOrderServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client OrderServiceClient) error

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

func RegisterOrderServiceHandlerFromEndpoint added in v1.2.0

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

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

func RegisterOrderServiceHandlerServer added in v1.2.0

func RegisterOrderServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server OrderServiceServer) error

RegisterOrderServiceHandlerServer registers the http handlers for service OrderService to "mux". UnaryRPC :call OrderServiceServer 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 RegisterOrderServiceHandlerFromEndpoint instead. GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.

func RegisterOrderServiceServer

func RegisterOrderServiceServer(s grpc.ServiceRegistrar, srv OrderServiceServer)

Types

type CreateOrderRequest

type CreateOrderRequest struct {
	UserId          string           `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	CartId          string           `protobuf:"bytes,2,opt,name=cart_id,json=cartId,proto3" json:"cart_id,omitempty"` // Optional, so no strict validation here initially besides format if provided
	ShippingAddress *ShippingAddress `protobuf:"bytes,3,opt,name=shipping_address,json=shippingAddress,proto3" json:"shipping_address,omitempty"`
	// contains filtered or unexported fields
}

Request to create an order (Checkout).

func (*CreateOrderRequest) Descriptor deprecated

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

Deprecated: Use CreateOrderRequest.ProtoReflect.Descriptor instead.

func (*CreateOrderRequest) GetCartId

func (x *CreateOrderRequest) GetCartId() string

func (*CreateOrderRequest) GetShippingAddress

func (x *CreateOrderRequest) GetShippingAddress() *ShippingAddress

func (*CreateOrderRequest) GetUserId

func (x *CreateOrderRequest) GetUserId() string

func (*CreateOrderRequest) ProtoMessage

func (*CreateOrderRequest) ProtoMessage()

func (*CreateOrderRequest) ProtoReflect

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

func (*CreateOrderRequest) Reset

func (x *CreateOrderRequest) Reset()

func (*CreateOrderRequest) String

func (x *CreateOrderRequest) String() string

func (*CreateOrderRequest) Validate added in v1.1.1

func (m *CreateOrderRequest) Validate() error

Validate checks the field values on CreateOrderRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*CreateOrderRequest) ValidateAll added in v1.1.1

func (m *CreateOrderRequest) ValidateAll() error

ValidateAll checks the field values on CreateOrderRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in CreateOrderRequestMultiError, or nil if none found.

type CreateOrderRequestMultiError added in v1.1.1

type CreateOrderRequestMultiError []error

CreateOrderRequestMultiError is an error wrapping multiple validation errors returned by CreateOrderRequest.ValidateAll() if the designated constraints aren't met.

func (CreateOrderRequestMultiError) AllErrors added in v1.1.1

func (m CreateOrderRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (CreateOrderRequestMultiError) Error added in v1.1.1

Error returns a concatenation of all the error messages it wraps.

type CreateOrderRequestValidationError added in v1.1.1

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

CreateOrderRequestValidationError is the validation error returned by CreateOrderRequest.Validate if the designated constraints aren't met.

func (CreateOrderRequestValidationError) Cause added in v1.1.1

Cause function returns cause value.

func (CreateOrderRequestValidationError) Error added in v1.1.1

Error satisfies the builtin error interface

func (CreateOrderRequestValidationError) ErrorName added in v1.1.1

ErrorName returns error name.

func (CreateOrderRequestValidationError) Field added in v1.1.1

Field function returns field value.

func (CreateOrderRequestValidationError) Key added in v1.1.1

Key function returns key value.

func (CreateOrderRequestValidationError) Reason added in v1.1.1

Reason function returns reason value.

type CreateOrderResponse

type CreateOrderResponse struct {
	Order *Order `protobuf:"bytes,1,opt,name=order,proto3" json:"order,omitempty"`
	// contains filtered or unexported fields
}

Response for creating an order.

func (*CreateOrderResponse) Descriptor deprecated

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

Deprecated: Use CreateOrderResponse.ProtoReflect.Descriptor instead.

func (*CreateOrderResponse) GetOrder

func (x *CreateOrderResponse) GetOrder() *Order

func (*CreateOrderResponse) ProtoMessage

func (*CreateOrderResponse) ProtoMessage()

func (*CreateOrderResponse) ProtoReflect

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

func (*CreateOrderResponse) Reset

func (x *CreateOrderResponse) Reset()

func (*CreateOrderResponse) String

func (x *CreateOrderResponse) String() string

func (*CreateOrderResponse) Validate added in v1.1.1

func (m *CreateOrderResponse) Validate() error

Validate checks the field values on CreateOrderResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*CreateOrderResponse) ValidateAll added in v1.1.1

func (m *CreateOrderResponse) ValidateAll() error

ValidateAll checks the field values on CreateOrderResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in CreateOrderResponseMultiError, or nil if none found.

type CreateOrderResponseMultiError added in v1.1.1

type CreateOrderResponseMultiError []error

CreateOrderResponseMultiError is an error wrapping multiple validation errors returned by CreateOrderResponse.ValidateAll() if the designated constraints aren't met.

func (CreateOrderResponseMultiError) AllErrors added in v1.1.1

func (m CreateOrderResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (CreateOrderResponseMultiError) Error added in v1.1.1

Error returns a concatenation of all the error messages it wraps.

type CreateOrderResponseValidationError added in v1.1.1

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

CreateOrderResponseValidationError is the validation error returned by CreateOrderResponse.Validate if the designated constraints aren't met.

func (CreateOrderResponseValidationError) Cause added in v1.1.1

Cause function returns cause value.

func (CreateOrderResponseValidationError) Error added in v1.1.1

Error satisfies the builtin error interface

func (CreateOrderResponseValidationError) ErrorName added in v1.1.1

ErrorName returns error name.

func (CreateOrderResponseValidationError) Field added in v1.1.1

Field function returns field value.

func (CreateOrderResponseValidationError) Key added in v1.1.1

Key function returns key value.

func (CreateOrderResponseValidationError) Reason added in v1.1.1

Reason function returns reason value.

type GetOrderRequest

type GetOrderRequest struct {
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

Request to get a specific order.

func (*GetOrderRequest) Descriptor deprecated

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

Deprecated: Use GetOrderRequest.ProtoReflect.Descriptor instead.

func (*GetOrderRequest) GetId

func (x *GetOrderRequest) GetId() string

func (*GetOrderRequest) ProtoMessage

func (*GetOrderRequest) ProtoMessage()

func (*GetOrderRequest) ProtoReflect

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

func (*GetOrderRequest) Reset

func (x *GetOrderRequest) Reset()

func (*GetOrderRequest) String

func (x *GetOrderRequest) String() string

func (*GetOrderRequest) Validate added in v1.1.1

func (m *GetOrderRequest) Validate() error

Validate checks the field values on GetOrderRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*GetOrderRequest) ValidateAll added in v1.1.1

func (m *GetOrderRequest) ValidateAll() error

ValidateAll checks the field values on GetOrderRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in GetOrderRequestMultiError, or nil if none found.

type GetOrderRequestMultiError added in v1.1.1

type GetOrderRequestMultiError []error

GetOrderRequestMultiError is an error wrapping multiple validation errors returned by GetOrderRequest.ValidateAll() if the designated constraints aren't met.

func (GetOrderRequestMultiError) AllErrors added in v1.1.1

func (m GetOrderRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (GetOrderRequestMultiError) Error added in v1.1.1

Error returns a concatenation of all the error messages it wraps.

type GetOrderRequestValidationError added in v1.1.1

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

GetOrderRequestValidationError is the validation error returned by GetOrderRequest.Validate if the designated constraints aren't met.

func (GetOrderRequestValidationError) Cause added in v1.1.1

Cause function returns cause value.

func (GetOrderRequestValidationError) Error added in v1.1.1

Error satisfies the builtin error interface

func (GetOrderRequestValidationError) ErrorName added in v1.1.1

func (e GetOrderRequestValidationError) ErrorName() string

ErrorName returns error name.

func (GetOrderRequestValidationError) Field added in v1.1.1

Field function returns field value.

func (GetOrderRequestValidationError) Key added in v1.1.1

Key function returns key value.

func (GetOrderRequestValidationError) Reason added in v1.1.1

Reason function returns reason value.

type GetOrderResponse

type GetOrderResponse struct {
	Order *Order `protobuf:"bytes,1,opt,name=order,proto3" json:"order,omitempty"`
	// contains filtered or unexported fields
}

Response for getting a specific order.

func (*GetOrderResponse) Descriptor deprecated

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

Deprecated: Use GetOrderResponse.ProtoReflect.Descriptor instead.

func (*GetOrderResponse) GetOrder

func (x *GetOrderResponse) GetOrder() *Order

func (*GetOrderResponse) ProtoMessage

func (*GetOrderResponse) ProtoMessage()

func (*GetOrderResponse) ProtoReflect

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

func (*GetOrderResponse) Reset

func (x *GetOrderResponse) Reset()

func (*GetOrderResponse) String

func (x *GetOrderResponse) String() string

func (*GetOrderResponse) Validate added in v1.1.1

func (m *GetOrderResponse) Validate() error

Validate checks the field values on GetOrderResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*GetOrderResponse) ValidateAll added in v1.1.1

func (m *GetOrderResponse) ValidateAll() error

ValidateAll checks the field values on GetOrderResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in GetOrderResponseMultiError, or nil if none found.

type GetOrderResponseMultiError added in v1.1.1

type GetOrderResponseMultiError []error

GetOrderResponseMultiError is an error wrapping multiple validation errors returned by GetOrderResponse.ValidateAll() if the designated constraints aren't met.

func (GetOrderResponseMultiError) AllErrors added in v1.1.1

func (m GetOrderResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (GetOrderResponseMultiError) Error added in v1.1.1

Error returns a concatenation of all the error messages it wraps.

type GetOrderResponseValidationError added in v1.1.1

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

GetOrderResponseValidationError is the validation error returned by GetOrderResponse.Validate if the designated constraints aren't met.

func (GetOrderResponseValidationError) Cause added in v1.1.1

Cause function returns cause value.

func (GetOrderResponseValidationError) Error added in v1.1.1

Error satisfies the builtin error interface

func (GetOrderResponseValidationError) ErrorName added in v1.1.1

ErrorName returns error name.

func (GetOrderResponseValidationError) Field added in v1.1.1

Field function returns field value.

func (GetOrderResponseValidationError) Key added in v1.1.1

Key function returns key value.

func (GetOrderResponseValidationError) Reason added in v1.1.1

Reason function returns reason value.

type ListOrdersRequest

type ListOrdersRequest struct {
	UserId    string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	PageSize  int32  `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
	PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
	// contains filtered or unexported fields
}

Request to list a user's orders.

func (*ListOrdersRequest) Descriptor deprecated

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

Deprecated: Use ListOrdersRequest.ProtoReflect.Descriptor instead.

func (*ListOrdersRequest) GetPageSize

func (x *ListOrdersRequest) GetPageSize() int32

func (*ListOrdersRequest) GetPageToken

func (x *ListOrdersRequest) GetPageToken() string

func (*ListOrdersRequest) GetUserId

func (x *ListOrdersRequest) GetUserId() string

func (*ListOrdersRequest) ProtoMessage

func (*ListOrdersRequest) ProtoMessage()

func (*ListOrdersRequest) ProtoReflect

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

func (*ListOrdersRequest) Reset

func (x *ListOrdersRequest) Reset()

func (*ListOrdersRequest) String

func (x *ListOrdersRequest) String() string

func (*ListOrdersRequest) Validate added in v1.1.1

func (m *ListOrdersRequest) Validate() error

Validate checks the field values on ListOrdersRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*ListOrdersRequest) ValidateAll added in v1.1.1

func (m *ListOrdersRequest) ValidateAll() error

ValidateAll checks the field values on ListOrdersRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ListOrdersRequestMultiError, or nil if none found.

type ListOrdersRequestMultiError added in v1.1.1

type ListOrdersRequestMultiError []error

ListOrdersRequestMultiError is an error wrapping multiple validation errors returned by ListOrdersRequest.ValidateAll() if the designated constraints aren't met.

func (ListOrdersRequestMultiError) AllErrors added in v1.1.1

func (m ListOrdersRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ListOrdersRequestMultiError) Error added in v1.1.1

Error returns a concatenation of all the error messages it wraps.

type ListOrdersRequestValidationError added in v1.1.1

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

ListOrdersRequestValidationError is the validation error returned by ListOrdersRequest.Validate if the designated constraints aren't met.

func (ListOrdersRequestValidationError) Cause added in v1.1.1

Cause function returns cause value.

func (ListOrdersRequestValidationError) Error added in v1.1.1

Error satisfies the builtin error interface

func (ListOrdersRequestValidationError) ErrorName added in v1.1.1

ErrorName returns error name.

func (ListOrdersRequestValidationError) Field added in v1.1.1

Field function returns field value.

func (ListOrdersRequestValidationError) Key added in v1.1.1

Key function returns key value.

func (ListOrdersRequestValidationError) Reason added in v1.1.1

Reason function returns reason value.

type ListOrdersResponse

type ListOrdersResponse struct {
	Orders        []*Order `protobuf:"bytes,1,rep,name=orders,proto3" json:"orders,omitempty"`
	NextPageToken string   `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
	// contains filtered or unexported fields
}

Response for listing orders.

func (*ListOrdersResponse) Descriptor deprecated

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

Deprecated: Use ListOrdersResponse.ProtoReflect.Descriptor instead.

func (*ListOrdersResponse) GetNextPageToken

func (x *ListOrdersResponse) GetNextPageToken() string

func (*ListOrdersResponse) GetOrders

func (x *ListOrdersResponse) GetOrders() []*Order

func (*ListOrdersResponse) ProtoMessage

func (*ListOrdersResponse) ProtoMessage()

func (*ListOrdersResponse) ProtoReflect

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

func (*ListOrdersResponse) Reset

func (x *ListOrdersResponse) Reset()

func (*ListOrdersResponse) String

func (x *ListOrdersResponse) String() string

func (*ListOrdersResponse) Validate added in v1.1.1

func (m *ListOrdersResponse) Validate() error

Validate checks the field values on ListOrdersResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*ListOrdersResponse) ValidateAll added in v1.1.1

func (m *ListOrdersResponse) ValidateAll() error

ValidateAll checks the field values on ListOrdersResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ListOrdersResponseMultiError, or nil if none found.

type ListOrdersResponseMultiError added in v1.1.1

type ListOrdersResponseMultiError []error

ListOrdersResponseMultiError is an error wrapping multiple validation errors returned by ListOrdersResponse.ValidateAll() if the designated constraints aren't met.

func (ListOrdersResponseMultiError) AllErrors added in v1.1.1

func (m ListOrdersResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ListOrdersResponseMultiError) Error added in v1.1.1

Error returns a concatenation of all the error messages it wraps.

type ListOrdersResponseValidationError added in v1.1.1

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

ListOrdersResponseValidationError is the validation error returned by ListOrdersResponse.Validate if the designated constraints aren't met.

func (ListOrdersResponseValidationError) Cause added in v1.1.1

Cause function returns cause value.

func (ListOrdersResponseValidationError) Error added in v1.1.1

Error satisfies the builtin error interface

func (ListOrdersResponseValidationError) ErrorName added in v1.1.1

ErrorName returns error name.

func (ListOrdersResponseValidationError) Field added in v1.1.1

Field function returns field value.

func (ListOrdersResponseValidationError) Key added in v1.1.1

Key function returns key value.

func (ListOrdersResponseValidationError) Reason added in v1.1.1

Reason function returns reason value.

type Order

type Order struct {
	Id              string           `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	UserId          string           `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	Items           []*OrderItem     `protobuf:"bytes,3,rep,name=items,proto3" json:"items,omitempty"`
	TotalAmount     float64          `protobuf:"fixed64,4,opt,name=total_amount,json=totalAmount,proto3" json:"total_amount,omitempty"`
	Status          OrderStatus      `protobuf:"varint,5,opt,name=status,proto3,enum=order.v1.OrderStatus" json:"status,omitempty"`
	ShippingAddress *ShippingAddress `protobuf:"bytes,6,opt,name=shipping_address,json=shippingAddress,proto3" json:"shipping_address,omitempty"`
	CreatedAt       string           `protobuf:"bytes,7,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	UpdatedAt       string           `protobuf:"bytes,8,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
	// contains filtered or unexported fields
}

The Order message represents a completed checkout.

func (*Order) Descriptor deprecated

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

Deprecated: Use Order.ProtoReflect.Descriptor instead.

func (*Order) GetCreatedAt

func (x *Order) GetCreatedAt() string

func (*Order) GetId

func (x *Order) GetId() string

func (*Order) GetItems

func (x *Order) GetItems() []*OrderItem

func (*Order) GetShippingAddress

func (x *Order) GetShippingAddress() *ShippingAddress

func (*Order) GetStatus

func (x *Order) GetStatus() OrderStatus

func (*Order) GetTotalAmount

func (x *Order) GetTotalAmount() float64

func (*Order) GetUpdatedAt

func (x *Order) GetUpdatedAt() string

func (*Order) GetUserId

func (x *Order) GetUserId() string

func (*Order) ProtoMessage

func (*Order) ProtoMessage()

func (*Order) ProtoReflect

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

func (*Order) Reset

func (x *Order) Reset()

func (*Order) String

func (x *Order) String() string

func (*Order) Validate added in v1.1.1

func (m *Order) Validate() error

Validate checks the field values on Order with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*Order) ValidateAll added in v1.1.1

func (m *Order) ValidateAll() error

ValidateAll checks the field values on Order with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in OrderMultiError, or nil if none found.

type OrderItem

type OrderItem struct {
	ProductId string  `protobuf:"bytes,1,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"`
	Quantity  int32   `protobuf:"varint,2,opt,name=quantity,proto3" json:"quantity,omitempty"`
	UnitPrice float64 `protobuf:"fixed64,3,opt,name=unit_price,json=unitPrice,proto3" json:"unit_price,omitempty"`
	// contains filtered or unexported fields
}

OrderItem represents a finalized line-item from a product purchase.

func (*OrderItem) Descriptor deprecated

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

Deprecated: Use OrderItem.ProtoReflect.Descriptor instead.

func (*OrderItem) GetProductId

func (x *OrderItem) GetProductId() string

func (*OrderItem) GetQuantity

func (x *OrderItem) GetQuantity() int32

func (*OrderItem) GetUnitPrice

func (x *OrderItem) GetUnitPrice() float64

func (*OrderItem) ProtoMessage

func (*OrderItem) ProtoMessage()

func (*OrderItem) ProtoReflect

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

func (*OrderItem) Reset

func (x *OrderItem) Reset()

func (*OrderItem) String

func (x *OrderItem) String() string

func (*OrderItem) Validate added in v1.1.1

func (m *OrderItem) Validate() error

Validate checks the field values on OrderItem with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*OrderItem) ValidateAll added in v1.1.1

func (m *OrderItem) ValidateAll() error

ValidateAll checks the field values on OrderItem with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in OrderItemMultiError, or nil if none found.

type OrderItemMultiError added in v1.1.1

type OrderItemMultiError []error

OrderItemMultiError is an error wrapping multiple validation errors returned by OrderItem.ValidateAll() if the designated constraints aren't met.

func (OrderItemMultiError) AllErrors added in v1.1.1

func (m OrderItemMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (OrderItemMultiError) Error added in v1.1.1

func (m OrderItemMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type OrderItemValidationError added in v1.1.1

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

OrderItemValidationError is the validation error returned by OrderItem.Validate if the designated constraints aren't met.

func (OrderItemValidationError) Cause added in v1.1.1

func (e OrderItemValidationError) Cause() error

Cause function returns cause value.

func (OrderItemValidationError) Error added in v1.1.1

func (e OrderItemValidationError) Error() string

Error satisfies the builtin error interface

func (OrderItemValidationError) ErrorName added in v1.1.1

func (e OrderItemValidationError) ErrorName() string

ErrorName returns error name.

func (OrderItemValidationError) Field added in v1.1.1

func (e OrderItemValidationError) Field() string

Field function returns field value.

func (OrderItemValidationError) Key added in v1.1.1

Key function returns key value.

func (OrderItemValidationError) Reason added in v1.1.1

func (e OrderItemValidationError) Reason() string

Reason function returns reason value.

type OrderMultiError added in v1.1.1

type OrderMultiError []error

OrderMultiError is an error wrapping multiple validation errors returned by Order.ValidateAll() if the designated constraints aren't met.

func (OrderMultiError) AllErrors added in v1.1.1

func (m OrderMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (OrderMultiError) Error added in v1.1.1

func (m OrderMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type OrderServiceClient

type OrderServiceClient interface {
	CreateOrder(ctx context.Context, in *CreateOrderRequest, opts ...grpc.CallOption) (*CreateOrderResponse, error)
	GetOrder(ctx context.Context, in *GetOrderRequest, opts ...grpc.CallOption) (*GetOrderResponse, error)
	ListOrders(ctx context.Context, in *ListOrdersRequest, opts ...grpc.CallOption) (*ListOrdersResponse, error)
	UpdateOrderStatus(ctx context.Context, in *UpdateOrderStatusRequest, opts ...grpc.CallOption) (*UpdateOrderStatusResponse, error)
}

OrderServiceClient is the client API for OrderService 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.

OrderService provides checkout and order management operations.

type OrderServiceServer

type OrderServiceServer interface {
	CreateOrder(context.Context, *CreateOrderRequest) (*CreateOrderResponse, error)
	GetOrder(context.Context, *GetOrderRequest) (*GetOrderResponse, error)
	ListOrders(context.Context, *ListOrdersRequest) (*ListOrdersResponse, error)
	UpdateOrderStatus(context.Context, *UpdateOrderStatusRequest) (*UpdateOrderStatusResponse, error)
	// contains filtered or unexported methods
}

OrderServiceServer is the server API for OrderService service. All implementations must embed UnimplementedOrderServiceServer for forward compatibility.

OrderService provides checkout and order management operations.

type OrderStatus

type OrderStatus int32

Status of the order throughout its lifecycle.

const (
	OrderStatus_ORDER_STATUS_UNSPECIFIED OrderStatus = 0
	OrderStatus_ORDER_STATUS_PENDING     OrderStatus = 1
	OrderStatus_ORDER_STATUS_PAID        OrderStatus = 2
	OrderStatus_ORDER_STATUS_SHIPPED     OrderStatus = 3
	OrderStatus_ORDER_STATUS_DELIVERED   OrderStatus = 4
	OrderStatus_ORDER_STATUS_CANCELLED   OrderStatus = 5
)

func (OrderStatus) Descriptor

func (OrderStatus) Enum

func (x OrderStatus) Enum() *OrderStatus

func (OrderStatus) EnumDescriptor deprecated

func (OrderStatus) EnumDescriptor() ([]byte, []int)

Deprecated: Use OrderStatus.Descriptor instead.

func (OrderStatus) Number

func (x OrderStatus) Number() protoreflect.EnumNumber

func (OrderStatus) String

func (x OrderStatus) String() string

func (OrderStatus) Type

type OrderValidationError added in v1.1.1

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

OrderValidationError is the validation error returned by Order.Validate if the designated constraints aren't met.

func (OrderValidationError) Cause added in v1.1.1

func (e OrderValidationError) Cause() error

Cause function returns cause value.

func (OrderValidationError) Error added in v1.1.1

func (e OrderValidationError) Error() string

Error satisfies the builtin error interface

func (OrderValidationError) ErrorName added in v1.1.1

func (e OrderValidationError) ErrorName() string

ErrorName returns error name.

func (OrderValidationError) Field added in v1.1.1

func (e OrderValidationError) Field() string

Field function returns field value.

func (OrderValidationError) Key added in v1.1.1

func (e OrderValidationError) Key() bool

Key function returns key value.

func (OrderValidationError) Reason added in v1.1.1

func (e OrderValidationError) Reason() string

Reason function returns reason value.

type ShippingAddress

type ShippingAddress struct {
	Street  string `protobuf:"bytes,1,opt,name=street,proto3" json:"street,omitempty"`
	City    string `protobuf:"bytes,2,opt,name=city,proto3" json:"city,omitempty"`
	State   string `protobuf:"bytes,3,opt,name=state,proto3" json:"state,omitempty"`
	Zip     string `protobuf:"bytes,4,opt,name=zip,proto3" json:"zip,omitempty"`
	Country string `protobuf:"bytes,5,opt,name=country,proto3" json:"country,omitempty"`
	// contains filtered or unexported fields
}

ShippingAddress is a denormalized snapshot of where the order is going.

func (*ShippingAddress) Descriptor deprecated

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

Deprecated: Use ShippingAddress.ProtoReflect.Descriptor instead.

func (*ShippingAddress) GetCity

func (x *ShippingAddress) GetCity() string

func (*ShippingAddress) GetCountry

func (x *ShippingAddress) GetCountry() string

func (*ShippingAddress) GetState

func (x *ShippingAddress) GetState() string

func (*ShippingAddress) GetStreet

func (x *ShippingAddress) GetStreet() string

func (*ShippingAddress) GetZip

func (x *ShippingAddress) GetZip() string

func (*ShippingAddress) ProtoMessage

func (*ShippingAddress) ProtoMessage()

func (*ShippingAddress) ProtoReflect

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

func (*ShippingAddress) Reset

func (x *ShippingAddress) Reset()

func (*ShippingAddress) String

func (x *ShippingAddress) String() string

func (*ShippingAddress) Validate added in v1.1.1

func (m *ShippingAddress) Validate() error

Validate checks the field values on ShippingAddress with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*ShippingAddress) ValidateAll added in v1.1.1

func (m *ShippingAddress) ValidateAll() error

ValidateAll checks the field values on ShippingAddress with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ShippingAddressMultiError, or nil if none found.

type ShippingAddressMultiError added in v1.1.1

type ShippingAddressMultiError []error

ShippingAddressMultiError is an error wrapping multiple validation errors returned by ShippingAddress.ValidateAll() if the designated constraints aren't met.

func (ShippingAddressMultiError) AllErrors added in v1.1.1

func (m ShippingAddressMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ShippingAddressMultiError) Error added in v1.1.1

Error returns a concatenation of all the error messages it wraps.

type ShippingAddressValidationError added in v1.1.1

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

ShippingAddressValidationError is the validation error returned by ShippingAddress.Validate if the designated constraints aren't met.

func (ShippingAddressValidationError) Cause added in v1.1.1

Cause function returns cause value.

func (ShippingAddressValidationError) Error added in v1.1.1

Error satisfies the builtin error interface

func (ShippingAddressValidationError) ErrorName added in v1.1.1

func (e ShippingAddressValidationError) ErrorName() string

ErrorName returns error name.

func (ShippingAddressValidationError) Field added in v1.1.1

Field function returns field value.

func (ShippingAddressValidationError) Key added in v1.1.1

Key function returns key value.

func (ShippingAddressValidationError) Reason added in v1.1.1

Reason function returns reason value.

type UnimplementedOrderServiceServer

type UnimplementedOrderServiceServer struct{}

UnimplementedOrderServiceServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedOrderServiceServer) CreateOrder

func (UnimplementedOrderServiceServer) GetOrder

func (UnimplementedOrderServiceServer) ListOrders

func (UnimplementedOrderServiceServer) UpdateOrderStatus

type UnsafeOrderServiceServer

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

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

type UpdateOrderStatusRequest

type UpdateOrderStatusRequest struct {
	Id     string      `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Status OrderStatus `protobuf:"varint,2,opt,name=status,proto3,enum=order.v1.OrderStatus" json:"status,omitempty"`
	// contains filtered or unexported fields
}

Request to update the status of an order.

func (*UpdateOrderStatusRequest) Descriptor deprecated

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

Deprecated: Use UpdateOrderStatusRequest.ProtoReflect.Descriptor instead.

func (*UpdateOrderStatusRequest) GetId

func (x *UpdateOrderStatusRequest) GetId() string

func (*UpdateOrderStatusRequest) GetStatus

func (x *UpdateOrderStatusRequest) GetStatus() OrderStatus

func (*UpdateOrderStatusRequest) ProtoMessage

func (*UpdateOrderStatusRequest) ProtoMessage()

func (*UpdateOrderStatusRequest) ProtoReflect

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

func (*UpdateOrderStatusRequest) Reset

func (x *UpdateOrderStatusRequest) Reset()

func (*UpdateOrderStatusRequest) String

func (x *UpdateOrderStatusRequest) String() string

func (*UpdateOrderStatusRequest) Validate added in v1.1.1

func (m *UpdateOrderStatusRequest) Validate() error

Validate checks the field values on UpdateOrderStatusRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*UpdateOrderStatusRequest) ValidateAll added in v1.1.1

func (m *UpdateOrderStatusRequest) ValidateAll() error

ValidateAll checks the field values on UpdateOrderStatusRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in UpdateOrderStatusRequestMultiError, or nil if none found.

type UpdateOrderStatusRequestMultiError added in v1.1.1

type UpdateOrderStatusRequestMultiError []error

UpdateOrderStatusRequestMultiError is an error wrapping multiple validation errors returned by UpdateOrderStatusRequest.ValidateAll() if the designated constraints aren't met.

func (UpdateOrderStatusRequestMultiError) AllErrors added in v1.1.1

func (m UpdateOrderStatusRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (UpdateOrderStatusRequestMultiError) Error added in v1.1.1

Error returns a concatenation of all the error messages it wraps.

type UpdateOrderStatusRequestValidationError added in v1.1.1

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

UpdateOrderStatusRequestValidationError is the validation error returned by UpdateOrderStatusRequest.Validate if the designated constraints aren't met.

func (UpdateOrderStatusRequestValidationError) Cause added in v1.1.1

Cause function returns cause value.

func (UpdateOrderStatusRequestValidationError) Error added in v1.1.1

Error satisfies the builtin error interface

func (UpdateOrderStatusRequestValidationError) ErrorName added in v1.1.1

ErrorName returns error name.

func (UpdateOrderStatusRequestValidationError) Field added in v1.1.1

Field function returns field value.

func (UpdateOrderStatusRequestValidationError) Key added in v1.1.1

Key function returns key value.

func (UpdateOrderStatusRequestValidationError) Reason added in v1.1.1

Reason function returns reason value.

type UpdateOrderStatusResponse

type UpdateOrderStatusResponse struct {
	Order *Order `protobuf:"bytes,1,opt,name=order,proto3" json:"order,omitempty"`
	// contains filtered or unexported fields
}

Response for updating the status of an order.

func (*UpdateOrderStatusResponse) Descriptor deprecated

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

Deprecated: Use UpdateOrderStatusResponse.ProtoReflect.Descriptor instead.

func (*UpdateOrderStatusResponse) GetOrder

func (x *UpdateOrderStatusResponse) GetOrder() *Order

func (*UpdateOrderStatusResponse) ProtoMessage

func (*UpdateOrderStatusResponse) ProtoMessage()

func (*UpdateOrderStatusResponse) ProtoReflect

func (*UpdateOrderStatusResponse) Reset

func (x *UpdateOrderStatusResponse) Reset()

func (*UpdateOrderStatusResponse) String

func (x *UpdateOrderStatusResponse) String() string

func (*UpdateOrderStatusResponse) Validate added in v1.1.1

func (m *UpdateOrderStatusResponse) Validate() error

Validate checks the field values on UpdateOrderStatusResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*UpdateOrderStatusResponse) ValidateAll added in v1.1.1

func (m *UpdateOrderStatusResponse) ValidateAll() error

ValidateAll checks the field values on UpdateOrderStatusResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in UpdateOrderStatusResponseMultiError, or nil if none found.

type UpdateOrderStatusResponseMultiError added in v1.1.1

type UpdateOrderStatusResponseMultiError []error

UpdateOrderStatusResponseMultiError is an error wrapping multiple validation errors returned by UpdateOrderStatusResponse.ValidateAll() if the designated constraints aren't met.

func (UpdateOrderStatusResponseMultiError) AllErrors added in v1.1.1

AllErrors returns a list of validation violation errors.

func (UpdateOrderStatusResponseMultiError) Error added in v1.1.1

Error returns a concatenation of all the error messages it wraps.

type UpdateOrderStatusResponseValidationError added in v1.1.1

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

UpdateOrderStatusResponseValidationError is the validation error returned by UpdateOrderStatusResponse.Validate if the designated constraints aren't met.

func (UpdateOrderStatusResponseValidationError) Cause added in v1.1.1

Cause function returns cause value.

func (UpdateOrderStatusResponseValidationError) Error added in v1.1.1

Error satisfies the builtin error interface

func (UpdateOrderStatusResponseValidationError) ErrorName added in v1.1.1

ErrorName returns error name.

func (UpdateOrderStatusResponseValidationError) Field added in v1.1.1

Field function returns field value.

func (UpdateOrderStatusResponseValidationError) Key added in v1.1.1

Key function returns key value.

func (UpdateOrderStatusResponseValidationError) Reason added in v1.1.1

Reason function returns reason value.

Jump to

Keyboard shortcuts

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