Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterArticlesServiceServer(s grpc.ServiceRegistrar, srv ArticlesServiceServer)
- type Article
- func (*Article) Descriptor() ([]byte, []int)deprecated
- func (x *Article) GetAuthor() string
- func (x *Article) GetDescription() string
- func (x *Article) GetId() string
- func (x *Article) GetTitle() string
- func (*Article) ProtoMessage()
- func (x *Article) ProtoReflect() protoreflect.Message
- func (x *Article) Reset()
- func (x *Article) String() string
- type ArticlesServiceClient
- type ArticlesServiceServer
- type CreateArticleRequest
- func (*CreateArticleRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateArticleRequest) GetArticle() *Article
- func (*CreateArticleRequest) ProtoMessage()
- func (x *CreateArticleRequest) ProtoReflect() protoreflect.Message
- func (x *CreateArticleRequest) Reset()
- func (x *CreateArticleRequest) String() string
- type CreateArticleResponse
- func (*CreateArticleResponse) Descriptor() ([]byte, []int)deprecated
- func (x *CreateArticleResponse) GetArticle() *Article
- func (x *CreateArticleResponse) GetError() *Error
- func (m *CreateArticleResponse) GetResult() isCreateArticleResponse_Result
- func (*CreateArticleResponse) ProtoMessage()
- func (x *CreateArticleResponse) ProtoReflect() protoreflect.Message
- func (x *CreateArticleResponse) Reset()
- func (x *CreateArticleResponse) String() string
- type CreateArticleResponse_Article
- type CreateArticleResponse_Error
- type DeleteArticleRequest
- func (*DeleteArticleRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DeleteArticleRequest) GetArticleId() string
- func (*DeleteArticleRequest) ProtoMessage()
- func (x *DeleteArticleRequest) ProtoReflect() protoreflect.Message
- func (x *DeleteArticleRequest) Reset()
- func (x *DeleteArticleRequest) String() string
- type DeleteArticleResponse
- type Error
- type ErrorType
- type GetArticleRequest
- type GetArticleResponse
- func (*GetArticleResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetArticleResponse) GetArticle() *Article
- func (x *GetArticleResponse) GetError() *Error
- func (m *GetArticleResponse) GetResult() isGetArticleResponse_Result
- func (*GetArticleResponse) ProtoMessage()
- func (x *GetArticleResponse) ProtoReflect() protoreflect.Message
- func (x *GetArticleResponse) Reset()
- func (x *GetArticleResponse) String() string
- type GetArticleResponse_Article
- type GetArticleResponse_Error
- type UnimplementedArticlesServiceServer
- func (UnimplementedArticlesServiceServer) CreateArticle(context.Context, *CreateArticleRequest) (*CreateArticleResponse, error)
- func (UnimplementedArticlesServiceServer) DeleteArticle(context.Context, *DeleteArticleRequest) (*DeleteArticleResponse, error)
- func (UnimplementedArticlesServiceServer) GetArticle(context.Context, *GetArticleRequest) (*GetArticleResponse, error)
- func (UnimplementedArticlesServiceServer) UpdateArticle(context.Context, *UpdateArticleRequest) (*UpdateArticleResponse, error)
- type UnsafeArticlesServiceServer
- type UpdateArticleRequest
- func (*UpdateArticleRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateArticleRequest) GetArticle() *Article
- func (*UpdateArticleRequest) ProtoMessage()
- func (x *UpdateArticleRequest) ProtoReflect() protoreflect.Message
- func (x *UpdateArticleRequest) Reset()
- func (x *UpdateArticleRequest) String() string
- type UpdateArticleResponse
- func (*UpdateArticleResponse) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateArticleResponse) GetArticle() *Article
- func (x *UpdateArticleResponse) GetError() *Error
- func (m *UpdateArticleResponse) GetResult() isUpdateArticleResponse_Result
- func (*UpdateArticleResponse) ProtoMessage()
- func (x *UpdateArticleResponse) ProtoReflect() protoreflect.Message
- func (x *UpdateArticleResponse) Reset()
- func (x *UpdateArticleResponse) String() string
- type UpdateArticleResponse_Article
- type UpdateArticleResponse_Error
Constants ¶
const ( ArticlesService_GetArticle_FullMethodName = "/ArticlesService/GetArticle" ArticlesService_CreateArticle_FullMethodName = "/ArticlesService/CreateArticle" ArticlesService_UpdateArticle_FullMethodName = "/ArticlesService/UpdateArticle" ArticlesService_DeleteArticle_FullMethodName = "/ArticlesService/DeleteArticle" )
Variables ¶
var ( ErrorType_name = map[int32]string{ 0: "NOT_FOUND", 1: "ALREADY_EXISTS", 2: "UNSPECIFIED", } ErrorType_value = map[string]int32{ "NOT_FOUND": 0, "ALREADY_EXISTS": 1, "UNSPECIFIED": 2, } )
Enum value maps for ErrorType.
var ArticlesService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "ArticlesService", HandlerType: (*ArticlesServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetArticle", Handler: _ArticlesService_GetArticle_Handler, }, { MethodName: "CreateArticle", Handler: _ArticlesService_CreateArticle_Handler, }, { MethodName: "UpdateArticle", Handler: _ArticlesService_UpdateArticle_Handler, }, { MethodName: "DeleteArticle", Handler: _ArticlesService_DeleteArticle_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "proto/articles_service.proto", }
ArticlesService_ServiceDesc is the grpc.ServiceDesc for ArticlesService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_proto_articles_service_proto protoreflect.FileDescriptor
Functions ¶
func RegisterArticlesServiceServer ¶
func RegisterArticlesServiceServer(s grpc.ServiceRegistrar, srv ArticlesServiceServer)
Types ¶
type Article ¶
type Article struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` Author string `protobuf:"bytes,3,opt,name=author,proto3" json:"author,omitempty"` Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` // contains filtered or unexported fields }
func (*Article) Descriptor
deprecated
func (*Article) GetDescription ¶
func (*Article) ProtoMessage ¶
func (*Article) ProtoMessage()
func (*Article) ProtoReflect ¶
func (x *Article) ProtoReflect() protoreflect.Message
type ArticlesServiceClient ¶
type ArticlesServiceClient interface { GetArticle(ctx context.Context, in *GetArticleRequest, opts ...grpc.CallOption) (*GetArticleResponse, error) CreateArticle(ctx context.Context, in *CreateArticleRequest, opts ...grpc.CallOption) (*CreateArticleResponse, error) UpdateArticle(ctx context.Context, in *UpdateArticleRequest, opts ...grpc.CallOption) (*UpdateArticleResponse, error) DeleteArticle(ctx context.Context, in *DeleteArticleRequest, opts ...grpc.CallOption) (*DeleteArticleResponse, error) }
ArticlesServiceClient is the client API for ArticlesService 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 NewArticlesServiceClient ¶
func NewArticlesServiceClient(cc grpc.ClientConnInterface) ArticlesServiceClient
type ArticlesServiceServer ¶
type ArticlesServiceServer interface { GetArticle(context.Context, *GetArticleRequest) (*GetArticleResponse, error) CreateArticle(context.Context, *CreateArticleRequest) (*CreateArticleResponse, error) UpdateArticle(context.Context, *UpdateArticleRequest) (*UpdateArticleResponse, error) DeleteArticle(context.Context, *DeleteArticleRequest) (*DeleteArticleResponse, error) // contains filtered or unexported methods }
ArticlesServiceServer is the server API for ArticlesService service. All implementations must embed UnimplementedArticlesServiceServer for forward compatibility
type CreateArticleRequest ¶
type CreateArticleRequest struct { Article *Article `protobuf:"bytes,1,opt,name=article,proto3" json:"article,omitempty"` // contains filtered or unexported fields }
func (*CreateArticleRequest) Descriptor
deprecated
func (*CreateArticleRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateArticleRequest.ProtoReflect.Descriptor instead.
func (*CreateArticleRequest) GetArticle ¶
func (x *CreateArticleRequest) GetArticle() *Article
func (*CreateArticleRequest) ProtoMessage ¶
func (*CreateArticleRequest) ProtoMessage()
func (*CreateArticleRequest) ProtoReflect ¶
func (x *CreateArticleRequest) ProtoReflect() protoreflect.Message
func (*CreateArticleRequest) Reset ¶
func (x *CreateArticleRequest) Reset()
func (*CreateArticleRequest) String ¶
func (x *CreateArticleRequest) String() string
type CreateArticleResponse ¶
type CreateArticleResponse struct { // Types that are assignable to Result: // // *CreateArticleResponse_Error // *CreateArticleResponse_Article Result isCreateArticleResponse_Result `protobuf_oneof:"result"` // contains filtered or unexported fields }
func (*CreateArticleResponse) Descriptor
deprecated
func (*CreateArticleResponse) Descriptor() ([]byte, []int)
Deprecated: Use CreateArticleResponse.ProtoReflect.Descriptor instead.
func (*CreateArticleResponse) GetArticle ¶
func (x *CreateArticleResponse) GetArticle() *Article
func (*CreateArticleResponse) GetError ¶ added in v0.0.2
func (x *CreateArticleResponse) GetError() *Error
func (*CreateArticleResponse) GetResult ¶ added in v0.0.2
func (m *CreateArticleResponse) GetResult() isCreateArticleResponse_Result
func (*CreateArticleResponse) ProtoMessage ¶
func (*CreateArticleResponse) ProtoMessage()
func (*CreateArticleResponse) ProtoReflect ¶
func (x *CreateArticleResponse) ProtoReflect() protoreflect.Message
func (*CreateArticleResponse) Reset ¶
func (x *CreateArticleResponse) Reset()
func (*CreateArticleResponse) String ¶
func (x *CreateArticleResponse) String() string
type CreateArticleResponse_Article ¶ added in v0.0.2
type CreateArticleResponse_Article struct {
Article *Article `protobuf:"bytes,2,opt,name=article,proto3,oneof"`
}
type CreateArticleResponse_Error ¶ added in v0.0.2
type CreateArticleResponse_Error struct {
Error *Error `protobuf:"bytes,1,opt,name=error,proto3,oneof"`
}
type DeleteArticleRequest ¶
type DeleteArticleRequest struct { ArticleId string `protobuf:"bytes,1,opt,name=article_id,json=articleId,proto3" json:"article_id,omitempty"` // contains filtered or unexported fields }
func (*DeleteArticleRequest) Descriptor
deprecated
func (*DeleteArticleRequest) Descriptor() ([]byte, []int)
Deprecated: Use DeleteArticleRequest.ProtoReflect.Descriptor instead.
func (*DeleteArticleRequest) GetArticleId ¶
func (x *DeleteArticleRequest) GetArticleId() string
func (*DeleteArticleRequest) ProtoMessage ¶
func (*DeleteArticleRequest) ProtoMessage()
func (*DeleteArticleRequest) ProtoReflect ¶
func (x *DeleteArticleRequest) ProtoReflect() protoreflect.Message
func (*DeleteArticleRequest) Reset ¶
func (x *DeleteArticleRequest) Reset()
func (*DeleteArticleRequest) String ¶
func (x *DeleteArticleRequest) String() string
type DeleteArticleResponse ¶
type DeleteArticleResponse struct {
// contains filtered or unexported fields
}
func (*DeleteArticleResponse) Descriptor
deprecated
func (*DeleteArticleResponse) Descriptor() ([]byte, []int)
Deprecated: Use DeleteArticleResponse.ProtoReflect.Descriptor instead.
func (*DeleteArticleResponse) ProtoMessage ¶
func (*DeleteArticleResponse) ProtoMessage()
func (*DeleteArticleResponse) ProtoReflect ¶
func (x *DeleteArticleResponse) ProtoReflect() protoreflect.Message
func (*DeleteArticleResponse) Reset ¶
func (x *DeleteArticleResponse) Reset()
func (*DeleteArticleResponse) String ¶
func (x *DeleteArticleResponse) String() string
type Error ¶ added in v0.0.2
type Error struct { Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` Type ErrorType `protobuf:"varint,2,opt,name=type,proto3,enum=ErrorType" json:"type,omitempty"` // contains filtered or unexported fields }
func (*Error) Descriptor
deprecated
added in
v0.0.2
func (*Error) GetMessage ¶ added in v0.0.2
func (*Error) ProtoMessage ¶ added in v0.0.2
func (*Error) ProtoMessage()
func (*Error) ProtoReflect ¶ added in v0.0.2
func (x *Error) ProtoReflect() protoreflect.Message
type ErrorType ¶ added in v0.0.2
type ErrorType int32
func (ErrorType) Descriptor ¶ added in v0.0.2
func (ErrorType) Descriptor() protoreflect.EnumDescriptor
func (ErrorType) EnumDescriptor
deprecated
added in
v0.0.2
func (ErrorType) Number ¶ added in v0.0.2
func (x ErrorType) Number() protoreflect.EnumNumber
func (ErrorType) Type ¶ added in v0.0.2
func (ErrorType) Type() protoreflect.EnumType
type GetArticleRequest ¶
type GetArticleRequest struct { ArticleId string `protobuf:"bytes,1,opt,name=article_id,json=articleId,proto3" json:"article_id,omitempty"` // contains filtered or unexported fields }
func (*GetArticleRequest) Descriptor
deprecated
func (*GetArticleRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetArticleRequest.ProtoReflect.Descriptor instead.
func (*GetArticleRequest) GetArticleId ¶
func (x *GetArticleRequest) GetArticleId() string
func (*GetArticleRequest) ProtoMessage ¶
func (*GetArticleRequest) ProtoMessage()
func (*GetArticleRequest) ProtoReflect ¶
func (x *GetArticleRequest) ProtoReflect() protoreflect.Message
func (*GetArticleRequest) Reset ¶
func (x *GetArticleRequest) Reset()
func (*GetArticleRequest) String ¶
func (x *GetArticleRequest) String() string
type GetArticleResponse ¶
type GetArticleResponse struct { // Types that are assignable to Result: // // *GetArticleResponse_Error // *GetArticleResponse_Article Result isGetArticleResponse_Result `protobuf_oneof:"result"` // contains filtered or unexported fields }
func (*GetArticleResponse) Descriptor
deprecated
func (*GetArticleResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetArticleResponse.ProtoReflect.Descriptor instead.
func (*GetArticleResponse) GetArticle ¶
func (x *GetArticleResponse) GetArticle() *Article
func (*GetArticleResponse) GetError ¶ added in v0.0.2
func (x *GetArticleResponse) GetError() *Error
func (*GetArticleResponse) GetResult ¶ added in v0.0.2
func (m *GetArticleResponse) GetResult() isGetArticleResponse_Result
func (*GetArticleResponse) ProtoMessage ¶
func (*GetArticleResponse) ProtoMessage()
func (*GetArticleResponse) ProtoReflect ¶
func (x *GetArticleResponse) ProtoReflect() protoreflect.Message
func (*GetArticleResponse) Reset ¶
func (x *GetArticleResponse) Reset()
func (*GetArticleResponse) String ¶
func (x *GetArticleResponse) String() string
type GetArticleResponse_Article ¶ added in v0.0.2
type GetArticleResponse_Article struct {
Article *Article `protobuf:"bytes,2,opt,name=article,proto3,oneof"`
}
type GetArticleResponse_Error ¶ added in v0.0.2
type GetArticleResponse_Error struct {
Error *Error `protobuf:"bytes,1,opt,name=error,proto3,oneof"`
}
type UnimplementedArticlesServiceServer ¶
type UnimplementedArticlesServiceServer struct { }
UnimplementedArticlesServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedArticlesServiceServer) CreateArticle ¶
func (UnimplementedArticlesServiceServer) CreateArticle(context.Context, *CreateArticleRequest) (*CreateArticleResponse, error)
func (UnimplementedArticlesServiceServer) DeleteArticle ¶
func (UnimplementedArticlesServiceServer) DeleteArticle(context.Context, *DeleteArticleRequest) (*DeleteArticleResponse, error)
func (UnimplementedArticlesServiceServer) GetArticle ¶
func (UnimplementedArticlesServiceServer) GetArticle(context.Context, *GetArticleRequest) (*GetArticleResponse, error)
func (UnimplementedArticlesServiceServer) UpdateArticle ¶
func (UnimplementedArticlesServiceServer) UpdateArticle(context.Context, *UpdateArticleRequest) (*UpdateArticleResponse, error)
type UnsafeArticlesServiceServer ¶
type UnsafeArticlesServiceServer interface {
// contains filtered or unexported methods
}
UnsafeArticlesServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ArticlesServiceServer will result in compilation errors.
type UpdateArticleRequest ¶
type UpdateArticleRequest struct { Article *Article `protobuf:"bytes,1,opt,name=article,proto3" json:"article,omitempty"` // contains filtered or unexported fields }
func (*UpdateArticleRequest) Descriptor
deprecated
func (*UpdateArticleRequest) Descriptor() ([]byte, []int)
Deprecated: Use UpdateArticleRequest.ProtoReflect.Descriptor instead.
func (*UpdateArticleRequest) GetArticle ¶
func (x *UpdateArticleRequest) GetArticle() *Article
func (*UpdateArticleRequest) ProtoMessage ¶
func (*UpdateArticleRequest) ProtoMessage()
func (*UpdateArticleRequest) ProtoReflect ¶
func (x *UpdateArticleRequest) ProtoReflect() protoreflect.Message
func (*UpdateArticleRequest) Reset ¶
func (x *UpdateArticleRequest) Reset()
func (*UpdateArticleRequest) String ¶
func (x *UpdateArticleRequest) String() string
type UpdateArticleResponse ¶
type UpdateArticleResponse struct { // Types that are assignable to Result: // // *UpdateArticleResponse_Error // *UpdateArticleResponse_Article Result isUpdateArticleResponse_Result `protobuf_oneof:"result"` // contains filtered or unexported fields }
func (*UpdateArticleResponse) Descriptor
deprecated
func (*UpdateArticleResponse) Descriptor() ([]byte, []int)
Deprecated: Use UpdateArticleResponse.ProtoReflect.Descriptor instead.
func (*UpdateArticleResponse) GetArticle ¶
func (x *UpdateArticleResponse) GetArticle() *Article
func (*UpdateArticleResponse) GetError ¶ added in v0.0.2
func (x *UpdateArticleResponse) GetError() *Error
func (*UpdateArticleResponse) GetResult ¶ added in v0.0.2
func (m *UpdateArticleResponse) GetResult() isUpdateArticleResponse_Result
func (*UpdateArticleResponse) ProtoMessage ¶
func (*UpdateArticleResponse) ProtoMessage()
func (*UpdateArticleResponse) ProtoReflect ¶
func (x *UpdateArticleResponse) ProtoReflect() protoreflect.Message
func (*UpdateArticleResponse) Reset ¶
func (x *UpdateArticleResponse) Reset()
func (*UpdateArticleResponse) String ¶
func (x *UpdateArticleResponse) String() string
type UpdateArticleResponse_Article ¶ added in v0.0.2
type UpdateArticleResponse_Article struct {
Article *Article `protobuf:"bytes,2,opt,name=article,proto3,oneof"`
}
type UpdateArticleResponse_Error ¶ added in v0.0.2
type UpdateArticleResponse_Error struct {
Error *Error `protobuf:"bytes,1,opt,name=error,proto3,oneof"`
}