api

package
v0.0.0-...-ece3cc1 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: GPL-3.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_api_micro_proto protoreflect.FileDescriptor
View Source
var OrderService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "api.OrderService",
	HandlerType: (*OrderServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateOrder",
			Handler:    _OrderService_CreateOrder_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "api/micro.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 RegisterOrderServiceServer

func RegisterOrderServiceServer(s grpc.ServiceRegistrar, srv OrderServiceServer)

Types

type CreateOrderRequest

type CreateOrderRequest struct {
	CustomerId    string          `protobuf:"bytes,1,opt,name=customerId,proto3" json:"customerId,omitempty"`
	OrderProducts []*OrderProduct `protobuf:"bytes,2,rep,name=orderProducts,proto3" json:"orderProducts,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateOrderRequest) Descriptor deprecated

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

Deprecated: Use CreateOrderRequest.ProtoReflect.Descriptor instead.

func (*CreateOrderRequest) GetCustomerId

func (x *CreateOrderRequest) GetCustomerId() string

func (*CreateOrderRequest) GetOrderProducts

func (x *CreateOrderRequest) GetOrderProducts() []*OrderProduct

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

type Order

type Order struct {
	Id         string     `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	CustomerId string     `protobuf:"bytes,2,opt,name=customerId,proto3" json:"customerId,omitempty"`
	Status     string     `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"`
	Products   []*Product `protobuf:"bytes,4,rep,name=products,proto3" json:"products,omitempty"`
	// contains filtered or unexported fields
}

func (*Order) Descriptor deprecated

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

Deprecated: Use Order.ProtoReflect.Descriptor instead.

func (*Order) GetCustomerId

func (x *Order) GetCustomerId() string

func (*Order) GetId

func (x *Order) GetId() string

func (*Order) GetProducts

func (x *Order) GetProducts() []*Product

func (*Order) GetStatus

func (x *Order) GetStatus() 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

type OrderProduct

type OrderProduct struct {
	ProductId string `protobuf:"bytes,1,opt,name=productId,proto3" json:"productId,omitempty"`
	Quantity  int32  `protobuf:"varint,2,opt,name=quantity,proto3" json:"quantity,omitempty"`
	// contains filtered or unexported fields
}

func (*OrderProduct) Descriptor deprecated

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

Deprecated: Use OrderProduct.ProtoReflect.Descriptor instead.

func (*OrderProduct) GetProductId

func (x *OrderProduct) GetProductId() string

func (*OrderProduct) GetQuantity

func (x *OrderProduct) GetQuantity() int32

func (*OrderProduct) ProtoMessage

func (*OrderProduct) ProtoMessage()

func (*OrderProduct) ProtoReflect

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

func (*OrderProduct) Reset

func (x *OrderProduct) Reset()

func (*OrderProduct) String

func (x *OrderProduct) String() string

type OrderServiceClient

type OrderServiceClient interface {
	CreateOrder(ctx context.Context, in *CreateOrderRequest, opts ...grpc.CallOption) (*Order, 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.

type OrderServiceServer

type OrderServiceServer interface {
	CreateOrder(context.Context, *CreateOrderRequest) (*Order, error)
	// contains filtered or unexported methods
}

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

type Product

type Product struct {
	Id       string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Name     string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Quantity int32  `protobuf:"varint,3,opt,name=quantity,proto3" json:"quantity,omitempty"`
	PriceId  string `protobuf:"bytes,4,opt,name=priceId,proto3" json:"priceId,omitempty"`
	// contains filtered or unexported fields
}

func (*Product) Descriptor deprecated

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

Deprecated: Use Product.ProtoReflect.Descriptor instead.

func (*Product) GetId

func (x *Product) GetId() string

func (*Product) GetName

func (x *Product) GetName() string

func (*Product) GetPriceId

func (x *Product) GetPriceId() string

func (*Product) GetQuantity

func (x *Product) GetQuantity() int32

func (*Product) ProtoMessage

func (*Product) ProtoMessage()

func (*Product) ProtoReflect

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

func (*Product) Reset

func (x *Product) Reset()

func (*Product) String

func (x *Product) String() string

type UnimplementedOrderServiceServer

type UnimplementedOrderServiceServer struct {
}

UnimplementedOrderServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedOrderServiceServer) CreateOrder

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.

Jump to

Keyboard shortcuts

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