category_service

package module
v0.0.0-...-a8de05e Latest Latest
Warning

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

Go to latest
Published: May 10, 2022 License: MIT Imports: 29 Imported by: 0

Documentation

Overview

Package category_service is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
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)

View Source
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) Descriptor() ([]byte, []int)

Deprecated: Use Category.ProtoReflect.Descriptor instead.

func (*Category) GetCreated

func (x *Category) GetCreated() *timestamppb.Timestamp

func (*Category) GetId

func (x *Category) GetId() uint64

func (*Category) GetName

func (x *Category) GetName() string

func (*Category) ProtoMessage

func (*Category) ProtoMessage()

func (*Category) ProtoReflect

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

func (*Category) Reset

func (x *Category) Reset()

func (*Category) String

func (x *Category) String() string

func (*Category) Validate

func (m *Category) Validate() error

Validate checks the field values on Category with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

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.

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

Cause function returns cause value.

func (GetCategoryByIdRequestValidationError) Error

Error satisfies the builtin error interface

func (GetCategoryByIdRequestValidationError) ErrorName

ErrorName returns error name.

func (GetCategoryByIdRequestValidationError) Field

Field function returns field value.

func (GetCategoryByIdRequestValidationError) Key

Key function returns key value.

func (GetCategoryByIdRequestValidationError) Reason

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

Cause function returns cause value.

func (GetCategoryByIdResponseValidationError) Error

Error satisfies the builtin error interface

func (GetCategoryByIdResponseValidationError) ErrorName

ErrorName returns error name.

func (GetCategoryByIdResponseValidationError) Field

Field function returns field value.

func (GetCategoryByIdResponseValidationError) Key

Key function returns key value.

func (GetCategoryByIdResponseValidationError) Reason

Reason function returns reason value.

type UnimplementedCategoryServiceServer

type UnimplementedCategoryServiceServer struct {
}

UnimplementedCategoryServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedCategoryServiceServer) GetCategoryById

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.

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.

Jump to

Keyboard shortcuts

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