Documentation ¶
Index ¶
- Constants
- Variables
- func ErrorBadRequest(format string, args ...interface{}) *errors.Error
- func ErrorRecordAlreadyExists(format string, args ...interface{}) *errors.Error
- func ErrorRecordNotFound(format string, args ...interface{}) *errors.Error
- func ErrorSystemError(format string, args ...interface{}) *errors.Error
- func IsBadRequest(err error) bool
- func IsRecordAlreadyExists(err error) bool
- func IsRecordNotFound(err error) bool
- func IsSystemError(err error) bool
- func RegisterExampleServiceHTTPServer(s *http.Server, srv ExampleServiceHTTPServer)
- func RegisterExampleServiceServer(s grpc.ServiceRegistrar, srv ExampleServiceServer)
- type CheckResponse
- func (*CheckResponse) Descriptor() ([]byte, []int)deprecated
- func (x *CheckResponse) GetSuccess() bool
- func (*CheckResponse) ProtoMessage()
- func (x *CheckResponse) ProtoReflect() protoreflect.Message
- func (x *CheckResponse) Reset()
- func (x *CheckResponse) String() string
- func (m *CheckResponse) Validate() error
- func (m *CheckResponse) ValidateAll() error
- type CheckResponseMultiError
- type CheckResponseValidationError
- func (e CheckResponseValidationError) Cause() error
- func (e CheckResponseValidationError) Error() string
- func (e CheckResponseValidationError) ErrorName() string
- func (e CheckResponseValidationError) Field() string
- func (e CheckResponseValidationError) Key() bool
- func (e CheckResponseValidationError) Reason() string
- type CreateExampleReq
- func (*CreateExampleReq) Descriptor() ([]byte, []int)deprecated
- func (x *CreateExampleReq) GetName() string
- func (x *CreateExampleReq) GetStatus() bool
- func (*CreateExampleReq) ProtoMessage()
- func (x *CreateExampleReq) ProtoReflect() protoreflect.Message
- func (x *CreateExampleReq) Reset()
- func (x *CreateExampleReq) String() string
- func (m *CreateExampleReq) Validate() error
- func (m *CreateExampleReq) ValidateAll() error
- type CreateExampleReqMultiError
- type CreateExampleReqValidationError
- func (e CreateExampleReqValidationError) Cause() error
- func (e CreateExampleReqValidationError) Error() string
- func (e CreateExampleReqValidationError) ErrorName() string
- func (e CreateExampleReqValidationError) Field() string
- func (e CreateExampleReqValidationError) Key() bool
- func (e CreateExampleReqValidationError) Reason() string
- type ErrorReason
- func (ErrorReason) Descriptor() protoreflect.EnumDescriptor
- func (x ErrorReason) Enum() *ErrorReason
- func (ErrorReason) EnumDescriptor() ([]byte, []int)deprecated
- func (x ErrorReason) Number() protoreflect.EnumNumber
- func (x ErrorReason) String() string
- func (ErrorReason) Type() protoreflect.EnumType
- type Example
- func (*Example) Descriptor() ([]byte, []int)deprecated
- func (x *Example) GetCreateAt() string
- func (x *Example) GetId() int64
- func (x *Example) GetName() string
- func (x *Example) GetStatus() bool
- func (x *Example) GetUpdateAt() string
- func (*Example) ProtoMessage()
- func (x *Example) ProtoReflect() protoreflect.Message
- func (x *Example) Reset()
- func (x *Example) String() string
- func (m *Example) Validate() error
- func (m *Example) ValidateAll() error
- type ExampleIdReq
- func (*ExampleIdReq) Descriptor() ([]byte, []int)deprecated
- func (x *ExampleIdReq) GetId() int64
- func (*ExampleIdReq) ProtoMessage()
- func (x *ExampleIdReq) ProtoReflect() protoreflect.Message
- func (x *ExampleIdReq) Reset()
- func (x *ExampleIdReq) String() string
- func (m *ExampleIdReq) Validate() error
- func (m *ExampleIdReq) ValidateAll() error
- type ExampleIdReqMultiError
- type ExampleIdReqValidationError
- func (e ExampleIdReqValidationError) Cause() error
- func (e ExampleIdReqValidationError) Error() string
- func (e ExampleIdReqValidationError) ErrorName() string
- func (e ExampleIdReqValidationError) Field() string
- func (e ExampleIdReqValidationError) Key() bool
- func (e ExampleIdReqValidationError) Reason() string
- type ExampleMultiError
- type ExampleServiceClient
- type ExampleServiceHTTPClient
- type ExampleServiceHTTPClientImpl
- func (c *ExampleServiceHTTPClientImpl) CreateExample(ctx context.Context, in *CreateExampleReq, opts ...http.CallOption) (*Example, error)
- func (c *ExampleServiceHTTPClientImpl) DeleteExample(ctx context.Context, in *ExampleIdReq, opts ...http.CallOption) (*CheckResponse, error)
- func (c *ExampleServiceHTTPClientImpl) GetExample(ctx context.Context, in *ExampleIdReq, opts ...http.CallOption) (*Example, error)
- func (c *ExampleServiceHTTPClientImpl) GetExampleList(ctx context.Context, in *GetExampleListReq, opts ...http.CallOption) (*GetExampleListPageRes, error)
- func (c *ExampleServiceHTTPClientImpl) RecoverExample(ctx context.Context, in *ExampleIdReq, opts ...http.CallOption) (*CheckResponse, error)
- func (c *ExampleServiceHTTPClientImpl) UpdateExample(ctx context.Context, in *UpdateExampleReq, opts ...http.CallOption) (*CheckResponse, error)
- type ExampleServiceHTTPServer
- type ExampleServiceServer
- type ExampleValidationError
- type GetExampleListPageRes
- func (*GetExampleListPageRes) Descriptor() ([]byte, []int)deprecated
- func (x *GetExampleListPageRes) GetList() []*Example
- func (x *GetExampleListPageRes) GetTotal() int64
- func (*GetExampleListPageRes) ProtoMessage()
- func (x *GetExampleListPageRes) ProtoReflect() protoreflect.Message
- func (x *GetExampleListPageRes) Reset()
- func (x *GetExampleListPageRes) String() string
- func (m *GetExampleListPageRes) Validate() error
- func (m *GetExampleListPageRes) ValidateAll() error
- type GetExampleListPageResMultiError
- type GetExampleListPageResValidationError
- func (e GetExampleListPageResValidationError) Cause() error
- func (e GetExampleListPageResValidationError) Error() string
- func (e GetExampleListPageResValidationError) ErrorName() string
- func (e GetExampleListPageResValidationError) Field() string
- func (e GetExampleListPageResValidationError) Key() bool
- func (e GetExampleListPageResValidationError) Reason() string
- type GetExampleListReq
- func (*GetExampleListReq) Descriptor() ([]byte, []int)deprecated
- func (x *GetExampleListReq) GetName() string
- func (x *GetExampleListReq) GetPage() int64
- func (x *GetExampleListReq) GetPageSize() int64
- func (x *GetExampleListReq) GetStatus() *wrapperspb.BoolValue
- func (*GetExampleListReq) ProtoMessage()
- func (x *GetExampleListReq) ProtoReflect() protoreflect.Message
- func (x *GetExampleListReq) Reset()
- func (x *GetExampleListReq) String() string
- func (m *GetExampleListReq) Validate() error
- func (m *GetExampleListReq) ValidateAll() error
- type GetExampleListReqMultiError
- type GetExampleListReqValidationError
- func (e GetExampleListReqValidationError) Cause() error
- func (e GetExampleListReqValidationError) Error() string
- func (e GetExampleListReqValidationError) ErrorName() string
- func (e GetExampleListReqValidationError) Field() string
- func (e GetExampleListReqValidationError) Key() bool
- func (e GetExampleListReqValidationError) Reason() string
- type UnimplementedExampleServiceServer
- func (UnimplementedExampleServiceServer) CreateExample(context.Context, *CreateExampleReq) (*Example, error)
- func (UnimplementedExampleServiceServer) DeleteExample(context.Context, *ExampleIdReq) (*CheckResponse, error)
- func (UnimplementedExampleServiceServer) GetExample(context.Context, *ExampleIdReq) (*Example, error)
- func (UnimplementedExampleServiceServer) GetExampleList(context.Context, *GetExampleListReq) (*GetExampleListPageRes, error)
- func (UnimplementedExampleServiceServer) RecoverExample(context.Context, *ExampleIdReq) (*CheckResponse, error)
- func (UnimplementedExampleServiceServer) UpdateExample(context.Context, *UpdateExampleReq) (*CheckResponse, error)
- type UnsafeExampleServiceServer
- type UpdateExampleReq
- func (*UpdateExampleReq) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateExampleReq) GetId() int64
- func (x *UpdateExampleReq) GetName() string
- func (x *UpdateExampleReq) GetStatus() bool
- func (*UpdateExampleReq) ProtoMessage()
- func (x *UpdateExampleReq) ProtoReflect() protoreflect.Message
- func (x *UpdateExampleReq) Reset()
- func (x *UpdateExampleReq) String() string
- func (m *UpdateExampleReq) Validate() error
- func (m *UpdateExampleReq) ValidateAll() error
- type UpdateExampleReqMultiError
- type UpdateExampleReqValidationError
- func (e UpdateExampleReqValidationError) Cause() error
- func (e UpdateExampleReqValidationError) Error() string
- func (e UpdateExampleReqValidationError) ErrorName() string
- func (e UpdateExampleReqValidationError) Field() string
- func (e UpdateExampleReqValidationError) Key() bool
- func (e UpdateExampleReqValidationError) Reason() string
Constants ¶
const ( ExampleService_GetExampleList_FullMethodName = "/example.v1.ExampleService/GetExampleList" ExampleService_GetExample_FullMethodName = "/example.v1.ExampleService/GetExample" ExampleService_CreateExample_FullMethodName = "/example.v1.ExampleService/CreateExample" ExampleService_UpdateExample_FullMethodName = "/example.v1.ExampleService/UpdateExample" ExampleService_DeleteExample_FullMethodName = "/example.v1.ExampleService/DeleteExample" ExampleService_RecoverExample_FullMethodName = "/example.v1.ExampleService/RecoverExample" )
const OperationExampleServiceCreateExample = "/example.v1.ExampleService/CreateExample"
const OperationExampleServiceDeleteExample = "/example.v1.ExampleService/DeleteExample"
const OperationExampleServiceGetExample = "/example.v1.ExampleService/GetExample"
const OperationExampleServiceGetExampleList = "/example.v1.ExampleService/GetExampleList"
const OperationExampleServiceRecoverExample = "/example.v1.ExampleService/RecoverExample"
const OperationExampleServiceUpdateExample = "/example.v1.ExampleService/UpdateExample"
Variables ¶
var ( ErrorReason_name = map[int32]string{ 0: "RECORD_NOT_FOUND", 1: "RECORD_ALREADY_EXISTS", 2: "BAD_REQUEST", 3: "SYSTEM_ERROR", } ErrorReason_value = map[string]int32{ "RECORD_NOT_FOUND": 0, "RECORD_ALREADY_EXISTS": 1, "BAD_REQUEST": 2, "SYSTEM_ERROR": 3, } )
Enum value maps for ErrorReason.
var ExampleService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "example.v1.ExampleService", HandlerType: (*ExampleServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetExampleList", Handler: _ExampleService_GetExampleList_Handler, }, { MethodName: "GetExample", Handler: _ExampleService_GetExample_Handler, }, { MethodName: "CreateExample", Handler: _ExampleService_CreateExample_Handler, }, { MethodName: "UpdateExample", Handler: _ExampleService_UpdateExample_Handler, }, { MethodName: "DeleteExample", Handler: _ExampleService_DeleteExample_Handler, }, { MethodName: "RecoverExample", Handler: _ExampleService_RecoverExample_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "example/v1/example.proto", }
ExampleService_ServiceDesc is the grpc.ServiceDesc for ExampleService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_example_v1_error_reason_proto protoreflect.FileDescriptor
var File_example_v1_example_proto protoreflect.FileDescriptor
Functions ¶
func ErrorBadRequest ¶
func ErrorRecordNotFound ¶
func ErrorSystemError ¶
func IsBadRequest ¶
func IsRecordAlreadyExists ¶
func IsRecordNotFound ¶
func IsSystemError ¶
func RegisterExampleServiceHTTPServer ¶
func RegisterExampleServiceHTTPServer(s *http.Server, srv ExampleServiceHTTPServer)
func RegisterExampleServiceServer ¶
func RegisterExampleServiceServer(s grpc.ServiceRegistrar, srv ExampleServiceServer)
Types ¶
type CheckResponse ¶
type CheckResponse struct { Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` // contains filtered or unexported fields }
响应 - 检查是否处理成功
func (*CheckResponse) Descriptor
deprecated
func (*CheckResponse) Descriptor() ([]byte, []int)
Deprecated: Use CheckResponse.ProtoReflect.Descriptor instead.
func (*CheckResponse) GetSuccess ¶
func (x *CheckResponse) GetSuccess() bool
func (*CheckResponse) ProtoMessage ¶
func (*CheckResponse) ProtoMessage()
func (*CheckResponse) ProtoReflect ¶
func (x *CheckResponse) ProtoReflect() protoreflect.Message
func (*CheckResponse) Reset ¶
func (x *CheckResponse) Reset()
func (*CheckResponse) String ¶
func (x *CheckResponse) String() string
func (*CheckResponse) Validate ¶
func (m *CheckResponse) Validate() error
Validate checks the field values on CheckResponse 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 (*CheckResponse) ValidateAll ¶
func (m *CheckResponse) ValidateAll() error
ValidateAll checks the field values on CheckResponse 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 CheckResponseMultiError, or nil if none found.
type CheckResponseMultiError ¶
type CheckResponseMultiError []error
CheckResponseMultiError is an error wrapping multiple validation errors returned by CheckResponse.ValidateAll() if the designated constraints aren't met.
func (CheckResponseMultiError) AllErrors ¶
func (m CheckResponseMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (CheckResponseMultiError) Error ¶
func (m CheckResponseMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type CheckResponseValidationError ¶
type CheckResponseValidationError struct {
// contains filtered or unexported fields
}
CheckResponseValidationError is the validation error returned by CheckResponse.Validate if the designated constraints aren't met.
func (CheckResponseValidationError) Cause ¶
func (e CheckResponseValidationError) Cause() error
Cause function returns cause value.
func (CheckResponseValidationError) Error ¶
func (e CheckResponseValidationError) Error() string
Error satisfies the builtin error interface
func (CheckResponseValidationError) ErrorName ¶
func (e CheckResponseValidationError) ErrorName() string
ErrorName returns error name.
func (CheckResponseValidationError) Field ¶
func (e CheckResponseValidationError) Field() string
Field function returns field value.
func (CheckResponseValidationError) Key ¶
func (e CheckResponseValidationError) Key() bool
Key function returns key value.
func (CheckResponseValidationError) Reason ¶
func (e CheckResponseValidationError) Reason() string
Reason function returns reason value.
type CreateExampleReq ¶
type CreateExampleReq struct { // 名称 Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Status bool `protobuf:"varint,2,opt,name=status,proto3" json:"status,omitempty"` // contains filtered or unexported fields }
请求 - 创建
func (*CreateExampleReq) Descriptor
deprecated
func (*CreateExampleReq) Descriptor() ([]byte, []int)
Deprecated: Use CreateExampleReq.ProtoReflect.Descriptor instead.
func (*CreateExampleReq) GetName ¶
func (x *CreateExampleReq) GetName() string
func (*CreateExampleReq) GetStatus ¶
func (x *CreateExampleReq) GetStatus() bool
func (*CreateExampleReq) ProtoMessage ¶
func (*CreateExampleReq) ProtoMessage()
func (*CreateExampleReq) ProtoReflect ¶
func (x *CreateExampleReq) ProtoReflect() protoreflect.Message
func (*CreateExampleReq) Reset ¶
func (x *CreateExampleReq) Reset()
func (*CreateExampleReq) String ¶
func (x *CreateExampleReq) String() string
func (*CreateExampleReq) Validate ¶
func (m *CreateExampleReq) Validate() error
Validate checks the field values on CreateExampleReq 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 (*CreateExampleReq) ValidateAll ¶
func (m *CreateExampleReq) ValidateAll() error
ValidateAll checks the field values on CreateExampleReq 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 CreateExampleReqMultiError, or nil if none found.
type CreateExampleReqMultiError ¶
type CreateExampleReqMultiError []error
CreateExampleReqMultiError is an error wrapping multiple validation errors returned by CreateExampleReq.ValidateAll() if the designated constraints aren't met.
func (CreateExampleReqMultiError) AllErrors ¶
func (m CreateExampleReqMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (CreateExampleReqMultiError) Error ¶
func (m CreateExampleReqMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type CreateExampleReqValidationError ¶
type CreateExampleReqValidationError struct {
// contains filtered or unexported fields
}
CreateExampleReqValidationError is the validation error returned by CreateExampleReq.Validate if the designated constraints aren't met.
func (CreateExampleReqValidationError) Cause ¶
func (e CreateExampleReqValidationError) Cause() error
Cause function returns cause value.
func (CreateExampleReqValidationError) Error ¶
func (e CreateExampleReqValidationError) Error() string
Error satisfies the builtin error interface
func (CreateExampleReqValidationError) ErrorName ¶
func (e CreateExampleReqValidationError) ErrorName() string
ErrorName returns error name.
func (CreateExampleReqValidationError) Field ¶
func (e CreateExampleReqValidationError) Field() string
Field function returns field value.
func (CreateExampleReqValidationError) Key ¶
func (e CreateExampleReqValidationError) Key() bool
Key function returns key value.
func (CreateExampleReqValidationError) Reason ¶
func (e CreateExampleReqValidationError) Reason() string
Reason function returns reason value.
type ErrorReason ¶
type ErrorReason int32
const ( ErrorReason_RECORD_NOT_FOUND ErrorReason = 0 ErrorReason_RECORD_ALREADY_EXISTS ErrorReason = 1 ErrorReason_BAD_REQUEST ErrorReason = 2 ErrorReason_SYSTEM_ERROR ErrorReason = 3 )
func (ErrorReason) Descriptor ¶
func (ErrorReason) Descriptor() protoreflect.EnumDescriptor
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 ¶
func (ErrorReason) Type() protoreflect.EnumType
type Example ¶
type Example struct { // 主键id Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // 名称 Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // 状态 Status bool `protobuf:"varint,3,opt,name=status,proto3" json:"status,omitempty"` // 创建时间 CreateAt string `protobuf:"bytes,4,opt,name=create_at,json=created_at,proto3" json:"create_at,omitempty"` // 更新时间 UpdateAt string `protobuf:"bytes,5,opt,name=update_at,json=updated_at,proto3" json:"update_at,omitempty"` // contains filtered or unexported fields }
响应 - 示例信息
func (*Example) Descriptor
deprecated
func (*Example) GetCreateAt ¶
func (*Example) GetUpdateAt ¶
func (*Example) ProtoMessage ¶
func (*Example) ProtoMessage()
func (*Example) ProtoReflect ¶
func (x *Example) ProtoReflect() protoreflect.Message
func (*Example) Validate ¶
Validate checks the field values on Example 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 (*Example) ValidateAll ¶
ValidateAll checks the field values on Example 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 ExampleMultiError, or nil if none found.
type ExampleIdReq ¶
type ExampleIdReq struct { // 主键id Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
请求 - 主键id
func (*ExampleIdReq) Descriptor
deprecated
func (*ExampleIdReq) Descriptor() ([]byte, []int)
Deprecated: Use ExampleIdReq.ProtoReflect.Descriptor instead.
func (*ExampleIdReq) GetId ¶
func (x *ExampleIdReq) GetId() int64
func (*ExampleIdReq) ProtoMessage ¶
func (*ExampleIdReq) ProtoMessage()
func (*ExampleIdReq) ProtoReflect ¶
func (x *ExampleIdReq) ProtoReflect() protoreflect.Message
func (*ExampleIdReq) Reset ¶
func (x *ExampleIdReq) Reset()
func (*ExampleIdReq) String ¶
func (x *ExampleIdReq) String() string
func (*ExampleIdReq) Validate ¶
func (m *ExampleIdReq) Validate() error
Validate checks the field values on ExampleIdReq 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 (*ExampleIdReq) ValidateAll ¶
func (m *ExampleIdReq) ValidateAll() error
ValidateAll checks the field values on ExampleIdReq 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 ExampleIdReqMultiError, or nil if none found.
type ExampleIdReqMultiError ¶
type ExampleIdReqMultiError []error
ExampleIdReqMultiError is an error wrapping multiple validation errors returned by ExampleIdReq.ValidateAll() if the designated constraints aren't met.
func (ExampleIdReqMultiError) AllErrors ¶
func (m ExampleIdReqMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (ExampleIdReqMultiError) Error ¶
func (m ExampleIdReqMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type ExampleIdReqValidationError ¶
type ExampleIdReqValidationError struct {
// contains filtered or unexported fields
}
ExampleIdReqValidationError is the validation error returned by ExampleIdReq.Validate if the designated constraints aren't met.
func (ExampleIdReqValidationError) Cause ¶
func (e ExampleIdReqValidationError) Cause() error
Cause function returns cause value.
func (ExampleIdReqValidationError) Error ¶
func (e ExampleIdReqValidationError) Error() string
Error satisfies the builtin error interface
func (ExampleIdReqValidationError) ErrorName ¶
func (e ExampleIdReqValidationError) ErrorName() string
ErrorName returns error name.
func (ExampleIdReqValidationError) Field ¶
func (e ExampleIdReqValidationError) Field() string
Field function returns field value.
func (ExampleIdReqValidationError) Key ¶
func (e ExampleIdReqValidationError) Key() bool
Key function returns key value.
func (ExampleIdReqValidationError) Reason ¶
func (e ExampleIdReqValidationError) Reason() string
Reason function returns reason value.
type ExampleMultiError ¶
type ExampleMultiError []error
ExampleMultiError is an error wrapping multiple validation errors returned by Example.ValidateAll() if the designated constraints aren't met.
func (ExampleMultiError) AllErrors ¶
func (m ExampleMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (ExampleMultiError) Error ¶
func (m ExampleMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type ExampleServiceClient ¶
type ExampleServiceClient interface { // 列表 GetExampleList(ctx context.Context, in *GetExampleListReq, opts ...grpc.CallOption) (*GetExampleListPageRes, error) // 详情 GetExample(ctx context.Context, in *ExampleIdReq, opts ...grpc.CallOption) (*Example, error) // 创建 CreateExample(ctx context.Context, in *CreateExampleReq, opts ...grpc.CallOption) (*Example, error) // 更新 UpdateExample(ctx context.Context, in *UpdateExampleReq, opts ...grpc.CallOption) (*CheckResponse, error) // 删除 DeleteExample(ctx context.Context, in *ExampleIdReq, opts ...grpc.CallOption) (*CheckResponse, error) // 恢复 RecoverExample(ctx context.Context, in *ExampleIdReq, opts ...grpc.CallOption) (*CheckResponse, error) }
ExampleServiceClient is the client API for ExampleService 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 NewExampleServiceClient ¶
func NewExampleServiceClient(cc grpc.ClientConnInterface) ExampleServiceClient
type ExampleServiceHTTPClient ¶
type ExampleServiceHTTPClient interface { CreateExample(ctx context.Context, req *CreateExampleReq, opts ...http.CallOption) (rsp *Example, err error) DeleteExample(ctx context.Context, req *ExampleIdReq, opts ...http.CallOption) (rsp *CheckResponse, err error) GetExample(ctx context.Context, req *ExampleIdReq, opts ...http.CallOption) (rsp *Example, err error) GetExampleList(ctx context.Context, req *GetExampleListReq, opts ...http.CallOption) (rsp *GetExampleListPageRes, err error) RecoverExample(ctx context.Context, req *ExampleIdReq, opts ...http.CallOption) (rsp *CheckResponse, err error) UpdateExample(ctx context.Context, req *UpdateExampleReq, opts ...http.CallOption) (rsp *CheckResponse, err error) }
func NewExampleServiceHTTPClient ¶
func NewExampleServiceHTTPClient(client *http.Client) ExampleServiceHTTPClient
type ExampleServiceHTTPClientImpl ¶
type ExampleServiceHTTPClientImpl struct {
// contains filtered or unexported fields
}
func (*ExampleServiceHTTPClientImpl) CreateExample ¶
func (c *ExampleServiceHTTPClientImpl) CreateExample(ctx context.Context, in *CreateExampleReq, opts ...http.CallOption) (*Example, error)
func (*ExampleServiceHTTPClientImpl) DeleteExample ¶
func (c *ExampleServiceHTTPClientImpl) DeleteExample(ctx context.Context, in *ExampleIdReq, opts ...http.CallOption) (*CheckResponse, error)
func (*ExampleServiceHTTPClientImpl) GetExample ¶
func (c *ExampleServiceHTTPClientImpl) GetExample(ctx context.Context, in *ExampleIdReq, opts ...http.CallOption) (*Example, error)
func (*ExampleServiceHTTPClientImpl) GetExampleList ¶
func (c *ExampleServiceHTTPClientImpl) GetExampleList(ctx context.Context, in *GetExampleListReq, opts ...http.CallOption) (*GetExampleListPageRes, error)
func (*ExampleServiceHTTPClientImpl) RecoverExample ¶
func (c *ExampleServiceHTTPClientImpl) RecoverExample(ctx context.Context, in *ExampleIdReq, opts ...http.CallOption) (*CheckResponse, error)
func (*ExampleServiceHTTPClientImpl) UpdateExample ¶
func (c *ExampleServiceHTTPClientImpl) UpdateExample(ctx context.Context, in *UpdateExampleReq, opts ...http.CallOption) (*CheckResponse, error)
type ExampleServiceHTTPServer ¶
type ExampleServiceHTTPServer interface { CreateExample(context.Context, *CreateExampleReq) (*Example, error) DeleteExample(context.Context, *ExampleIdReq) (*CheckResponse, error) GetExample(context.Context, *ExampleIdReq) (*Example, error) GetExampleList(context.Context, *GetExampleListReq) (*GetExampleListPageRes, error) RecoverExample(context.Context, *ExampleIdReq) (*CheckResponse, error) UpdateExample(context.Context, *UpdateExampleReq) (*CheckResponse, error) }
type ExampleServiceServer ¶
type ExampleServiceServer interface { // 列表 GetExampleList(context.Context, *GetExampleListReq) (*GetExampleListPageRes, error) // 详情 GetExample(context.Context, *ExampleIdReq) (*Example, error) // 创建 CreateExample(context.Context, *CreateExampleReq) (*Example, error) // 更新 UpdateExample(context.Context, *UpdateExampleReq) (*CheckResponse, error) // 删除 DeleteExample(context.Context, *ExampleIdReq) (*CheckResponse, error) // 恢复 RecoverExample(context.Context, *ExampleIdReq) (*CheckResponse, error) // contains filtered or unexported methods }
ExampleServiceServer is the server API for ExampleService service. All implementations must embed UnimplementedExampleServiceServer for forward compatibility
type ExampleValidationError ¶
type ExampleValidationError struct {
// contains filtered or unexported fields
}
ExampleValidationError is the validation error returned by Example.Validate if the designated constraints aren't met.
func (ExampleValidationError) Cause ¶
func (e ExampleValidationError) Cause() error
Cause function returns cause value.
func (ExampleValidationError) Error ¶
func (e ExampleValidationError) Error() string
Error satisfies the builtin error interface
func (ExampleValidationError) ErrorName ¶
func (e ExampleValidationError) ErrorName() string
ErrorName returns error name.
func (ExampleValidationError) Field ¶
func (e ExampleValidationError) Field() string
Field function returns field value.
func (ExampleValidationError) Key ¶
func (e ExampleValidationError) Key() bool
Key function returns key value.
func (ExampleValidationError) Reason ¶
func (e ExampleValidationError) Reason() string
Reason function returns reason value.
type GetExampleListPageRes ¶
type GetExampleListPageRes struct { // 总数 Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` // 列表 List []*Example `protobuf:"bytes,2,rep,name=list,proto3" json:"list,omitempty"` // contains filtered or unexported fields }
响应 - 分页
func (*GetExampleListPageRes) Descriptor
deprecated
func (*GetExampleListPageRes) Descriptor() ([]byte, []int)
Deprecated: Use GetExampleListPageRes.ProtoReflect.Descriptor instead.
func (*GetExampleListPageRes) GetList ¶
func (x *GetExampleListPageRes) GetList() []*Example
func (*GetExampleListPageRes) GetTotal ¶
func (x *GetExampleListPageRes) GetTotal() int64
func (*GetExampleListPageRes) ProtoMessage ¶
func (*GetExampleListPageRes) ProtoMessage()
func (*GetExampleListPageRes) ProtoReflect ¶
func (x *GetExampleListPageRes) ProtoReflect() protoreflect.Message
func (*GetExampleListPageRes) Reset ¶
func (x *GetExampleListPageRes) Reset()
func (*GetExampleListPageRes) String ¶
func (x *GetExampleListPageRes) String() string
func (*GetExampleListPageRes) Validate ¶
func (m *GetExampleListPageRes) Validate() error
Validate checks the field values on GetExampleListPageRes 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 (*GetExampleListPageRes) ValidateAll ¶
func (m *GetExampleListPageRes) ValidateAll() error
ValidateAll checks the field values on GetExampleListPageRes 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 GetExampleListPageResMultiError, or nil if none found.
type GetExampleListPageResMultiError ¶
type GetExampleListPageResMultiError []error
GetExampleListPageResMultiError is an error wrapping multiple validation errors returned by GetExampleListPageRes.ValidateAll() if the designated constraints aren't met.
func (GetExampleListPageResMultiError) AllErrors ¶
func (m GetExampleListPageResMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (GetExampleListPageResMultiError) Error ¶
func (m GetExampleListPageResMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type GetExampleListPageResValidationError ¶
type GetExampleListPageResValidationError struct {
// contains filtered or unexported fields
}
GetExampleListPageResValidationError is the validation error returned by GetExampleListPageRes.Validate if the designated constraints aren't met.
func (GetExampleListPageResValidationError) Cause ¶
func (e GetExampleListPageResValidationError) Cause() error
Cause function returns cause value.
func (GetExampleListPageResValidationError) Error ¶
func (e GetExampleListPageResValidationError) Error() string
Error satisfies the builtin error interface
func (GetExampleListPageResValidationError) ErrorName ¶
func (e GetExampleListPageResValidationError) ErrorName() string
ErrorName returns error name.
func (GetExampleListPageResValidationError) Field ¶
func (e GetExampleListPageResValidationError) Field() string
Field function returns field value.
func (GetExampleListPageResValidationError) Key ¶
func (e GetExampleListPageResValidationError) Key() bool
Key function returns key value.
func (GetExampleListPageResValidationError) Reason ¶
func (e GetExampleListPageResValidationError) Reason() string
Reason function returns reason value.
type GetExampleListReq ¶
type GetExampleListReq struct { // 主键id Page int64 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` // 页记录数 PageSize int64 `protobuf:"varint,2,opt,name=pageSize,proto3" json:"pageSize,omitempty"` // 名称 Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` // 状态 true正常 false冻结 Status *wrapperspb.BoolValue `protobuf:"bytes,4,opt,name=status,proto3" json:"status,omitempty"` // contains filtered or unexported fields }
请求 - 分页列表
func (*GetExampleListReq) Descriptor
deprecated
func (*GetExampleListReq) Descriptor() ([]byte, []int)
Deprecated: Use GetExampleListReq.ProtoReflect.Descriptor instead.
func (*GetExampleListReq) GetName ¶
func (x *GetExampleListReq) GetName() string
func (*GetExampleListReq) GetPage ¶
func (x *GetExampleListReq) GetPage() int64
func (*GetExampleListReq) GetPageSize ¶
func (x *GetExampleListReq) GetPageSize() int64
func (*GetExampleListReq) GetStatus ¶
func (x *GetExampleListReq) GetStatus() *wrapperspb.BoolValue
func (*GetExampleListReq) ProtoMessage ¶
func (*GetExampleListReq) ProtoMessage()
func (*GetExampleListReq) ProtoReflect ¶
func (x *GetExampleListReq) ProtoReflect() protoreflect.Message
func (*GetExampleListReq) Reset ¶
func (x *GetExampleListReq) Reset()
func (*GetExampleListReq) String ¶
func (x *GetExampleListReq) String() string
func (*GetExampleListReq) Validate ¶
func (m *GetExampleListReq) Validate() error
Validate checks the field values on GetExampleListReq 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 (*GetExampleListReq) ValidateAll ¶
func (m *GetExampleListReq) ValidateAll() error
ValidateAll checks the field values on GetExampleListReq 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 GetExampleListReqMultiError, or nil if none found.
type GetExampleListReqMultiError ¶
type GetExampleListReqMultiError []error
GetExampleListReqMultiError is an error wrapping multiple validation errors returned by GetExampleListReq.ValidateAll() if the designated constraints aren't met.
func (GetExampleListReqMultiError) AllErrors ¶
func (m GetExampleListReqMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (GetExampleListReqMultiError) Error ¶
func (m GetExampleListReqMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type GetExampleListReqValidationError ¶
type GetExampleListReqValidationError struct {
// contains filtered or unexported fields
}
GetExampleListReqValidationError is the validation error returned by GetExampleListReq.Validate if the designated constraints aren't met.
func (GetExampleListReqValidationError) Cause ¶
func (e GetExampleListReqValidationError) Cause() error
Cause function returns cause value.
func (GetExampleListReqValidationError) Error ¶
func (e GetExampleListReqValidationError) Error() string
Error satisfies the builtin error interface
func (GetExampleListReqValidationError) ErrorName ¶
func (e GetExampleListReqValidationError) ErrorName() string
ErrorName returns error name.
func (GetExampleListReqValidationError) Field ¶
func (e GetExampleListReqValidationError) Field() string
Field function returns field value.
func (GetExampleListReqValidationError) Key ¶
func (e GetExampleListReqValidationError) Key() bool
Key function returns key value.
func (GetExampleListReqValidationError) Reason ¶
func (e GetExampleListReqValidationError) Reason() string
Reason function returns reason value.
type UnimplementedExampleServiceServer ¶
type UnimplementedExampleServiceServer struct { }
UnimplementedExampleServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedExampleServiceServer) CreateExample ¶
func (UnimplementedExampleServiceServer) CreateExample(context.Context, *CreateExampleReq) (*Example, error)
func (UnimplementedExampleServiceServer) DeleteExample ¶
func (UnimplementedExampleServiceServer) DeleteExample(context.Context, *ExampleIdReq) (*CheckResponse, error)
func (UnimplementedExampleServiceServer) GetExample ¶
func (UnimplementedExampleServiceServer) GetExample(context.Context, *ExampleIdReq) (*Example, error)
func (UnimplementedExampleServiceServer) GetExampleList ¶
func (UnimplementedExampleServiceServer) GetExampleList(context.Context, *GetExampleListReq) (*GetExampleListPageRes, error)
func (UnimplementedExampleServiceServer) RecoverExample ¶
func (UnimplementedExampleServiceServer) RecoverExample(context.Context, *ExampleIdReq) (*CheckResponse, error)
func (UnimplementedExampleServiceServer) UpdateExample ¶
func (UnimplementedExampleServiceServer) UpdateExample(context.Context, *UpdateExampleReq) (*CheckResponse, error)
type UnsafeExampleServiceServer ¶
type UnsafeExampleServiceServer interface {
// contains filtered or unexported methods
}
UnsafeExampleServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ExampleServiceServer will result in compilation errors.
type UpdateExampleReq ¶
type UpdateExampleReq struct { // 主键id Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // 名称 Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // 状态 Status bool `protobuf:"varint,3,opt,name=status,proto3" json:"status,omitempty"` // contains filtered or unexported fields }
请求 - 更新
func (*UpdateExampleReq) Descriptor
deprecated
func (*UpdateExampleReq) Descriptor() ([]byte, []int)
Deprecated: Use UpdateExampleReq.ProtoReflect.Descriptor instead.
func (*UpdateExampleReq) GetId ¶
func (x *UpdateExampleReq) GetId() int64
func (*UpdateExampleReq) GetName ¶
func (x *UpdateExampleReq) GetName() string
func (*UpdateExampleReq) GetStatus ¶
func (x *UpdateExampleReq) GetStatus() bool
func (*UpdateExampleReq) ProtoMessage ¶
func (*UpdateExampleReq) ProtoMessage()
func (*UpdateExampleReq) ProtoReflect ¶
func (x *UpdateExampleReq) ProtoReflect() protoreflect.Message
func (*UpdateExampleReq) Reset ¶
func (x *UpdateExampleReq) Reset()
func (*UpdateExampleReq) String ¶
func (x *UpdateExampleReq) String() string
func (*UpdateExampleReq) Validate ¶
func (m *UpdateExampleReq) Validate() error
Validate checks the field values on UpdateExampleReq 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 (*UpdateExampleReq) ValidateAll ¶
func (m *UpdateExampleReq) ValidateAll() error
ValidateAll checks the field values on UpdateExampleReq 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 UpdateExampleReqMultiError, or nil if none found.
type UpdateExampleReqMultiError ¶
type UpdateExampleReqMultiError []error
UpdateExampleReqMultiError is an error wrapping multiple validation errors returned by UpdateExampleReq.ValidateAll() if the designated constraints aren't met.
func (UpdateExampleReqMultiError) AllErrors ¶
func (m UpdateExampleReqMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (UpdateExampleReqMultiError) Error ¶
func (m UpdateExampleReqMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type UpdateExampleReqValidationError ¶
type UpdateExampleReqValidationError struct {
// contains filtered or unexported fields
}
UpdateExampleReqValidationError is the validation error returned by UpdateExampleReq.Validate if the designated constraints aren't met.
func (UpdateExampleReqValidationError) Cause ¶
func (e UpdateExampleReqValidationError) Cause() error
Cause function returns cause value.
func (UpdateExampleReqValidationError) Error ¶
func (e UpdateExampleReqValidationError) Error() string
Error satisfies the builtin error interface
func (UpdateExampleReqValidationError) ErrorName ¶
func (e UpdateExampleReqValidationError) ErrorName() string
ErrorName returns error name.
func (UpdateExampleReqValidationError) Field ¶
func (e UpdateExampleReqValidationError) Field() string
Field function returns field value.
func (UpdateExampleReqValidationError) Key ¶
func (e UpdateExampleReqValidationError) Key() bool
Key function returns key value.
func (UpdateExampleReqValidationError) Reason ¶
func (e UpdateExampleReqValidationError) Reason() string
Reason function returns reason value.