blogv1

package
v0.0.0-...-9065520 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2022 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PostStatus_name = map[int32]string{
		0: "POST_STATUS_UNSPECIFIED",
		1: "POST_STATUS_DRAFT",
		2: "POST_STATUS_PRIVATE",
		3: "POST_STATUS_UNLISTED",
		4: "POST_STATUS_PUBLIC",
	}
	PostStatus_value = map[string]int32{
		"POST_STATUS_UNSPECIFIED": 0,
		"POST_STATUS_DRAFT":       1,
		"POST_STATUS_PRIVATE":     2,
		"POST_STATUS_UNLISTED":    3,
		"POST_STATUS_PUBLIC":      4,
	}
)

Enum value maps for PostStatus.

View Source
var File_blog_v1_post_proto protoreflect.FileDescriptor
View Source
var File_blog_v1_user_proto protoreflect.FileDescriptor
View Source
var PostService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "blog.v1.PostService",
	HandlerType: (*PostServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetPost",
			Handler:    _PostService_GetPost_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "blog/v1/post.proto",
}

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

Functions

func RegisterPostServiceServer

func RegisterPostServiceServer(s grpc.ServiceRegistrar, srv PostServiceServer)

Types

type GetPostRequest

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

func (*GetPostRequest) Descriptor deprecated

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

Deprecated: Use GetPostRequest.ProtoReflect.Descriptor instead.

func (*GetPostRequest) GetPostId

func (x *GetPostRequest) GetPostId() int64

func (*GetPostRequest) ProtoMessage

func (*GetPostRequest) ProtoMessage()

func (*GetPostRequest) ProtoReflect

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

func (*GetPostRequest) Reset

func (x *GetPostRequest) Reset()

func (*GetPostRequest) String

func (x *GetPostRequest) String() string

type GetPostResponse

type GetPostResponse struct {
	Post *Post `protobuf:"bytes,1,opt,name=post,proto3" json:"post,omitempty"`
	// contains filtered or unexported fields
}

func (*GetPostResponse) Descriptor deprecated

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

Deprecated: Use GetPostResponse.ProtoReflect.Descriptor instead.

func (*GetPostResponse) GetPost

func (x *GetPostResponse) GetPost() *Post

func (*GetPostResponse) ProtoMessage

func (*GetPostResponse) ProtoMessage()

func (*GetPostResponse) ProtoReflect

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

func (*GetPostResponse) Reset

func (x *GetPostResponse) Reset()

func (*GetPostResponse) String

func (x *GetPostResponse) String() string

type Post

type Post struct {
	Id          int64                  `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Author      *User                  `protobuf:"bytes,2,opt,name=author,proto3" json:"author,omitempty"`
	Title       string                 `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"`
	Content     []byte                 `protobuf:"bytes,4,opt,name=content,proto3" json:"content,omitempty"`
	Status      PostStatus             `protobuf:"varint,5,opt,name=status,proto3,enum=blog.v1.PostStatus" json:"status,omitempty"`
	PublishedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=published_at,json=publishedAt,proto3" json:"published_at,omitempty"`
	CreatedAt   *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	UpdatedAt   *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
	// contains filtered or unexported fields
}

func (*Post) Descriptor deprecated

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

Deprecated: Use Post.ProtoReflect.Descriptor instead.

func (*Post) GetAuthor

func (x *Post) GetAuthor() *User

func (*Post) GetContent

func (x *Post) GetContent() []byte

func (*Post) GetCreatedAt

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

func (*Post) GetId

func (x *Post) GetId() int64

func (*Post) GetPublishedAt

func (x *Post) GetPublishedAt() *timestamppb.Timestamp

func (*Post) GetStatus

func (x *Post) GetStatus() PostStatus

func (*Post) GetTitle

func (x *Post) GetTitle() string

func (*Post) GetUpdatedAt

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

func (*Post) ProtoMessage

func (*Post) ProtoMessage()

func (*Post) ProtoReflect

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

func (*Post) Reset

func (x *Post) Reset()

func (*Post) String

func (x *Post) String() string

type PostServiceClient

type PostServiceClient interface {
	GetPost(ctx context.Context, in *GetPostRequest, opts ...grpc.CallOption) (*GetPostResponse, error)
}

PostServiceClient is the client API for PostService 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.

type PostServiceServer

type PostServiceServer interface {
	GetPost(context.Context, *GetPostRequest) (*GetPostResponse, error)
}

PostServiceServer is the server API for PostService service. All implementations should embed UnimplementedPostServiceServer for forward compatibility

type PostStatus

type PostStatus int32
const (
	PostStatus_POST_STATUS_UNSPECIFIED PostStatus = 0
	PostStatus_POST_STATUS_DRAFT       PostStatus = 1
	PostStatus_POST_STATUS_PRIVATE     PostStatus = 2
	PostStatus_POST_STATUS_UNLISTED    PostStatus = 3
	PostStatus_POST_STATUS_PUBLIC      PostStatus = 4
)

func (PostStatus) Descriptor

func (PostStatus) Descriptor() protoreflect.EnumDescriptor

func (PostStatus) Enum

func (x PostStatus) Enum() *PostStatus

func (PostStatus) EnumDescriptor deprecated

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

Deprecated: Use PostStatus.Descriptor instead.

func (PostStatus) Number

func (x PostStatus) Number() protoreflect.EnumNumber

func (PostStatus) String

func (x PostStatus) String() string

func (PostStatus) Type

type UnimplementedPostServiceServer

type UnimplementedPostServiceServer struct {
}

UnimplementedPostServiceServer should be embedded to have forward compatible implementations.

func (UnimplementedPostServiceServer) GetPost

type UnsafePostServiceServer

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

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

type User

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

func (*User) Descriptor deprecated

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

Deprecated: Use User.ProtoReflect.Descriptor instead.

func (*User) GetId

func (x *User) GetId() int64

func (*User) GetName

func (x *User) GetName() string

func (*User) ProtoMessage

func (*User) ProtoMessage()

func (*User) ProtoReflect

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

func (*User) Reset

func (x *User) Reset()

func (*User) String

func (x *User) String() string

Jump to

Keyboard shortcuts

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