blog

package
v0.0.0-...-5d9b87f Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BlogRpc_CreateBlog_FullMethodName   = "/go11.protobuf.blog.BlogRpc/CreateBlog"
	BlogRpc_UploadBlog_FullMethodName   = "/go11.protobuf.blog.BlogRpc/UploadBlog"
	BlogRpc_DownloadBlog_FullMethodName = "/go11.protobuf.blog.BlogRpc/DownloadBlog"
)

Variables

View Source
var (
	STATUS_name = map[int32]string{
		0: "DRAFT",
		1: "PUBLISHED",
	}
	STATUS_value = map[string]int32{
		"DRAFT":     0,
		"PUBLISHED": 1,
	}
)

Enum value maps for STATUS.

View Source
var BlogRpc_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "go11.protobuf.blog.BlogRpc",
	HandlerType: (*BlogRpcServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateBlog",
			Handler:    _BlogRpc_CreateBlog_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "UploadBlog",
			Handler:       _BlogRpc_UploadBlog_Handler,
			ClientStreams: true,
		},
		{
			StreamName:    "DownloadBlog",
			Handler:       _BlogRpc_DownloadBlog_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "blog/pb/blog.proto",
}

BlogRpc_ServiceDesc is the grpc.ServiceDesc for BlogRpc service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var File_blog_pb_blog_proto protoreflect.FileDescriptor

Functions

func RegisterBlogRpcServer

func RegisterBlogRpcServer(s grpc.ServiceRegistrar, srv BlogRpcServer)

Types

type Blog

type Blog struct {

	// Blog Meta数据
	Meta *Meta `protobuf:"bytes,1,opt,name=meta,proto3" json:"meta,omitempty"`
	// Blog具体定义
	Spec *CreateBlogRequest `protobuf:"bytes,2,opt,name=spec,proto3" json:"spec,omitempty"`
	// contains filtered or unexported fields
}

func (*Blog) Descriptor deprecated

func (*Blog) Descriptor() ([]byte, []int)

Deprecated: Use Blog.ProtoReflect.Descriptor instead.

func (*Blog) GetMeta

func (x *Blog) GetMeta() *Meta

func (*Blog) GetSpec

func (x *Blog) GetSpec() *CreateBlogRequest

func (*Blog) ProtoMessage

func (*Blog) ProtoMessage()

func (*Blog) ProtoReflect

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

func (*Blog) Reset

func (x *Blog) Reset()

func (*Blog) String

func (x *Blog) String() string

type BlogRpcClient

type BlogRpcClient interface {
	// 创建博客的RPC
	CreateBlog(ctx context.Context, in *CreateBlogRequest, opts ...grpc.CallOption) (*Blog, error)
	// 定义一个Client 流式请求
	UploadBlog(ctx context.Context, opts ...grpc.CallOption) (BlogRpc_UploadBlogClient, error)
	// 定义一个Server 流式请求
	DownloadBlog(ctx context.Context, in *DownloadStreamRequest, opts ...grpc.CallOption) (BlogRpc_DownloadBlogClient, error)
}

BlogRpcClient is the client API for BlogRpc 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 NewBlogRpcClient

func NewBlogRpcClient(cc grpc.ClientConnInterface) BlogRpcClient

type BlogRpcServer

type BlogRpcServer interface {
	// 创建博客的RPC
	CreateBlog(context.Context, *CreateBlogRequest) (*Blog, error)
	// 定义一个Client 流式请求
	UploadBlog(BlogRpc_UploadBlogServer) error
	// 定义一个Server 流式请求
	DownloadBlog(*DownloadStreamRequest, BlogRpc_DownloadBlogServer) error
	// contains filtered or unexported methods
}

BlogRpcServer is the server API for BlogRpc service. All implementations must embed UnimplementedBlogRpcServer for forward compatibility

type BlogRpc_DownloadBlogClient

type BlogRpc_DownloadBlogClient interface {
	Recv() (*DownloadStreamResponse, error)
	grpc.ClientStream
}

type BlogRpc_DownloadBlogServer

type BlogRpc_DownloadBlogServer interface {
	Send(*DownloadStreamResponse) error
	grpc.ServerStream
}

type BlogRpc_UploadBlogClient

type BlogRpc_UploadBlogClient interface {
	Send(*UploadStreamRequest) error
	CloseAndRecv() (*UploadStreamResponse, error)
	grpc.ClientStream
}

type BlogRpc_UploadBlogServer

type BlogRpc_UploadBlogServer interface {
	SendAndClose(*UploadStreamResponse) error
	Recv() (*UploadStreamRequest, error)
	grpc.ServerStream
}

type BlogSet

type BlogSet struct {
	Total int64   `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"`
	Items []*Blog `protobuf:"bytes,2,rep,name=items,proto3" json:"items,omitempty"`
	// contains filtered or unexported fields
}

func (*BlogSet) Descriptor deprecated

func (*BlogSet) Descriptor() ([]byte, []int)

Deprecated: Use BlogSet.ProtoReflect.Descriptor instead.

func (*BlogSet) GetItems

func (x *BlogSet) GetItems() []*Blog

func (*BlogSet) GetTotal

func (x *BlogSet) GetTotal() int64

func (*BlogSet) ProtoMessage

func (*BlogSet) ProtoMessage()

func (*BlogSet) ProtoReflect

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

func (*BlogSet) Reset

func (x *BlogSet) Reset()

func (*BlogSet) String

func (x *BlogSet) String() string

type CreateBlogRequest

type CreateBlogRequest struct {

	// 文章标题
	Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
	// 作者
	Author string `protobuf:"bytes,2,opt,name=author,proto3" json:"author,omitempty"`
	// 文章的内容
	Content string `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"`
	// 文章标签 map
	Tags map[string]string `` /* 149-byte string literal not displayed */
	// 文章状态
	Status STATUS `protobuf:"varint,5,opt,name=status,proto3,enum=go11.protobuf.blog.STATUS" json:"status,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateBlogRequest) Descriptor deprecated

func (*CreateBlogRequest) Descriptor() ([]byte, []int)

Deprecated: Use CreateBlogRequest.ProtoReflect.Descriptor instead.

func (*CreateBlogRequest) GetAuthor

func (x *CreateBlogRequest) GetAuthor() string

func (*CreateBlogRequest) GetContent

func (x *CreateBlogRequest) GetContent() string

func (*CreateBlogRequest) GetStatus

func (x *CreateBlogRequest) GetStatus() STATUS

func (*CreateBlogRequest) GetTags

func (x *CreateBlogRequest) GetTags() map[string]string

func (*CreateBlogRequest) GetTitle

func (x *CreateBlogRequest) GetTitle() string

func (*CreateBlogRequest) ProtoMessage

func (*CreateBlogRequest) ProtoMessage()

func (*CreateBlogRequest) ProtoReflect

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

func (*CreateBlogRequest) Reset

func (x *CreateBlogRequest) Reset()

func (*CreateBlogRequest) String

func (x *CreateBlogRequest) String() string

type DownloadStreamRequest

type DownloadStreamRequest struct {

	// 需要下载的文件名称
	FileName string `protobuf:"bytes,1,opt,name=file_name,json=fileName,proto3" json:"file_name,omitempty"`
	// contains filtered or unexported fields
}

func (*DownloadStreamRequest) Descriptor deprecated

func (*DownloadStreamRequest) Descriptor() ([]byte, []int)

Deprecated: Use DownloadStreamRequest.ProtoReflect.Descriptor instead.

func (*DownloadStreamRequest) GetFileName

func (x *DownloadStreamRequest) GetFileName() string

func (*DownloadStreamRequest) ProtoMessage

func (*DownloadStreamRequest) ProtoMessage()

func (*DownloadStreamRequest) ProtoReflect

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

func (*DownloadStreamRequest) Reset

func (x *DownloadStreamRequest) Reset()

func (*DownloadStreamRequest) String

func (x *DownloadStreamRequest) String() string

type DownloadStreamResponse

type DownloadStreamResponse struct {
	Meta map[string]string `` /* 149-byte string literal not displayed */
	// 上传文件的内容
	Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*DownloadStreamResponse) Descriptor deprecated

func (*DownloadStreamResponse) Descriptor() ([]byte, []int)

Deprecated: Use DownloadStreamResponse.ProtoReflect.Descriptor instead.

func (*DownloadStreamResponse) GetData

func (x *DownloadStreamResponse) GetData() []byte

func (*DownloadStreamResponse) GetMeta

func (x *DownloadStreamResponse) GetMeta() map[string]string

func (*DownloadStreamResponse) ProtoMessage

func (*DownloadStreamResponse) ProtoMessage()

func (*DownloadStreamResponse) ProtoReflect

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

func (*DownloadStreamResponse) Reset

func (x *DownloadStreamResponse) Reset()

func (*DownloadStreamResponse) String

func (x *DownloadStreamResponse) String() string

type Meta

type Meta struct {
	Id          int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	CreateAt    int64 `protobuf:"varint,2,opt,name=create_at,json=createAt,proto3" json:"create_at,omitempty"`
	UpdatedAt   int64 `protobuf:"varint,3,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
	PublishedAt int64 `protobuf:"varint,4,opt,name=published_at,json=publishedAt,proto3" json:"published_at,omitempty"`
	// contains filtered or unexported fields
}

func (*Meta) Descriptor deprecated

func (*Meta) Descriptor() ([]byte, []int)

Deprecated: Use Meta.ProtoReflect.Descriptor instead.

func (*Meta) GetCreateAt

func (x *Meta) GetCreateAt() int64

func (*Meta) GetId

func (x *Meta) GetId() int64

func (*Meta) GetPublishedAt

func (x *Meta) GetPublishedAt() int64

func (*Meta) GetUpdatedAt

func (x *Meta) GetUpdatedAt() int64

func (*Meta) ProtoMessage

func (*Meta) ProtoMessage()

func (*Meta) ProtoReflect

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

func (*Meta) Reset

func (x *Meta) Reset()

func (*Meta) String

func (x *Meta) String() string

type STATUS

type STATUS int32
const (
	STATUS_DRAFT     STATUS = 0
	STATUS_PUBLISHED STATUS = 1
)

func (STATUS) Descriptor

func (STATUS) Descriptor() protoreflect.EnumDescriptor

func (STATUS) Enum

func (x STATUS) Enum() *STATUS

func (STATUS) EnumDescriptor deprecated

func (STATUS) EnumDescriptor() ([]byte, []int)

Deprecated: Use STATUS.Descriptor instead.

func (STATUS) Number

func (x STATUS) Number() protoreflect.EnumNumber

func (STATUS) String

func (x STATUS) String() string

func (STATUS) Type

func (STATUS) Type() protoreflect.EnumType

type UnimplementedBlogRpcServer

type UnimplementedBlogRpcServer struct {
}

UnimplementedBlogRpcServer must be embedded to have forward compatible implementations.

func (UnimplementedBlogRpcServer) CreateBlog

func (UnimplementedBlogRpcServer) DownloadBlog

func (UnimplementedBlogRpcServer) UploadBlog

type UnsafeBlogRpcServer

type UnsafeBlogRpcServer interface {
	// contains filtered or unexported methods
}

UnsafeBlogRpcServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to BlogRpcServer will result in compilation errors.

type UploadStreamRequest

type UploadStreamRequest struct {
	Meta map[string]string `` /* 149-byte string literal not displayed */
	// 上传文件的内容
	Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

文件上传的数据

func (*UploadStreamRequest) Descriptor deprecated

func (*UploadStreamRequest) Descriptor() ([]byte, []int)

Deprecated: Use UploadStreamRequest.ProtoReflect.Descriptor instead.

func (*UploadStreamRequest) GetData

func (x *UploadStreamRequest) GetData() []byte

func (*UploadStreamRequest) GetMeta

func (x *UploadStreamRequest) GetMeta() map[string]string

func (*UploadStreamRequest) ProtoMessage

func (*UploadStreamRequest) ProtoMessage()

func (*UploadStreamRequest) ProtoReflect

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

func (*UploadStreamRequest) Reset

func (x *UploadStreamRequest) Reset()

func (*UploadStreamRequest) String

func (x *UploadStreamRequest) String() string

type UploadStreamResponse

type UploadStreamResponse struct {
	Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*UploadStreamResponse) Descriptor deprecated

func (*UploadStreamResponse) Descriptor() ([]byte, []int)

Deprecated: Use UploadStreamResponse.ProtoReflect.Descriptor instead.

func (*UploadStreamResponse) GetMessage

func (x *UploadStreamResponse) GetMessage() string

func (*UploadStreamResponse) ProtoMessage

func (*UploadStreamResponse) ProtoMessage()

func (*UploadStreamResponse) ProtoReflect

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

func (*UploadStreamResponse) Reset

func (x *UploadStreamResponse) Reset()

func (*UploadStreamResponse) String

func (x *UploadStreamResponse) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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