api

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2022 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const OperationBlogServiceCreateArticle = "/example.BlogService/CreateArticle"
View Source
const OperationBlogServiceGetArticles = "/example.BlogService/GetArticles"

Variables

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

Deprecated: Use Article.ProtoReflect.Descriptor instead.

func (*Article) GetAuthorId

func (x *Article) GetAuthorId() int32

func (*Article) GetContent

func (x *Article) GetContent() string

func (*Article) GetTitle

func (x *Article) GetTitle() string

func (*Article) ProtoMessage

func (*Article) ProtoMessage()

func (*Article) ProtoReflect

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

func (*Article) Reset

func (x *Article) Reset()

func (*Article) String

func (x *Article) String() string

func (*Article) Validate

func (m *Article) Validate() error

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

func (m *Article) ValidateAll() error

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

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

Cause function returns cause value.

func (GetArticlesReqValidationError) Error

Error satisfies the builtin error interface

func (GetArticlesReqValidationError) ErrorName

func (e GetArticlesReqValidationError) ErrorName() string

ErrorName returns error name.

func (GetArticlesReqValidationError) Field

Field function returns field value.

func (GetArticlesReqValidationError) Key

Key function returns key value.

func (GetArticlesReqValidationError) Reason

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

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

Cause function returns cause value.

func (GetArticlesRespValidationError) Error

Error satisfies the builtin error interface

func (GetArticlesRespValidationError) ErrorName

func (e GetArticlesRespValidationError) ErrorName() string

ErrorName returns error name.

func (GetArticlesRespValidationError) Field

Field function returns field value.

func (GetArticlesRespValidationError) Key

Key function returns key value.

func (GetArticlesRespValidationError) Reason

Reason function returns reason value.

Jump to

Keyboard shortcuts

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