v1

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: MIT Imports: 33 Imported by: 0

Documentation

Overview

Package v1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	FakeServer_CreateOrder_FullMethodName = "/fakeserver.v1.FakeServer/CreateOrder"
	FakeServer_ListOrder_FullMethodName   = "/fakeserver.v1.FakeServer/ListOrder"
	FakeServer_GetOrder_FullMethodName    = "/fakeserver.v1.FakeServer/GetOrder"
	FakeServer_UpdateOrder_FullMethodName = "/fakeserver.v1.FakeServer/UpdateOrder"
	FakeServer_DeleteOrder_FullMethodName = "/fakeserver.v1.FakeServer/DeleteOrder"
)
View Source
const OperationFakeServerCreateOrder = "/fakeserver.v1.FakeServer/CreateOrder"
View Source
const OperationFakeServerDeleteOrder = "/fakeserver.v1.FakeServer/DeleteOrder"
View Source
const OperationFakeServerGetOrder = "/fakeserver.v1.FakeServer/GetOrder"
View Source
const OperationFakeServerListOrder = "/fakeserver.v1.FakeServer/ListOrder"
View Source
const OperationFakeServerUpdateOrder = "/fakeserver.v1.FakeServer/UpdateOrder"

Variables

View Source
var (
	ErrorReason_name = map[int32]string{
		0: "OrderNotFound",
		1: "OrderAlreadyExists",
		2: "OrderCreateFailed",
	}
	ErrorReason_value = map[string]int32{
		"OrderNotFound":      0,
		"OrderAlreadyExists": 1,
		"OrderCreateFailed":  2,
	}
)

Enum value maps for ErrorReason.

View Source
var FakeServer_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "fakeserver.v1.FakeServer",
	HandlerType: (*FakeServerServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateOrder",
			Handler:    _FakeServer_CreateOrder_Handler,
		},
		{
			MethodName: "ListOrder",
			Handler:    _FakeServer_ListOrder_Handler,
		},
		{
			MethodName: "GetOrder",
			Handler:    _FakeServer_GetOrder_Handler,
		},
		{
			MethodName: "UpdateOrder",
			Handler:    _FakeServer_UpdateOrder_Handler,
		},
		{
			MethodName: "DeleteOrder",
			Handler:    _FakeServer_DeleteOrder_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "fakeserver/v1/fakeserver.proto",
}

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

View Source
var File_fakeserver_v1_errors_proto protoreflect.FileDescriptor
View Source
var File_fakeserver_v1_fakeserver_proto protoreflect.FileDescriptor

Functions

func ErrorOrderAlreadyExists

func ErrorOrderAlreadyExists(format string, args ...interface{}) *errors.Error

订单已存在,无法创建用户

func ErrorOrderCreateFailed

func ErrorOrderCreateFailed(format string, args ...interface{}) *errors.Error

创建订单失败,可能是由于服务器或其他问题导致的创建过程中的错误

func ErrorOrderNotFound

func ErrorOrderNotFound(format string, args ...interface{}) *errors.Error

订单找不到 ,可能是订单不存在或输入的订单标识有误

func IsOrderAlreadyExists

func IsOrderAlreadyExists(err error) bool

订单已存在,无法创建用户

func IsOrderCreateFailed

func IsOrderCreateFailed(err error) bool

创建订单失败,可能是由于服务器或其他问题导致的创建过程中的错误

func IsOrderNotFound

func IsOrderNotFound(err error) bool

订单找不到 ,可能是订单不存在或输入的订单标识有误

func RegisterFakeServerHTTPServer

func RegisterFakeServerHTTPServer(s *http.Server, srv FakeServerHTTPServer)

func RegisterFakeServerHandler

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

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

func RegisterFakeServerHandlerClient

func RegisterFakeServerHandlerClient(ctx context.Context, mux *runtime.ServeMux, client FakeServerClient) error

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

func RegisterFakeServerHandlerFromEndpoint

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

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

func RegisterFakeServerHandlerServer

func RegisterFakeServerHandlerServer(ctx context.Context, mux *runtime.ServeMux, server FakeServerServer) error

RegisterFakeServerHandlerServer registers the http handlers for service FakeServer to "mux". UnaryRPC :call FakeServerServer 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 RegisterFakeServerHandlerFromEndpoint instead.

func RegisterFakeServerServer

func RegisterFakeServerServer(s grpc.ServiceRegistrar, srv FakeServerServer)

Types

type CreateOrderRequest

type CreateOrderRequest struct {
	Customer string `protobuf:"bytes,1,opt,name=customer,proto3" json:"customer,omitempty"`
	Product  string `protobuf:"bytes,2,opt,name=product,proto3" json:"product,omitempty"`
	Quantity int64  `protobuf:"varint,3,opt,name=quantity,proto3" json:"quantity,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateOrderRequest) Descriptor deprecated

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

Deprecated: Use CreateOrderRequest.ProtoReflect.Descriptor instead.

func (*CreateOrderRequest) GetCustomer

func (x *CreateOrderRequest) GetCustomer() string

func (*CreateOrderRequest) GetProduct

func (x *CreateOrderRequest) GetProduct() string

func (*CreateOrderRequest) GetQuantity

func (x *CreateOrderRequest) GetQuantity() int64

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

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

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

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

func (m CreateOrderRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (CreateOrderRequestMultiError) Error

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

type CreateOrderRequestValidationError

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

Cause function returns cause value.

func (CreateOrderRequestValidationError) Error

Error satisfies the builtin error interface

func (CreateOrderRequestValidationError) ErrorName

ErrorName returns error name.

func (CreateOrderRequestValidationError) Field

Field function returns field value.

func (CreateOrderRequestValidationError) Key

Key function returns key value.

func (CreateOrderRequestValidationError) Reason

Reason function returns reason value.

type CreateOrderResponse

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

func (*CreateOrderResponse) Descriptor deprecated

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

Deprecated: Use CreateOrderResponse.ProtoReflect.Descriptor instead.

func (*CreateOrderResponse) GetOrderID

func (x *CreateOrderResponse) GetOrderID() string

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

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

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

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

func (m CreateOrderResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (CreateOrderResponseMultiError) Error

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

type CreateOrderResponseValidationError

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

Cause function returns cause value.

func (CreateOrderResponseValidationError) Error

Error satisfies the builtin error interface

func (CreateOrderResponseValidationError) ErrorName

ErrorName returns error name.

func (CreateOrderResponseValidationError) Field

Field function returns field value.

func (CreateOrderResponseValidationError) Key

Key function returns key value.

func (CreateOrderResponseValidationError) Reason

Reason function returns reason value.

type DeleteOrderRequest

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

func (*DeleteOrderRequest) Descriptor deprecated

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

Deprecated: Use DeleteOrderRequest.ProtoReflect.Descriptor instead.

func (*DeleteOrderRequest) GetOrderID

func (x *DeleteOrderRequest) GetOrderID() string

func (*DeleteOrderRequest) ProtoMessage

func (*DeleteOrderRequest) ProtoMessage()

func (*DeleteOrderRequest) ProtoReflect

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

func (*DeleteOrderRequest) Reset

func (x *DeleteOrderRequest) Reset()

func (*DeleteOrderRequest) String

func (x *DeleteOrderRequest) String() string

func (*DeleteOrderRequest) Validate

func (m *DeleteOrderRequest) Validate() error

Validate checks the field values on DeleteOrderRequest 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 (*DeleteOrderRequest) ValidateAll

func (m *DeleteOrderRequest) ValidateAll() error

ValidateAll checks the field values on DeleteOrderRequest 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 DeleteOrderRequestMultiError, or nil if none found.

type DeleteOrderRequestMultiError

type DeleteOrderRequestMultiError []error

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

func (DeleteOrderRequestMultiError) AllErrors

func (m DeleteOrderRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (DeleteOrderRequestMultiError) Error

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

type DeleteOrderRequestValidationError

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

DeleteOrderRequestValidationError is the validation error returned by DeleteOrderRequest.Validate if the designated constraints aren't met.

func (DeleteOrderRequestValidationError) Cause

Cause function returns cause value.

func (DeleteOrderRequestValidationError) Error

Error satisfies the builtin error interface

func (DeleteOrderRequestValidationError) ErrorName

ErrorName returns error name.

func (DeleteOrderRequestValidationError) Field

Field function returns field value.

func (DeleteOrderRequestValidationError) Key

Key function returns key value.

func (DeleteOrderRequestValidationError) Reason

Reason function returns reason value.

type ErrorReason

type ErrorReason int32
const (
	// 订单找不到 ,可能是订单不存在或输入的订单标识有误
	ErrorReason_OrderNotFound ErrorReason = 0
	// 订单已存在,无法创建用户
	ErrorReason_OrderAlreadyExists ErrorReason = 1
	// 创建订单失败,可能是由于服务器或其他问题导致的创建过程中的错误
	ErrorReason_OrderCreateFailed ErrorReason = 2
)

func (ErrorReason) Descriptor

func (ErrorReason) Enum

func (x ErrorReason) Enum() *ErrorReason

func (ErrorReason) EnumDescriptor deprecated

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

Deprecated: Use ErrorReason.Descriptor instead.

func (ErrorReason) Number

func (x ErrorReason) Number() protoreflect.EnumNumber

func (ErrorReason) String

func (x ErrorReason) String() string

func (ErrorReason) Type

type FakeServerClient

type FakeServerClient interface {
	CreateOrder(ctx context.Context, in *CreateOrderRequest, opts ...grpc.CallOption) (*CreateOrderResponse, error)
	ListOrder(ctx context.Context, in *ListOrderRequest, opts ...grpc.CallOption) (*ListOrderResponse, error)
	GetOrder(ctx context.Context, in *GetOrderRequest, opts ...grpc.CallOption) (*OrderReply, error)
	UpdateOrder(ctx context.Context, in *UpdateOrderRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	DeleteOrder(ctx context.Context, in *DeleteOrderRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
}

FakeServerClient is the client API for FakeServer 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.

func NewFakeServerClient

func NewFakeServerClient(cc grpc.ClientConnInterface) FakeServerClient

type FakeServerHTTPClient

type FakeServerHTTPClient interface {
	CreateOrder(ctx context.Context, req *CreateOrderRequest, opts ...http.CallOption) (rsp *CreateOrderResponse, err error)
	DeleteOrder(ctx context.Context, req *DeleteOrderRequest, opts ...http.CallOption) (rsp *emptypb.Empty, err error)
	GetOrder(ctx context.Context, req *GetOrderRequest, opts ...http.CallOption) (rsp *OrderReply, err error)
	ListOrder(ctx context.Context, req *ListOrderRequest, opts ...http.CallOption) (rsp *ListOrderResponse, err error)
	UpdateOrder(ctx context.Context, req *UpdateOrderRequest, opts ...http.CallOption) (rsp *emptypb.Empty, err error)
}

func NewFakeServerHTTPClient

func NewFakeServerHTTPClient(client *http.Client) FakeServerHTTPClient

type FakeServerHTTPClientImpl

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

func (*FakeServerHTTPClientImpl) CreateOrder

func (*FakeServerHTTPClientImpl) DeleteOrder

func (*FakeServerHTTPClientImpl) GetOrder

func (*FakeServerHTTPClientImpl) ListOrder

func (*FakeServerHTTPClientImpl) UpdateOrder

type FakeServerServer

type FakeServerServer interface {
	CreateOrder(context.Context, *CreateOrderRequest) (*CreateOrderResponse, error)
	ListOrder(context.Context, *ListOrderRequest) (*ListOrderResponse, error)
	GetOrder(context.Context, *GetOrderRequest) (*OrderReply, error)
	UpdateOrder(context.Context, *UpdateOrderRequest) (*emptypb.Empty, error)
	DeleteOrder(context.Context, *DeleteOrderRequest) (*emptypb.Empty, error)
	// contains filtered or unexported methods
}

FakeServerServer is the server API for FakeServer service. All implementations must embed UnimplementedFakeServerServer for forward compatibility

type GetOrderRequest

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

func (*GetOrderRequest) Descriptor deprecated

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

Deprecated: Use GetOrderRequest.ProtoReflect.Descriptor instead.

func (*GetOrderRequest) GetOrderID

func (x *GetOrderRequest) GetOrderID() 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

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

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

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

func (m GetOrderRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (GetOrderRequestMultiError) Error

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

type GetOrderRequestValidationError

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

Cause function returns cause value.

func (GetOrderRequestValidationError) Error

Error satisfies the builtin error interface

func (GetOrderRequestValidationError) ErrorName

func (e GetOrderRequestValidationError) ErrorName() string

ErrorName returns error name.

func (GetOrderRequestValidationError) Field

Field function returns field value.

func (GetOrderRequestValidationError) Key

Key function returns key value.

func (GetOrderRequestValidationError) Reason

Reason function returns reason value.

type ListOrderRequest

type ListOrderRequest struct {
	Limit  int64 `protobuf:"varint,1,opt,name=limit,proto3" json:"limit,omitempty"`
	Offset int64 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"`
	// contains filtered or unexported fields
}

func (*ListOrderRequest) Descriptor deprecated

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

Deprecated: Use ListOrderRequest.ProtoReflect.Descriptor instead.

func (*ListOrderRequest) GetLimit

func (x *ListOrderRequest) GetLimit() int64

func (*ListOrderRequest) GetOffset

func (x *ListOrderRequest) GetOffset() int64

func (*ListOrderRequest) ProtoMessage

func (*ListOrderRequest) ProtoMessage()

func (*ListOrderRequest) ProtoReflect

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

func (*ListOrderRequest) Reset

func (x *ListOrderRequest) Reset()

func (*ListOrderRequest) String

func (x *ListOrderRequest) String() string

func (*ListOrderRequest) Validate

func (m *ListOrderRequest) Validate() error

Validate checks the field values on ListOrderRequest 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 (*ListOrderRequest) ValidateAll

func (m *ListOrderRequest) ValidateAll() error

ValidateAll checks the field values on ListOrderRequest 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 ListOrderRequestMultiError, or nil if none found.

type ListOrderRequestMultiError

type ListOrderRequestMultiError []error

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

func (ListOrderRequestMultiError) AllErrors

func (m ListOrderRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ListOrderRequestMultiError) Error

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

type ListOrderRequestValidationError

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

ListOrderRequestValidationError is the validation error returned by ListOrderRequest.Validate if the designated constraints aren't met.

func (ListOrderRequestValidationError) Cause

Cause function returns cause value.

func (ListOrderRequestValidationError) Error

Error satisfies the builtin error interface

func (ListOrderRequestValidationError) ErrorName

ErrorName returns error name.

func (ListOrderRequestValidationError) Field

Field function returns field value.

func (ListOrderRequestValidationError) Key

Key function returns key value.

func (ListOrderRequestValidationError) Reason

Reason function returns reason value.

type ListOrderResponse

type ListOrderResponse struct {
	TotalCount int64         `protobuf:"varint,1,opt,name=totalCount,proto3" json:"totalCount,omitempty"`
	Orders     []*OrderReply `protobuf:"bytes,2,rep,name=Orders,proto3" json:"Orders,omitempty"`
	// contains filtered or unexported fields
}

func (*ListOrderResponse) Descriptor deprecated

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

Deprecated: Use ListOrderResponse.ProtoReflect.Descriptor instead.

func (*ListOrderResponse) GetOrders

func (x *ListOrderResponse) GetOrders() []*OrderReply

func (*ListOrderResponse) GetTotalCount

func (x *ListOrderResponse) GetTotalCount() int64

func (*ListOrderResponse) ProtoMessage

func (*ListOrderResponse) ProtoMessage()

func (*ListOrderResponse) ProtoReflect

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

func (*ListOrderResponse) Reset

func (x *ListOrderResponse) Reset()

func (*ListOrderResponse) String

func (x *ListOrderResponse) String() string

func (*ListOrderResponse) Validate

func (m *ListOrderResponse) Validate() error

Validate checks the field values on ListOrderResponse 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 (*ListOrderResponse) ValidateAll

func (m *ListOrderResponse) ValidateAll() error

ValidateAll checks the field values on ListOrderResponse 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 ListOrderResponseMultiError, or nil if none found.

type ListOrderResponseMultiError

type ListOrderResponseMultiError []error

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

func (ListOrderResponseMultiError) AllErrors

func (m ListOrderResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ListOrderResponseMultiError) Error

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

type ListOrderResponseValidationError

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

ListOrderResponseValidationError is the validation error returned by ListOrderResponse.Validate if the designated constraints aren't met.

func (ListOrderResponseValidationError) Cause

Cause function returns cause value.

func (ListOrderResponseValidationError) Error

Error satisfies the builtin error interface

func (ListOrderResponseValidationError) ErrorName

ErrorName returns error name.

func (ListOrderResponseValidationError) Field

Field function returns field value.

func (ListOrderResponseValidationError) Key

Key function returns key value.

func (ListOrderResponseValidationError) Reason

Reason function returns reason value.

type OrderReply

type OrderReply struct {
	OrderID   string                 `protobuf:"bytes,1,opt,name=orderID,proto3" json:"orderID,omitempty"`     // 订单 ID
	Customer  string                 `protobuf:"bytes,2,opt,name=customer,proto3" json:"customer,omitempty"`   // 顾客姓名
	Product   string                 `protobuf:"bytes,3,opt,name=product,proto3" json:"product,omitempty"`     // 产品名称
	Quantity  int64                  `protobuf:"varint,4,opt,name=quantity,proto3" json:"quantity,omitempty"`  // 购买数量
	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=createdAt,proto3" json:"createdAt,omitempty"` // 创建时间
	UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=updatedAt,proto3" json:"updatedAt,omitempty"` // 更新时间
	// contains filtered or unexported fields
}

func (*OrderReply) Descriptor deprecated

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

Deprecated: Use OrderReply.ProtoReflect.Descriptor instead.

func (*OrderReply) GetCreatedAt

func (x *OrderReply) GetCreatedAt() *timestamppb.Timestamp

func (*OrderReply) GetCustomer

func (x *OrderReply) GetCustomer() string

func (*OrderReply) GetOrderID

func (x *OrderReply) GetOrderID() string

func (*OrderReply) GetProduct

func (x *OrderReply) GetProduct() string

func (*OrderReply) GetQuantity

func (x *OrderReply) GetQuantity() int64

func (*OrderReply) GetUpdatedAt

func (x *OrderReply) GetUpdatedAt() *timestamppb.Timestamp

func (*OrderReply) ProtoMessage

func (*OrderReply) ProtoMessage()

func (*OrderReply) ProtoReflect

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

func (*OrderReply) Reset

func (x *OrderReply) Reset()

func (*OrderReply) String

func (x *OrderReply) String() string

func (*OrderReply) Validate

func (m *OrderReply) Validate() error

Validate checks the field values on OrderReply 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 (*OrderReply) ValidateAll

func (m *OrderReply) ValidateAll() error

ValidateAll checks the field values on OrderReply 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 OrderReplyMultiError, or nil if none found.

type OrderReplyMultiError

type OrderReplyMultiError []error

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

func (OrderReplyMultiError) AllErrors

func (m OrderReplyMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (OrderReplyMultiError) Error

func (m OrderReplyMultiError) Error() string

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

type OrderReplyValidationError

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

OrderReplyValidationError is the validation error returned by OrderReply.Validate if the designated constraints aren't met.

func (OrderReplyValidationError) Cause

func (e OrderReplyValidationError) Cause() error

Cause function returns cause value.

func (OrderReplyValidationError) Error

Error satisfies the builtin error interface

func (OrderReplyValidationError) ErrorName

func (e OrderReplyValidationError) ErrorName() string

ErrorName returns error name.

func (OrderReplyValidationError) Field

Field function returns field value.

func (OrderReplyValidationError) Key

Key function returns key value.

func (OrderReplyValidationError) Reason

func (e OrderReplyValidationError) Reason() string

Reason function returns reason value.

type UnimplementedFakeServerServer

type UnimplementedFakeServerServer struct {
}

UnimplementedFakeServerServer must be embedded to have forward compatible implementations.

func (UnimplementedFakeServerServer) CreateOrder

func (UnimplementedFakeServerServer) DeleteOrder

func (UnimplementedFakeServerServer) GetOrder

func (UnimplementedFakeServerServer) ListOrder

func (UnimplementedFakeServerServer) UpdateOrder

type UnsafeFakeServerServer

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

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

type UpdateOrderRequest

type UpdateOrderRequest struct {
	OrderID  string  `protobuf:"bytes,1,opt,name=orderID,proto3" json:"orderID,omitempty"`
	Customer *string `protobuf:"bytes,2,opt,name=customer,proto3,oneof" json:"customer,omitempty"`
	Product  *string `protobuf:"bytes,3,opt,name=product,proto3,oneof" json:"product,omitempty"`
	Quantity *int64  `protobuf:"varint,4,opt,name=quantity,proto3,oneof" json:"quantity,omitempty"`
	// contains filtered or unexported fields
}

func (*UpdateOrderRequest) Descriptor deprecated

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

Deprecated: Use UpdateOrderRequest.ProtoReflect.Descriptor instead.

func (*UpdateOrderRequest) GetCustomer

func (x *UpdateOrderRequest) GetCustomer() string

func (*UpdateOrderRequest) GetOrderID

func (x *UpdateOrderRequest) GetOrderID() string

func (*UpdateOrderRequest) GetProduct

func (x *UpdateOrderRequest) GetProduct() string

func (*UpdateOrderRequest) GetQuantity

func (x *UpdateOrderRequest) GetQuantity() int64

func (*UpdateOrderRequest) ProtoMessage

func (*UpdateOrderRequest) ProtoMessage()

func (*UpdateOrderRequest) ProtoReflect

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

func (*UpdateOrderRequest) Reset

func (x *UpdateOrderRequest) Reset()

func (*UpdateOrderRequest) String

func (x *UpdateOrderRequest) String() string

func (*UpdateOrderRequest) Validate

func (m *UpdateOrderRequest) Validate() error

Validate checks the field values on UpdateOrderRequest 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 (*UpdateOrderRequest) ValidateAll

func (m *UpdateOrderRequest) ValidateAll() error

ValidateAll checks the field values on UpdateOrderRequest 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 UpdateOrderRequestMultiError, or nil if none found.

type UpdateOrderRequestMultiError

type UpdateOrderRequestMultiError []error

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

func (UpdateOrderRequestMultiError) AllErrors

func (m UpdateOrderRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (UpdateOrderRequestMultiError) Error

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

type UpdateOrderRequestValidationError

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

UpdateOrderRequestValidationError is the validation error returned by UpdateOrderRequest.Validate if the designated constraints aren't met.

func (UpdateOrderRequestValidationError) Cause

Cause function returns cause value.

func (UpdateOrderRequestValidationError) Error

Error satisfies the builtin error interface

func (UpdateOrderRequestValidationError) ErrorName

ErrorName returns error name.

func (UpdateOrderRequestValidationError) Field

Field function returns field value.

func (UpdateOrderRequestValidationError) Key

Key function returns key value.

func (UpdateOrderRequestValidationError) Reason

Reason function returns reason value.

Jump to

Keyboard shortcuts

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