pb

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OrderService_CreateOrder_FullMethodName = "/idem.OrderService/CreateOrder"
)

Variables

View Source
var File_examples_idem_proto_idempotency_proto protoreflect.FileDescriptor
View Source
var OrderService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "idem.OrderService",
	HandlerType: (*OrderServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateOrder",
			Handler:    _OrderService_CreateOrder_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "examples/idem/proto/idempotency.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 {
	IdempotencyKey string  `protobuf:"bytes,1,opt,name=idempotency_key,json=idempotencyKey,proto3" json:"idempotency_key,omitempty"` // 幂等性键
	OrderId        string  `protobuf:"bytes,2,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"`
	CustomerId     string  `protobuf:"bytes,3,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"`
	Amount         float64 `protobuf:"fixed64,4,opt,name=amount,proto3" json:"amount,omitempty"`
	Description    string  `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"`
	// contains filtered or unexported fields
}

CreateOrderRequest 创建订单请求

func (*CreateOrderRequest) Descriptor deprecated

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

Deprecated: Use CreateOrderRequest.ProtoReflect.Descriptor instead.

func (*CreateOrderRequest) GetAmount

func (x *CreateOrderRequest) GetAmount() float64

func (*CreateOrderRequest) GetCustomerId

func (x *CreateOrderRequest) GetCustomerId() string

func (*CreateOrderRequest) GetDescription

func (x *CreateOrderRequest) GetDescription() string

func (*CreateOrderRequest) GetIdempotencyKey

func (x *CreateOrderRequest) GetIdempotencyKey() string

func (*CreateOrderRequest) GetOrderId

func (x *CreateOrderRequest) GetOrderId() 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

type CreateOrderResponse

type CreateOrderResponse struct {
	OrderId   string  `protobuf:"bytes,1,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"`
	Status    string  `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"`
	Amount    float64 `protobuf:"fixed64,3,opt,name=amount,proto3" json:"amount,omitempty"`
	Timestamp int64   `protobuf:"varint,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	// contains filtered or unexported fields
}

CreateOrderResponse 创建订单响应

func (*CreateOrderResponse) Descriptor deprecated

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

Deprecated: Use CreateOrderResponse.ProtoReflect.Descriptor instead.

func (*CreateOrderResponse) GetAmount

func (x *CreateOrderResponse) GetAmount() float64

func (*CreateOrderResponse) GetOrderId

func (x *CreateOrderResponse) GetOrderId() string

func (*CreateOrderResponse) GetStatus

func (x *CreateOrderResponse) GetStatus() string

func (*CreateOrderResponse) GetTimestamp

func (x *CreateOrderResponse) GetTimestamp() int64

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

type OrderServiceClient

type OrderServiceClient interface {
	// CreateOrder 创建订单(一元调用)
	CreateOrder(ctx context.Context, in *CreateOrderRequest, opts ...grpc.CallOption) (*CreateOrderResponse, 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 订单服务定义

type OrderServiceServer

type OrderServiceServer interface {
	// CreateOrder 创建订单(一元调用)
	CreateOrder(context.Context, *CreateOrderRequest) (*CreateOrderResponse, error)
	// contains filtered or unexported methods
}

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

OrderService 订单服务定义

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

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