Documentation ¶
Index ¶
- Variables
- func ErrorAccessForbidden(format string, args ...any) *errors.Error
- func ErrorForbidden(format string, args ...any) *errors.Error
- func ErrorInvalidParameter(format string, args ...any) *errors.Error
- func ErrorNotFound(format string, args ...any) *errors.Error
- func ErrorRateLimited(format string, args ...any) *errors.Error
- func ErrorSystemError(format string, args ...any) *errors.Error
- func ErrorUnauthenticated(format string, args ...any) *errors.Error
- func IsAccessForbidden(err error) bool
- func IsForbidden(err error) bool
- func IsInvalidParameter(err error) bool
- func IsNotFound(err error) bool
- func IsRateLimited(err error) bool
- func IsSystemError(err error) bool
- func IsUnauthenticated(err error) bool
- func RegisterBlogServiceHTTPServer(r gee.Router, srv BlogServiceHTTPServer, middlewares ...gee.Handler)
- type Article
- func (*Article) Descriptor() ([]byte, []int)deprecated
- func (x *Article) GetContent() string
- func (x *Article) GetCreatedAt() *timestamppb.Timestamp
- func (x *Article) GetId() int32
- func (x *Article) GetLike() int64
- func (x *Article) GetTitle() string
- func (x *Article) GetUpdatedAt() *timestamppb.Timestamp
- func (*Article) ProtoMessage()
- func (x *Article) ProtoReflect() protoreflect.Message
- func (x *Article) Reset()
- func (x *Article) String() string
- type BlogService
- func (r *BlogService) Create(c *gee.Context) error
- func (r *BlogService) DeleteArticle(c *gee.Context) error
- func (r *BlogService) GetArticle(c *gee.Context) error
- func (r *BlogService) ListArticle(c *gee.Context) error
- func (r *BlogService) RegisterService()
- func (r *BlogService) UpdateArticle(c *gee.Context) error
- func (r *BlogService) Validate(in any) error
- type BlogServiceHTTPClient
- type BlogServiceHTTPClientImpl
- func (c *BlogServiceHTTPClientImpl) Create(ctx context.Context, in *CreateArticleRequest) (*CreateArticleResponse, error)
- func (c *BlogServiceHTTPClientImpl) DeleteArticle(ctx context.Context, in *DeleteArticleRequest) (*DeleteArticleResponse, error)
- func (c *BlogServiceHTTPClientImpl) GetArticle(ctx context.Context, in *GetArticleRequest) (*GetArticleResponse, error)
- func (c *BlogServiceHTTPClientImpl) ListArticle(ctx context.Context, in *ListArticleRequest) (*ListArticleResponse, error)
- func (c *BlogServiceHTTPClientImpl) UpdateArticle(ctx context.Context, in *UpdateArticleRequest) (*UpdateArticleResponse, error)
- func (c *BlogServiceHTTPClientImpl) Validate(in any) error
- type BlogServiceHTTPServer
- type CreateArticleRequest
- func (*CreateArticleRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateArticleRequest) GetContent() string
- func (x *CreateArticleRequest) GetTitle() string
- 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 (*CreateArticleResponse) ProtoMessage()
- func (x *CreateArticleResponse) ProtoReflect() protoreflect.Message
- func (x *CreateArticleResponse) Reset()
- func (x *CreateArticleResponse) String() string
- type DeleteArticleRequest
- func (*DeleteArticleRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DeleteArticleRequest) GetId() int64
- func (*DeleteArticleRequest) ProtoMessage()
- func (x *DeleteArticleRequest) ProtoReflect() protoreflect.Message
- func (x *DeleteArticleRequest) Reset()
- func (x *DeleteArticleRequest) String() string
- type DeleteArticleResponse
- 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 GetArticleRequest
- type GetArticleResponse
- func (*GetArticleResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetArticleResponse) GetArticle() *Article
- func (*GetArticleResponse) ProtoMessage()
- func (x *GetArticleResponse) ProtoReflect() protoreflect.Message
- func (x *GetArticleResponse) Reset()
- func (x *GetArticleResponse) String() string
- type ListArticleRequest
- type ListArticleResponse
- func (*ListArticleResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ListArticleResponse) GetResults() []*Article
- func (*ListArticleResponse) ProtoMessage()
- func (x *ListArticleResponse) ProtoReflect() protoreflect.Message
- func (x *ListArticleResponse) Reset()
- func (x *ListArticleResponse) String() string
- type UpdateArticleRequest
- func (*UpdateArticleRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateArticleRequest) GetContent() string
- func (x *UpdateArticleRequest) GetId() int64
- func (x *UpdateArticleRequest) GetTitle() string
- 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 (*UpdateArticleResponse) ProtoMessage()
- func (x *UpdateArticleResponse) ProtoReflect() protoreflect.Message
- func (x *UpdateArticleResponse) Reset()
- func (x *UpdateArticleResponse) String() string
Constants ¶
This section is empty.
Variables ¶
var ( ErrorReason_name = map[int32]string{ 0: "InvalidParameter", 1: "AccessForbidden", 2: "Unauthenticated", 3: "RateLimited", 4: "SystemError", 5: "NotFound", 6: "Forbidden", } ErrorReason_value = map[string]int32{ "InvalidParameter": 0, "AccessForbidden": 1, "Unauthenticated": 2, "RateLimited": 3, "SystemError": 4, "NotFound": 5, "Forbidden": 6, } )
Enum value maps for ErrorReason.
var File_proto_demo_v1_blog_proto protoreflect.FileDescriptor
var File_proto_demo_v1_error_reason_proto protoreflect.FileDescriptor
Functions ¶
func IsAccessForbidden ¶
func IsForbidden ¶
func IsInvalidParameter ¶
func IsNotFound ¶
func IsRateLimited ¶
func IsSystemError ¶
func IsUnauthenticated ¶
func RegisterBlogServiceHTTPServer ¶
func RegisterBlogServiceHTTPServer(r gee.Router, srv BlogServiceHTTPServer, middlewares ...gee.Handler)
Types ¶
type Article ¶
type Article struct { Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` Content string `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"` Like int64 `protobuf:"varint,4,opt,name=like,proto3" json:"like,omitempty"` CreatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` // contains filtered or unexported fields }
func (*Article) Descriptor
deprecated
func (*Article) GetContent ¶
func (*Article) GetCreatedAt ¶
func (x *Article) GetCreatedAt() *timestamppb.Timestamp
func (*Article) GetUpdatedAt ¶
func (x *Article) GetUpdatedAt() *timestamppb.Timestamp
func (*Article) ProtoMessage ¶
func (*Article) ProtoMessage()
func (*Article) ProtoReflect ¶
func (x *Article) ProtoReflect() protoreflect.Message
type BlogService ¶
type BlogService struct {
// contains filtered or unexported fields
}
func (*BlogService) DeleteArticle ¶
func (r *BlogService) DeleteArticle(c *gee.Context) error
func (*BlogService) GetArticle ¶
func (r *BlogService) GetArticle(c *gee.Context) error
func (*BlogService) ListArticle ¶
func (r *BlogService) ListArticle(c *gee.Context) error
func (*BlogService) RegisterService ¶
func (r *BlogService) RegisterService()
func (*BlogService) UpdateArticle ¶
func (r *BlogService) UpdateArticle(c *gee.Context) error
func (*BlogService) Validate ¶
func (r *BlogService) Validate(in any) error
type BlogServiceHTTPClient ¶
type BlogServiceHTTPClient interface { Create(ctx context.Context, req *CreateArticleRequest) (rsp *CreateArticleResponse, err error) DeleteArticle(ctx context.Context, req *DeleteArticleRequest) (rsp *DeleteArticleResponse, err error) GetArticle(ctx context.Context, req *GetArticleRequest) (rsp *GetArticleResponse, err error) ListArticle(ctx context.Context, req *ListArticleRequest) (rsp *ListArticleResponse, err error) UpdateArticle(ctx context.Context, req *UpdateArticleRequest) (rsp *UpdateArticleResponse, err error) }
func NewBlogServiceHTTPClient ¶
func NewBlogServiceHTTPClient(httpClient *http.Client, endpoint string, options ...gee.ClientOption) BlogServiceHTTPClient
type BlogServiceHTTPClientImpl ¶
type BlogServiceHTTPClientImpl struct {
// contains filtered or unexported fields
}
func (*BlogServiceHTTPClientImpl) Create ¶
func (c *BlogServiceHTTPClientImpl) Create(ctx context.Context, in *CreateArticleRequest) (*CreateArticleResponse, error)
func (*BlogServiceHTTPClientImpl) DeleteArticle ¶
func (c *BlogServiceHTTPClientImpl) DeleteArticle(ctx context.Context, in *DeleteArticleRequest) (*DeleteArticleResponse, error)
func (*BlogServiceHTTPClientImpl) GetArticle ¶
func (c *BlogServiceHTTPClientImpl) GetArticle(ctx context.Context, in *GetArticleRequest) (*GetArticleResponse, error)
func (*BlogServiceHTTPClientImpl) ListArticle ¶
func (c *BlogServiceHTTPClientImpl) ListArticle(ctx context.Context, in *ListArticleRequest) (*ListArticleResponse, error)
func (*BlogServiceHTTPClientImpl) UpdateArticle ¶
func (c *BlogServiceHTTPClientImpl) UpdateArticle(ctx context.Context, in *UpdateArticleRequest) (*UpdateArticleResponse, error)
func (*BlogServiceHTTPClientImpl) Validate ¶
func (c *BlogServiceHTTPClientImpl) Validate(in any) error
type BlogServiceHTTPServer ¶
type BlogServiceHTTPServer interface { Create(context.Context, *CreateArticleRequest) (*CreateArticleResponse, error) DeleteArticle(context.Context, *DeleteArticleRequest) (*DeleteArticleResponse, error) GetArticle(context.Context, *GetArticleRequest) (*GetArticleResponse, error) ListArticle(context.Context, *ListArticleRequest) (*ListArticleResponse, error) UpdateArticle(context.Context, *UpdateArticleRequest) (*UpdateArticleResponse, error) }
type CreateArticleRequest ¶
type CreateArticleRequest struct { Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` // contains filtered or unexported fields }
func (*CreateArticleRequest) Descriptor
deprecated
func (*CreateArticleRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateArticleRequest.ProtoReflect.Descriptor instead.
func (*CreateArticleRequest) GetContent ¶
func (x *CreateArticleRequest) GetContent() string
func (*CreateArticleRequest) GetTitle ¶
func (x *CreateArticleRequest) GetTitle() string
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 { Article *Article `protobuf:"bytes,1,opt,name=article,proto3" json:"article,omitempty"` // 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) 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 DeleteArticleRequest ¶
type DeleteArticleRequest struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*DeleteArticleRequest) Descriptor
deprecated
func (*DeleteArticleRequest) Descriptor() ([]byte, []int)
Deprecated: Use DeleteArticleRequest.ProtoReflect.Descriptor instead.
func (*DeleteArticleRequest) GetId ¶
func (x *DeleteArticleRequest) GetId() int64
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 ErrorReason ¶
type ErrorReason int32
const ( ErrorReason_InvalidParameter ErrorReason = 0 ErrorReason_AccessForbidden ErrorReason = 1 ErrorReason_Unauthenticated ErrorReason = 2 ErrorReason_RateLimited ErrorReason = 3 ErrorReason_SystemError ErrorReason = 4 ErrorReason_NotFound ErrorReason = 5 ErrorReason_Forbidden ErrorReason = 6 )
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 GetArticleRequest ¶
type GetArticleRequest struct { Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*GetArticleRequest) Descriptor
deprecated
func (*GetArticleRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetArticleRequest.ProtoReflect.Descriptor instead.
func (*GetArticleRequest) GetId ¶
func (x *GetArticleRequest) GetId() int32
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 { Article *Article `protobuf:"bytes,1,opt,name=article,proto3" json:"article,omitempty"` // 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) 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 ListArticleRequest ¶
type ListArticleRequest struct {
// contains filtered or unexported fields
}
func (*ListArticleRequest) Descriptor
deprecated
func (*ListArticleRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListArticleRequest.ProtoReflect.Descriptor instead.
func (*ListArticleRequest) ProtoMessage ¶
func (*ListArticleRequest) ProtoMessage()
func (*ListArticleRequest) ProtoReflect ¶
func (x *ListArticleRequest) ProtoReflect() protoreflect.Message
func (*ListArticleRequest) Reset ¶
func (x *ListArticleRequest) Reset()
func (*ListArticleRequest) String ¶
func (x *ListArticleRequest) String() string
type ListArticleResponse ¶
type ListArticleResponse struct { Results []*Article `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` // contains filtered or unexported fields }
func (*ListArticleResponse) Descriptor
deprecated
func (*ListArticleResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListArticleResponse.ProtoReflect.Descriptor instead.
func (*ListArticleResponse) GetResults ¶
func (x *ListArticleResponse) GetResults() []*Article
func (*ListArticleResponse) ProtoMessage ¶
func (*ListArticleResponse) ProtoMessage()
func (*ListArticleResponse) ProtoReflect ¶
func (x *ListArticleResponse) ProtoReflect() protoreflect.Message
func (*ListArticleResponse) Reset ¶
func (x *ListArticleResponse) Reset()
func (*ListArticleResponse) String ¶
func (x *ListArticleResponse) String() string
type UpdateArticleRequest ¶
type UpdateArticleRequest struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` Content string `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"` // contains filtered or unexported fields }
func (*UpdateArticleRequest) Descriptor
deprecated
func (*UpdateArticleRequest) Descriptor() ([]byte, []int)
Deprecated: Use UpdateArticleRequest.ProtoReflect.Descriptor instead.
func (*UpdateArticleRequest) GetContent ¶
func (x *UpdateArticleRequest) GetContent() string
func (*UpdateArticleRequest) GetId ¶
func (x *UpdateArticleRequest) GetId() int64
func (*UpdateArticleRequest) GetTitle ¶
func (x *UpdateArticleRequest) GetTitle() string
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 { Article *Article `protobuf:"bytes,1,opt,name=article,proto3" json:"article,omitempty"` // 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) 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