demo

package
v0.0.0-...-6fd4cd7 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

View Source
var File_proto_demo_v1_blog_proto protoreflect.FileDescriptor
View Source
var File_proto_demo_v1_error_reason_proto protoreflect.FileDescriptor

Functions

func ErrorAccessForbidden

func ErrorAccessForbidden(format string, args ...any) *errors.Error

func ErrorForbidden

func ErrorForbidden(format string, args ...any) *errors.Error

func ErrorInvalidParameter

func ErrorInvalidParameter(format string, args ...any) *errors.Error

func ErrorNotFound

func ErrorNotFound(format string, args ...any) *errors.Error

func ErrorRateLimited

func ErrorRateLimited(format string, args ...any) *errors.Error

func ErrorSystemError

func ErrorSystemError(format string, args ...any) *errors.Error

func ErrorUnauthenticated

func ErrorUnauthenticated(format string, args ...any) *errors.Error

func IsAccessForbidden

func IsAccessForbidden(err error) bool

func IsForbidden

func IsForbidden(err error) bool

func IsInvalidParameter

func IsInvalidParameter(err error) bool

func IsNotFound

func IsNotFound(err error) bool

func IsRateLimited

func IsRateLimited(err error) bool

func IsSystemError

func IsSystemError(err error) bool

func IsUnauthenticated

func IsUnauthenticated(err error) bool

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

Deprecated: Use Article.ProtoReflect.Descriptor instead.

func (*Article) GetContent

func (x *Article) GetContent() string

func (*Article) GetCreatedAt

func (x *Article) GetCreatedAt() *timestamppb.Timestamp

func (*Article) GetId

func (x *Article) GetId() int32

func (*Article) GetLike

func (x *Article) GetLike() int64

func (*Article) GetTitle

func (x *Article) GetTitle() string

func (*Article) GetUpdatedAt

func (x *Article) GetUpdatedAt() *timestamppb.Timestamp

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

type BlogService

type BlogService struct {
	// contains filtered or unexported fields
}

func (*BlogService) Create

func (r *BlogService) Create(c *gee.Context) error

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 (*BlogServiceHTTPClientImpl) DeleteArticle

func (*BlogServiceHTTPClientImpl) GetArticle

func (*BlogServiceHTTPClientImpl) ListArticle

func (*BlogServiceHTTPClientImpl) UpdateArticle

func (*BlogServiceHTTPClientImpl) Validate

func (c *BlogServiceHTTPClientImpl) Validate(in any) 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) 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

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

Jump to

Keyboard shortcuts

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