Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterBlogServiceHTTPServer(r gin.IRouter, srv BlogServiceHTTPServer)
- type Article
- func (*Article) Descriptor() ([]byte, []int)deprecated
- func (x *Article) GetAuthorId() int32
- func (x *Article) GetContent() string
- func (x *Article) GetTitle() string
- func (*Article) ProtoMessage()
- func (x *Article) ProtoReflect() protoreflect.Message
- func (x *Article) Reset()
- func (x *Article) String() string
- func (m *Article) Validate() error
- func (m *Article) ValidateAll() error
- type ArticleMultiError
- type ArticleValidationError
- type BlogServiceHTTPClient
- type BlogServiceHTTPClientImpl
- type BlogServiceHTTPServer
- type GetArticlesReq
- func (*GetArticlesReq) Descriptor() ([]byte, []int)deprecated
- func (x *GetArticlesReq) GetAuthorId() int32
- func (x *GetArticlesReq) GetPage() int32
- func (x *GetArticlesReq) GetPageSize() int32
- func (x *GetArticlesReq) GetTitle() string
- func (*GetArticlesReq) ProtoMessage()
- func (x *GetArticlesReq) ProtoReflect() protoreflect.Message
- func (x *GetArticlesReq) Reset()
- func (x *GetArticlesReq) String() string
- func (m *GetArticlesReq) Validate() error
- func (m *GetArticlesReq) ValidateAll() error
- type GetArticlesReqMultiError
- type GetArticlesReqValidationError
- func (e GetArticlesReqValidationError) Cause() error
- func (e GetArticlesReqValidationError) Error() string
- func (e GetArticlesReqValidationError) ErrorName() string
- func (e GetArticlesReqValidationError) Field() string
- func (e GetArticlesReqValidationError) Key() bool
- func (e GetArticlesReqValidationError) Reason() string
- type GetArticlesResp
- func (*GetArticlesResp) Descriptor() ([]byte, []int)deprecated
- func (x *GetArticlesResp) GetArticles() []*Article
- func (x *GetArticlesResp) GetTotal() int64
- func (*GetArticlesResp) ProtoMessage()
- func (x *GetArticlesResp) ProtoReflect() protoreflect.Message
- func (x *GetArticlesResp) Reset()
- func (x *GetArticlesResp) String() string
- func (m *GetArticlesResp) Validate() error
- func (m *GetArticlesResp) ValidateAll() error
- type GetArticlesRespMultiError
- type GetArticlesRespValidationError
- func (e GetArticlesRespValidationError) Cause() error
- func (e GetArticlesRespValidationError) Error() string
- func (e GetArticlesRespValidationError) ErrorName() string
- func (e GetArticlesRespValidationError) Field() string
- func (e GetArticlesRespValidationError) Key() bool
- func (e GetArticlesRespValidationError) Reason() string
Constants ¶
const OperationBlogServiceCreateArticle = "/example.BlogService/CreateArticle"
const OperationBlogServiceGetArticles = "/example.BlogService/GetArticles"
Variables ¶
var File_example_proto protoreflect.FileDescriptor
Functions ¶
func RegisterBlogServiceHTTPServer ¶
func RegisterBlogServiceHTTPServer(r gin.IRouter, srv BlogServiceHTTPServer)
Types ¶
type Article ¶
type Article 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"` // @gotags: form:"author_id" uri:"author_id" AuthorId int32 `protobuf:"varint,3,opt,name=author_id,json=authorId,proto3" json:"author_id,omitempty"` // contains filtered or unexported fields }
func (*Article) Descriptor
deprecated
func (*Article) GetAuthorId ¶
func (*Article) GetContent ¶
func (*Article) ProtoMessage ¶
func (*Article) ProtoMessage()
func (*Article) ProtoReflect ¶
func (x *Article) ProtoReflect() protoreflect.Message
func (*Article) Validate ¶
Validate checks the field values on Article 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 (*Article) ValidateAll ¶
ValidateAll checks the field values on Article 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 ArticleMultiError, or nil if none found.
type ArticleMultiError ¶
type ArticleMultiError []error
ArticleMultiError is an error wrapping multiple validation errors returned by Article.ValidateAll() if the designated constraints aren't met.
func (ArticleMultiError) AllErrors ¶
func (m ArticleMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (ArticleMultiError) Error ¶
func (m ArticleMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type ArticleValidationError ¶
type ArticleValidationError struct {
// contains filtered or unexported fields
}
ArticleValidationError is the validation error returned by Article.Validate if the designated constraints aren't met.
func (ArticleValidationError) Cause ¶
func (e ArticleValidationError) Cause() error
Cause function returns cause value.
func (ArticleValidationError) Error ¶
func (e ArticleValidationError) Error() string
Error satisfies the builtin error interface
func (ArticleValidationError) ErrorName ¶
func (e ArticleValidationError) ErrorName() string
ErrorName returns error name.
func (ArticleValidationError) Field ¶
func (e ArticleValidationError) Field() string
Field function returns field value.
func (ArticleValidationError) Key ¶
func (e ArticleValidationError) Key() bool
Key function returns key value.
func (ArticleValidationError) Reason ¶
func (e ArticleValidationError) Reason() string
Reason function returns reason value.
type BlogServiceHTTPClient ¶
type BlogServiceHTTPClient interface { CreateArticle(ctx context.Context, req *Article, opts ...http.CallOption) (rsp *Article, err error) GetArticles(ctx context.Context, req *GetArticlesReq, opts ...http.CallOption) (rsp *GetArticlesResp, err error) }
func NewBlogServiceHTTPClient ¶
func NewBlogServiceHTTPClient(client *http.Client) BlogServiceHTTPClient
type BlogServiceHTTPClientImpl ¶
type BlogServiceHTTPClientImpl struct {
// contains filtered or unexported fields
}
func (*BlogServiceHTTPClientImpl) CreateArticle ¶
func (c *BlogServiceHTTPClientImpl) CreateArticle(ctx context.Context, in *Article, opts ...http.CallOption) (*Article, error)
func (*BlogServiceHTTPClientImpl) GetArticles ¶
func (c *BlogServiceHTTPClientImpl) GetArticles(ctx context.Context, in *GetArticlesReq, opts ...http.CallOption) (*GetArticlesResp, error)
type BlogServiceHTTPServer ¶
type BlogServiceHTTPServer interface { CreateArticle(context.Context, *Article) (*Article, error) GetArticles(context.Context, *GetArticlesReq) (*GetArticlesResp, error) }
type GetArticlesReq ¶
type GetArticlesReq struct { // @gotags: form:"title" Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` // @gotags: form:"page" Page int32 `protobuf:"varint,2,opt,name=page,proto3" json:"page,omitempty"` // @gotags: form:"page_size" binding:"required" PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` // @gotags: form:"author_id" uri:"author_id" AuthorId int32 `protobuf:"varint,4,opt,name=author_id,json=authorId,proto3" json:"author_id,omitempty"` // contains filtered or unexported fields }
func (*GetArticlesReq) Descriptor
deprecated
func (*GetArticlesReq) Descriptor() ([]byte, []int)
Deprecated: Use GetArticlesReq.ProtoReflect.Descriptor instead.
func (*GetArticlesReq) GetAuthorId ¶
func (x *GetArticlesReq) GetAuthorId() int32
func (*GetArticlesReq) GetPage ¶
func (x *GetArticlesReq) GetPage() int32
func (*GetArticlesReq) GetPageSize ¶
func (x *GetArticlesReq) GetPageSize() int32
func (*GetArticlesReq) GetTitle ¶
func (x *GetArticlesReq) GetTitle() string
func (*GetArticlesReq) ProtoMessage ¶
func (*GetArticlesReq) ProtoMessage()
func (*GetArticlesReq) ProtoReflect ¶
func (x *GetArticlesReq) ProtoReflect() protoreflect.Message
func (*GetArticlesReq) Reset ¶
func (x *GetArticlesReq) Reset()
func (*GetArticlesReq) String ¶
func (x *GetArticlesReq) String() string
func (*GetArticlesReq) Validate ¶
func (m *GetArticlesReq) Validate() error
Validate checks the field values on GetArticlesReq 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 (*GetArticlesReq) ValidateAll ¶
func (m *GetArticlesReq) ValidateAll() error
ValidateAll checks the field values on GetArticlesReq 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 GetArticlesReqMultiError, or nil if none found.
type GetArticlesReqMultiError ¶
type GetArticlesReqMultiError []error
GetArticlesReqMultiError is an error wrapping multiple validation errors returned by GetArticlesReq.ValidateAll() if the designated constraints aren't met.
func (GetArticlesReqMultiError) AllErrors ¶
func (m GetArticlesReqMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (GetArticlesReqMultiError) Error ¶
func (m GetArticlesReqMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type GetArticlesReqValidationError ¶
type GetArticlesReqValidationError struct {
// contains filtered or unexported fields
}
GetArticlesReqValidationError is the validation error returned by GetArticlesReq.Validate if the designated constraints aren't met.
func (GetArticlesReqValidationError) Cause ¶
func (e GetArticlesReqValidationError) Cause() error
Cause function returns cause value.
func (GetArticlesReqValidationError) Error ¶
func (e GetArticlesReqValidationError) Error() string
Error satisfies the builtin error interface
func (GetArticlesReqValidationError) ErrorName ¶
func (e GetArticlesReqValidationError) ErrorName() string
ErrorName returns error name.
func (GetArticlesReqValidationError) Field ¶
func (e GetArticlesReqValidationError) Field() string
Field function returns field value.
func (GetArticlesReqValidationError) Key ¶
func (e GetArticlesReqValidationError) Key() bool
Key function returns key value.
func (GetArticlesReqValidationError) Reason ¶
func (e GetArticlesReqValidationError) Reason() string
Reason function returns reason value.
type GetArticlesResp ¶
type GetArticlesResp struct { Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` Articles []*Article `protobuf:"bytes,2,rep,name=articles,proto3" json:"articles,omitempty"` // contains filtered or unexported fields }
func (*GetArticlesResp) Descriptor
deprecated
func (*GetArticlesResp) Descriptor() ([]byte, []int)
Deprecated: Use GetArticlesResp.ProtoReflect.Descriptor instead.
func (*GetArticlesResp) GetArticles ¶
func (x *GetArticlesResp) GetArticles() []*Article
func (*GetArticlesResp) GetTotal ¶
func (x *GetArticlesResp) GetTotal() int64
func (*GetArticlesResp) ProtoMessage ¶
func (*GetArticlesResp) ProtoMessage()
func (*GetArticlesResp) ProtoReflect ¶
func (x *GetArticlesResp) ProtoReflect() protoreflect.Message
func (*GetArticlesResp) Reset ¶
func (x *GetArticlesResp) Reset()
func (*GetArticlesResp) String ¶
func (x *GetArticlesResp) String() string
func (*GetArticlesResp) Validate ¶
func (m *GetArticlesResp) Validate() error
Validate checks the field values on GetArticlesResp 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 (*GetArticlesResp) ValidateAll ¶
func (m *GetArticlesResp) ValidateAll() error
ValidateAll checks the field values on GetArticlesResp 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 GetArticlesRespMultiError, or nil if none found.
type GetArticlesRespMultiError ¶
type GetArticlesRespMultiError []error
GetArticlesRespMultiError is an error wrapping multiple validation errors returned by GetArticlesResp.ValidateAll() if the designated constraints aren't met.
func (GetArticlesRespMultiError) AllErrors ¶
func (m GetArticlesRespMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (GetArticlesRespMultiError) Error ¶
func (m GetArticlesRespMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type GetArticlesRespValidationError ¶
type GetArticlesRespValidationError struct {
// contains filtered or unexported fields
}
GetArticlesRespValidationError is the validation error returned by GetArticlesResp.Validate if the designated constraints aren't met.
func (GetArticlesRespValidationError) Cause ¶
func (e GetArticlesRespValidationError) Cause() error
Cause function returns cause value.
func (GetArticlesRespValidationError) Error ¶
func (e GetArticlesRespValidationError) Error() string
Error satisfies the builtin error interface
func (GetArticlesRespValidationError) ErrorName ¶
func (e GetArticlesRespValidationError) ErrorName() string
ErrorName returns error name.
func (GetArticlesRespValidationError) Field ¶
func (e GetArticlesRespValidationError) Field() string
Field function returns field value.
func (GetArticlesRespValidationError) Key ¶
func (e GetArticlesRespValidationError) Key() bool
Key function returns key value.
func (GetArticlesRespValidationError) Reason ¶
func (e GetArticlesRespValidationError) Reason() string
Reason function returns reason value.