gen

package
v0.0.0-...-e20221d Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BlogNature_name = map[int32]string{
		0: "Original",
		1: "Reprinting",
	}
	BlogNature_value = map[string]int32{
		"Original":   0,
		"Reprinting": 1,
	}
)

Enum value maps for BlogNature.

View Source
var BlogAdmin_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "blog.BlogAdmin",
	HandlerType: (*BlogAdminServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetArticle",
			Handler:    _BlogAdmin_GetArticle_Handler,
		},
		{
			MethodName: "CreateArticle",
			Handler:    _BlogAdmin_CreateArticle_Handler,
		},
		{
			MethodName: "UpdateArticle",
			Handler:    _BlogAdmin_UpdateArticle_Handler,
		},
		{
			MethodName: "DeleteArticle",
			Handler:    _BlogAdmin_DeleteArticle_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "blog.proto",
}

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

Functions

func RegisterBlogAdminServer

func RegisterBlogAdminServer(s grpc.ServiceRegistrar, srv BlogAdminServer)

Types

type Blog

type Blog 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"`
	ContentHtml *string                `protobuf:"bytes,4,opt,name=content_html,json=contentHtml,proto3,oneof" json:"content_html,omitempty"`
	Author      string                 `protobuf:"bytes,5,opt,name=author,proto3" json:"author,omitempty"`
	Slug        *string                `protobuf:"bytes,8,opt,name=slug,proto3,oneof" json:"slug,omitempty"`
	Tags        []string               `protobuf:"bytes,9,rep,name=tags,proto3" json:"tags,omitempty"`
	CreateTime  *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=createTime,proto3" json:"createTime,omitempty"`
	UpdateTime  *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=updateTime,proto3" json:"updateTime,omitempty"`
	// contains filtered or unexported fields
}

func (*Blog) Descriptor deprecated

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

Deprecated: Use Blog.ProtoReflect.Descriptor instead.

func (*Blog) GetAuthor

func (x *Blog) GetAuthor() string

func (*Blog) GetContent

func (x *Blog) GetContent() string

func (*Blog) GetContentHtml

func (x *Blog) GetContentHtml() string

func (*Blog) GetCreateTime

func (x *Blog) GetCreateTime() *timestamppb.Timestamp

func (*Blog) GetId

func (x *Blog) GetId() int64

func (*Blog) GetSlug

func (x *Blog) GetSlug() string

func (*Blog) GetTags

func (x *Blog) GetTags() []string

func (*Blog) GetTitle

func (x *Blog) GetTitle() string

func (*Blog) GetUpdateTime

func (x *Blog) GetUpdateTime() *timestamppb.Timestamp

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 BlogAdminClient

type BlogAdminClient interface {
	GetArticle(ctx context.Context, in *Id, opts ...grpc.CallOption) (*Blog, error)
	CreateArticle(ctx context.Context, in *BlogRequest, opts ...grpc.CallOption) (*Blog, error)
	UpdateArticle(ctx context.Context, in *BlogRequest, opts ...grpc.CallOption) (*Blog, error)
	DeleteArticle(ctx context.Context, in *Id, opts ...grpc.CallOption) (*Response, error)
}

BlogAdminClient is the client API for BlogAdmin 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 NewBlogAdminClient

func NewBlogAdminClient(cc grpc.ClientConnInterface) BlogAdminClient

type BlogAdminServer

type BlogAdminServer interface {
	GetArticle(context.Context, *Id) (*Blog, error)
	CreateArticle(context.Context, *BlogRequest) (*Blog, error)
	UpdateArticle(context.Context, *BlogRequest) (*Blog, error)
	DeleteArticle(context.Context, *Id) (*Response, error)
	// contains filtered or unexported methods
}

BlogAdminServer is the server API for BlogAdmin service. All implementations must embed UnimplementedBlogAdminServer for forward compatibility

type BlogNature

type BlogNature int32
const (
	BlogNature_Original   BlogNature = 0
	BlogNature_Reprinting BlogNature = 1
)

func (BlogNature) Descriptor

func (BlogNature) Descriptor() protoreflect.EnumDescriptor

func (BlogNature) Enum

func (x BlogNature) Enum() *BlogNature

func (BlogNature) EnumDescriptor deprecated

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

Deprecated: Use BlogNature.Descriptor instead.

func (BlogNature) Number

func (x BlogNature) Number() protoreflect.EnumNumber

func (BlogNature) String

func (x BlogNature) String() string

func (BlogNature) Type

type BlogRequest

type BlogRequest 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"`
	Author  string   `protobuf:"bytes,3,opt,name=author,proto3" json:"author,omitempty"`
	Slug    *string  `protobuf:"bytes,4,opt,name=slug,proto3,oneof" json:"slug,omitempty"`
	Tags    []string `protobuf:"bytes,5,rep,name=tags,proto3" json:"tags,omitempty"`
	// contains filtered or unexported fields
}

func (*BlogRequest) Descriptor deprecated

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

Deprecated: Use BlogRequest.ProtoReflect.Descriptor instead.

func (*BlogRequest) GetAuthor

func (x *BlogRequest) GetAuthor() string

func (*BlogRequest) GetContent

func (x *BlogRequest) GetContent() string

func (*BlogRequest) GetSlug

func (x *BlogRequest) GetSlug() string

func (*BlogRequest) GetTags

func (x *BlogRequest) GetTags() []string

func (*BlogRequest) GetTitle

func (x *BlogRequest) GetTitle() string

func (*BlogRequest) ProtoMessage

func (*BlogRequest) ProtoMessage()

func (*BlogRequest) ProtoReflect

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

func (*BlogRequest) Reset

func (x *BlogRequest) Reset()

func (*BlogRequest) String

func (x *BlogRequest) String() string

type BlogResponse

type BlogResponse struct {
	Response *Response `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"`
	Blog     *Blog     `protobuf:"bytes,2,opt,name=blog,proto3" json:"blog,omitempty"`
	// contains filtered or unexported fields
}

func (*BlogResponse) Descriptor deprecated

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

Deprecated: Use BlogResponse.ProtoReflect.Descriptor instead.

func (*BlogResponse) GetBlog

func (x *BlogResponse) GetBlog() *Blog

func (*BlogResponse) GetResponse

func (x *BlogResponse) GetResponse() *Response

func (*BlogResponse) ProtoMessage

func (*BlogResponse) ProtoMessage()

func (*BlogResponse) ProtoReflect

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

func (*BlogResponse) Reset

func (x *BlogResponse) Reset()

func (*BlogResponse) String

func (x *BlogResponse) String() string

type Id

type Id struct {
	Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*Id) Descriptor deprecated

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

Deprecated: Use Id.ProtoReflect.Descriptor instead.

func (*Id) GetId

func (x *Id) GetId() int64

func (*Id) ProtoMessage

func (*Id) ProtoMessage()

func (*Id) ProtoReflect

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

func (*Id) Reset

func (x *Id) Reset()

func (*Id) String

func (x *Id) String() string

type Response

type Response struct {
	Code  int32  `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
	Msg   string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"`
	Error string `protobuf:"bytes,3,opt,name=error,proto3" json:"error,omitempty"`
	// contains filtered or unexported fields
}

func (*Response) Descriptor deprecated

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

Deprecated: Use Response.ProtoReflect.Descriptor instead.

func (*Response) GetCode

func (x *Response) GetCode() int32

func (*Response) GetError

func (x *Response) GetError() string

func (*Response) GetMsg

func (x *Response) GetMsg() string

func (*Response) ProtoMessage

func (*Response) ProtoMessage()

func (*Response) ProtoReflect

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

func (*Response) Reset

func (x *Response) Reset()

func (*Response) String

func (x *Response) String() string

type UnimplementedBlogAdminServer

type UnimplementedBlogAdminServer struct {
}

UnimplementedBlogAdminServer must be embedded to have forward compatible implementations.

func (UnimplementedBlogAdminServer) CreateArticle

func (UnimplementedBlogAdminServer) DeleteArticle

func (UnimplementedBlogAdminServer) GetArticle

func (UnimplementedBlogAdminServer) UpdateArticle

type UnsafeBlogAdminServer

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

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

Jump to

Keyboard shortcuts

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