v1

package
v0.2.0-alpha.4 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2024 License: MIT Imports: 32 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_UpdateOrder_FullMethodName = "/fakeserver.v1.FakeServer/UpdateOrder"
	FakeServer_DeleteOrder_FullMethodName = "/fakeserver.v1.FakeServer/DeleteOrder"
	FakeServer_GetOrder_FullMethodName    = "/fakeserver.v1.FakeServer/GetOrder"
	FakeServer_ListOrder_FullMethodName   = "/fakeserver.v1.FakeServer/ListOrder"
)
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: "UpdateOrder",
			Handler:    _FakeServer_UpdateOrder_Handler,
		},
		{
			MethodName: "DeleteOrder",
			Handler:    _FakeServer_DeleteOrder_Handler,
		},
		{
			MethodName: "GetOrder",
			Handler:    _FakeServer_GetOrder_Handler,
		},
		{
			MethodName: "ListOrder",
			Handler:    _FakeServer_ListOrder_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 DeleteOrderResponse

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

func (*DeleteOrderResponse) Descriptor deprecated

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

Deprecated: Use DeleteOrderResponse.ProtoReflect.Descriptor instead.

func (*DeleteOrderResponse) ProtoMessage

func (*DeleteOrderResponse) ProtoMessage()

func (*DeleteOrderResponse) ProtoReflect

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

func (*DeleteOrderResponse) Reset

func (x *DeleteOrderResponse) Reset()

func (*DeleteOrderResponse) String

func (x *DeleteOrderResponse) String() string

func (*DeleteOrderResponse) Validate

func (m *DeleteOrderResponse) Validate() error

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

func (m *DeleteOrderResponse) ValidateAll() error

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

type DeleteOrderResponseMultiError

type DeleteOrderResponseMultiError []error

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

func (DeleteOrderResponseMultiError) AllErrors

func (m DeleteOrderResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (DeleteOrderResponseMultiError) Error

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

type DeleteOrderResponseValidationError

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

DeleteOrderResponseValidationError is the validation error returned by DeleteOrderResponse.Validate if the designated constraints aren't met.

func (DeleteOrderResponseValidationError) Cause

Cause function returns cause value.

func (DeleteOrderResponseValidationError) Error

Error satisfies the builtin error interface

func (DeleteOrderResponseValidationError) ErrorName

ErrorName returns error name.

func (DeleteOrderResponseValidationError) Field

Field function returns field value.

func (DeleteOrderResponseValidationError) Key

Key function returns key value.

func (DeleteOrderResponseValidationError) 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)
	UpdateOrder(ctx context.Context, in *UpdateOrderRequest, opts ...grpc.CallOption) (*UpdateOrderResponse, error)
	DeleteOrder(ctx context.Context, in *DeleteOrderRequest, opts ...grpc.CallOption) (*DeleteOrderResponse, error)
	GetOrder(ctx context.Context, in *GetOrderRequest, opts ...grpc.CallOption) (*GetOrderResponse, error)
	ListOrder(ctx context.Context, in *ListOrderRequest, opts ...grpc.CallOption) (*ListOrderResponse, 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 *DeleteOrderResponse, err error)
	GetOrder(ctx context.Context, req *GetOrderRequest, opts ...http.CallOption) (rsp *GetOrderResponse, 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 *UpdateOrderResponse, 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)
	UpdateOrder(context.Context, *UpdateOrderRequest) (*UpdateOrderResponse, error)
	DeleteOrder(context.Context, *DeleteOrderRequest) (*DeleteOrderResponse, error)
	GetOrder(context.Context, *GetOrderRequest) (*GetOrderResponse, error)
	ListOrder(context.Context, *ListOrderRequest) (*ListOrderResponse, 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 GetOrderResponse

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

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

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

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

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

func (m GetOrderResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (GetOrderResponseMultiError) Error

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

type GetOrderResponseValidationError

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

Cause function returns cause value.

func (GetOrderResponseValidationError) Error

Error satisfies the builtin error interface

func (GetOrderResponseValidationError) ErrorName

ErrorName returns error name.

func (GetOrderResponseValidationError) Field

Field function returns field value.

func (GetOrderResponseValidationError) Key

Key function returns key value.

func (GetOrderResponseValidationError) 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     []*Order `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() []*Order

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 Order

type Order 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 (*Order) Descriptor deprecated

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

Deprecated: Use Order.ProtoReflect.Descriptor instead.

func (*Order) GetCreatedAt

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

func (*Order) GetCustomer

func (x *Order) GetCustomer() string

func (*Order) GetOrderID

func (x *Order) GetOrderID() string

func (*Order) GetProduct

func (x *Order) GetProduct() string

func (*Order) GetQuantity

func (x *Order) GetQuantity() int64

func (*Order) GetUpdatedAt

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

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

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

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 OrderMultiError

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

func (m OrderMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (OrderMultiError) Error

func (m OrderMultiError) Error() string

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

type OrderValidationError

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

func (e OrderValidationError) Cause() error

Cause function returns cause value.

func (OrderValidationError) Error

func (e OrderValidationError) Error() string

Error satisfies the builtin error interface

func (OrderValidationError) ErrorName

func (e OrderValidationError) ErrorName() string

ErrorName returns error name.

func (OrderValidationError) Field

func (e OrderValidationError) Field() string

Field function returns field value.

func (OrderValidationError) Key

func (e OrderValidationError) Key() bool

Key function returns key value.

func (OrderValidationError) Reason

func (e OrderValidationError) Reason() string

Reason function returns reason value.

type UnimplementedFakeServerServer

type UnimplementedFakeServerServer struct{}

UnimplementedFakeServerServer 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 (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.

type UpdateOrderResponse

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

func (*UpdateOrderResponse) Descriptor deprecated

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

Deprecated: Use UpdateOrderResponse.ProtoReflect.Descriptor instead.

func (*UpdateOrderResponse) ProtoMessage

func (*UpdateOrderResponse) ProtoMessage()

func (*UpdateOrderResponse) ProtoReflect

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

func (*UpdateOrderResponse) Reset

func (x *UpdateOrderResponse) Reset()

func (*UpdateOrderResponse) String

func (x *UpdateOrderResponse) String() string

func (*UpdateOrderResponse) Validate

func (m *UpdateOrderResponse) Validate() error

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

func (m *UpdateOrderResponse) ValidateAll() error

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

type UpdateOrderResponseMultiError

type UpdateOrderResponseMultiError []error

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

func (UpdateOrderResponseMultiError) AllErrors

func (m UpdateOrderResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (UpdateOrderResponseMultiError) Error

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

type UpdateOrderResponseValidationError

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

UpdateOrderResponseValidationError is the validation error returned by UpdateOrderResponse.Validate if the designated constraints aren't met.

func (UpdateOrderResponseValidationError) Cause

Cause function returns cause value.

func (UpdateOrderResponseValidationError) Error

Error satisfies the builtin error interface

func (UpdateOrderResponseValidationError) ErrorName

ErrorName returns error name.

func (UpdateOrderResponseValidationError) Field

Field function returns field value.

func (UpdateOrderResponseValidationError) Key

Key function returns key value.

func (UpdateOrderResponseValidationError) Reason

Reason function returns reason value.

Jump to

Keyboard shortcuts

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