Documentation ¶
Overview ¶
Package category_service is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterCategoryServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterCategoryServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client CategoryServiceClient) error
- func RegisterCategoryServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterCategoryServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CategoryServiceServer) error
- func RegisterCategoryServiceServer(s grpc.ServiceRegistrar, srv CategoryServiceServer)
- type Category
- func (*Category) Descriptor() ([]byte, []int)deprecated
- func (x *Category) GetCreated() *timestamppb.Timestamp
- func (x *Category) GetId() uint64
- func (x *Category) GetName() string
- func (*Category) ProtoMessage()
- func (x *Category) ProtoReflect() protoreflect.Message
- func (x *Category) Reset()
- func (x *Category) String() string
- func (m *Category) Validate() error
- type CategoryServiceClient
- type CategoryServiceServer
- type CategoryValidationError
- type GetCategoryByIdRequest
- func (*GetCategoryByIdRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetCategoryByIdRequest) GetId() uint64
- func (*GetCategoryByIdRequest) ProtoMessage()
- func (x *GetCategoryByIdRequest) ProtoReflect() protoreflect.Message
- func (x *GetCategoryByIdRequest) Reset()
- func (x *GetCategoryByIdRequest) String() string
- func (m *GetCategoryByIdRequest) Validate() error
- type GetCategoryByIdRequestValidationError
- func (e GetCategoryByIdRequestValidationError) Cause() error
- func (e GetCategoryByIdRequestValidationError) Error() string
- func (e GetCategoryByIdRequestValidationError) ErrorName() string
- func (e GetCategoryByIdRequestValidationError) Field() string
- func (e GetCategoryByIdRequestValidationError) Key() bool
- func (e GetCategoryByIdRequestValidationError) Reason() string
- type GetCategoryByIdResponse
- func (*GetCategoryByIdResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetCategoryByIdResponse) GetCategory() *Category
- func (*GetCategoryByIdResponse) ProtoMessage()
- func (x *GetCategoryByIdResponse) ProtoReflect() protoreflect.Message
- func (x *GetCategoryByIdResponse) Reset()
- func (x *GetCategoryByIdResponse) String() string
- func (m *GetCategoryByIdResponse) Validate() error
- type GetCategoryByIdResponseValidationError
- func (e GetCategoryByIdResponseValidationError) Cause() error
- func (e GetCategoryByIdResponseValidationError) Error() string
- func (e GetCategoryByIdResponseValidationError) ErrorName() string
- func (e GetCategoryByIdResponseValidationError) Field() string
- func (e GetCategoryByIdResponseValidationError) Key() bool
- func (e GetCategoryByIdResponseValidationError) Reason() string
- type UnimplementedCategoryServiceServer
- type UnsafeCategoryServiceServer
Constants ¶
This section is empty.
Variables ¶
var CategoryService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "psymaza.category_service.v1.CategoryService", HandlerType: (*CategoryServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetCategoryById", Handler: _CategoryService_GetCategoryById_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "psymaza/category_service/v1/category_service.proto", }
CategoryService_ServiceDesc is the grpc.ServiceDesc for CategoryService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_psymaza_category_service_v1_category_service_proto protoreflect.FileDescriptor
Functions ¶
func RegisterCategoryServiceHandler ¶
func RegisterCategoryServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterCategoryServiceHandler registers the http handlers for service CategoryService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterCategoryServiceHandlerClient ¶
func RegisterCategoryServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client CategoryServiceClient) error
RegisterCategoryServiceHandlerClient registers the http handlers for service CategoryService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "CategoryServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "CategoryServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "CategoryServiceClient" to call the correct interceptors.
func RegisterCategoryServiceHandlerFromEndpoint ¶
func RegisterCategoryServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterCategoryServiceHandlerFromEndpoint is same as RegisterCategoryServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterCategoryServiceHandlerServer ¶
func RegisterCategoryServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CategoryServiceServer) error
RegisterCategoryServiceHandlerServer registers the http handlers for service CategoryService to "mux". UnaryRPC :call CategoryServiceServer 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 RegisterCategoryServiceHandlerFromEndpoint instead.
func RegisterCategoryServiceServer ¶
func RegisterCategoryServiceServer(s grpc.ServiceRegistrar, srv CategoryServiceServer)
Types ¶
type Category ¶
type Category struct { Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Created *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=created,proto3" json:"created,omitempty"` // contains filtered or unexported fields }
func (*Category) Descriptor
deprecated
func (*Category) GetCreated ¶
func (x *Category) GetCreated() *timestamppb.Timestamp
func (*Category) ProtoMessage ¶
func (*Category) ProtoMessage()
func (*Category) ProtoReflect ¶
func (x *Category) ProtoReflect() protoreflect.Message
type CategoryServiceClient ¶
type CategoryServiceClient interface {
GetCategoryById(ctx context.Context, in *GetCategoryByIdRequest, opts ...grpc.CallOption) (*GetCategoryByIdResponse, error)
}
CategoryServiceClient is the client API for CategoryService 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 NewCategoryServiceClient ¶
func NewCategoryServiceClient(cc grpc.ClientConnInterface) CategoryServiceClient
type CategoryServiceServer ¶
type CategoryServiceServer interface { GetCategoryById(context.Context, *GetCategoryByIdRequest) (*GetCategoryByIdResponse, error) // contains filtered or unexported methods }
CategoryServiceServer is the server API for CategoryService service. All implementations must embed UnimplementedCategoryServiceServer for forward compatibility
type CategoryValidationError ¶
type CategoryValidationError struct {
// contains filtered or unexported fields
}
CategoryValidationError is the validation error returned by Category.Validate if the designated constraints aren't met.
func (CategoryValidationError) Cause ¶
func (e CategoryValidationError) Cause() error
Cause function returns cause value.
func (CategoryValidationError) Error ¶
func (e CategoryValidationError) Error() string
Error satisfies the builtin error interface
func (CategoryValidationError) ErrorName ¶
func (e CategoryValidationError) ErrorName() string
ErrorName returns error name.
func (CategoryValidationError) Field ¶
func (e CategoryValidationError) Field() string
Field function returns field value.
func (CategoryValidationError) Key ¶
func (e CategoryValidationError) Key() bool
Key function returns key value.
func (CategoryValidationError) Reason ¶
func (e CategoryValidationError) Reason() string
Reason function returns reason value.
type GetCategoryByIdRequest ¶
type GetCategoryByIdRequest struct { Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*GetCategoryByIdRequest) Descriptor
deprecated
func (*GetCategoryByIdRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetCategoryByIdRequest.ProtoReflect.Descriptor instead.
func (*GetCategoryByIdRequest) GetId ¶
func (x *GetCategoryByIdRequest) GetId() uint64
func (*GetCategoryByIdRequest) ProtoMessage ¶
func (*GetCategoryByIdRequest) ProtoMessage()
func (*GetCategoryByIdRequest) ProtoReflect ¶
func (x *GetCategoryByIdRequest) ProtoReflect() protoreflect.Message
func (*GetCategoryByIdRequest) Reset ¶
func (x *GetCategoryByIdRequest) Reset()
func (*GetCategoryByIdRequest) String ¶
func (x *GetCategoryByIdRequest) String() string
func (*GetCategoryByIdRequest) Validate ¶
func (m *GetCategoryByIdRequest) Validate() error
Validate checks the field values on GetCategoryByIdRequest with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
type GetCategoryByIdRequestValidationError ¶
type GetCategoryByIdRequestValidationError struct {
// contains filtered or unexported fields
}
GetCategoryByIdRequestValidationError is the validation error returned by GetCategoryByIdRequest.Validate if the designated constraints aren't met.
func (GetCategoryByIdRequestValidationError) Cause ¶
func (e GetCategoryByIdRequestValidationError) Cause() error
Cause function returns cause value.
func (GetCategoryByIdRequestValidationError) Error ¶
func (e GetCategoryByIdRequestValidationError) Error() string
Error satisfies the builtin error interface
func (GetCategoryByIdRequestValidationError) ErrorName ¶
func (e GetCategoryByIdRequestValidationError) ErrorName() string
ErrorName returns error name.
func (GetCategoryByIdRequestValidationError) Field ¶
func (e GetCategoryByIdRequestValidationError) Field() string
Field function returns field value.
func (GetCategoryByIdRequestValidationError) Key ¶
func (e GetCategoryByIdRequestValidationError) Key() bool
Key function returns key value.
func (GetCategoryByIdRequestValidationError) Reason ¶
func (e GetCategoryByIdRequestValidationError) Reason() string
Reason function returns reason value.
type GetCategoryByIdResponse ¶
type GetCategoryByIdResponse struct { Category *Category `protobuf:"bytes,1,opt,name=category,proto3" json:"category,omitempty"` // contains filtered or unexported fields }
func (*GetCategoryByIdResponse) Descriptor
deprecated
func (*GetCategoryByIdResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetCategoryByIdResponse.ProtoReflect.Descriptor instead.
func (*GetCategoryByIdResponse) GetCategory ¶
func (x *GetCategoryByIdResponse) GetCategory() *Category
func (*GetCategoryByIdResponse) ProtoMessage ¶
func (*GetCategoryByIdResponse) ProtoMessage()
func (*GetCategoryByIdResponse) ProtoReflect ¶
func (x *GetCategoryByIdResponse) ProtoReflect() protoreflect.Message
func (*GetCategoryByIdResponse) Reset ¶
func (x *GetCategoryByIdResponse) Reset()
func (*GetCategoryByIdResponse) String ¶
func (x *GetCategoryByIdResponse) String() string
func (*GetCategoryByIdResponse) Validate ¶
func (m *GetCategoryByIdResponse) Validate() error
Validate checks the field values on GetCategoryByIdResponse with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
type GetCategoryByIdResponseValidationError ¶
type GetCategoryByIdResponseValidationError struct {
// contains filtered or unexported fields
}
GetCategoryByIdResponseValidationError is the validation error returned by GetCategoryByIdResponse.Validate if the designated constraints aren't met.
func (GetCategoryByIdResponseValidationError) Cause ¶
func (e GetCategoryByIdResponseValidationError) Cause() error
Cause function returns cause value.
func (GetCategoryByIdResponseValidationError) Error ¶
func (e GetCategoryByIdResponseValidationError) Error() string
Error satisfies the builtin error interface
func (GetCategoryByIdResponseValidationError) ErrorName ¶
func (e GetCategoryByIdResponseValidationError) ErrorName() string
ErrorName returns error name.
func (GetCategoryByIdResponseValidationError) Field ¶
func (e GetCategoryByIdResponseValidationError) Field() string
Field function returns field value.
func (GetCategoryByIdResponseValidationError) Key ¶
func (e GetCategoryByIdResponseValidationError) Key() bool
Key function returns key value.
func (GetCategoryByIdResponseValidationError) Reason ¶
func (e GetCategoryByIdResponseValidationError) Reason() string
Reason function returns reason value.
type UnimplementedCategoryServiceServer ¶
type UnimplementedCategoryServiceServer struct { }
UnimplementedCategoryServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedCategoryServiceServer) GetCategoryById ¶
func (UnimplementedCategoryServiceServer) GetCategoryById(context.Context, *GetCategoryByIdRequest) (*GetCategoryByIdResponse, error)
type UnsafeCategoryServiceServer ¶
type UnsafeCategoryServiceServer interface {
// contains filtered or unexported methods
}
UnsafeCategoryServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to CategoryServiceServer will result in compilation errors.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
google.golang.org
|
|
protobuf/types/known/timestamppb
Package timestamppb contains generated types for google/protobuf/timestamp.proto.
|
Package timestamppb contains generated types for google/protobuf/timestamp.proto. |