topic

package
v0.0.0-...-b9535b4 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2023 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Tab_name = map[int32]string{
		0: "share",
		1: "ask",
		2: "good",
		3: "job",
	}
	Tab_value = map[string]int32{
		"share": 0,
		"ask":   1,
		"good":  2,
		"job":   3,
	}
)

Enum value maps for Tab.

View Source
var (
	ErrGetTopicById    = errors.New("topicServiceImpl: get topic by id")
	ErrGetTopicsByPage = errors.New("topicServiceImpl: get topics b")
)
View Source
var File_internal_protobufs_topic_domain_proto protoreflect.FileDescriptor
View Source
var File_internal_protobufs_topic_service_proto protoreflect.FileDescriptor

Functions

func NewTopicServiceImpl

func NewTopicServiceImpl(httpClient http.Client, BaseURL string) *topicServiceImpl

func RegisterTopicServiceServer

func RegisterTopicServiceServer(s *grpc.Server, srv TopicServiceServer)

Types

type GetTopicByIdRequest

type GetTopicByIdRequest struct {
	Id          string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Accesstoken string `protobuf:"bytes,2,opt,name=accesstoken,proto3" json:"accesstoken,omitempty"`
	Mdrender    string `protobuf:"bytes,3,opt,name=mdrender,proto3" json:"mdrender,omitempty"`
	// contains filtered or unexported fields
}

func (*GetTopicByIdRequest) Descriptor deprecated

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

Deprecated: Use GetTopicByIdRequest.ProtoReflect.Descriptor instead.

func (*GetTopicByIdRequest) GetAccesstoken

func (x *GetTopicByIdRequest) GetAccesstoken() string

func (*GetTopicByIdRequest) GetId

func (x *GetTopicByIdRequest) GetId() string

func (*GetTopicByIdRequest) GetMdrender

func (x *GetTopicByIdRequest) GetMdrender() string

func (*GetTopicByIdRequest) ProtoMessage

func (*GetTopicByIdRequest) ProtoMessage()

func (*GetTopicByIdRequest) ProtoReflect

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

func (*GetTopicByIdRequest) Reset

func (x *GetTopicByIdRequest) Reset()

func (*GetTopicByIdRequest) String

func (x *GetTopicByIdRequest) String() string

func (*GetTopicByIdRequest) Validate

func (m *GetTopicByIdRequest) Validate() error

Validate checks the field values on GetTopicByIdRequest with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type GetTopicByIdRequestValidationError

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

GetTopicByIdRequestValidationError is the validation error returned by GetTopicByIdRequest.Validate if the designated constraints aren't met.

func (GetTopicByIdRequestValidationError) Cause

Cause function returns cause value.

func (GetTopicByIdRequestValidationError) Error

Error satisfies the builtin error interface

func (GetTopicByIdRequestValidationError) ErrorName

ErrorName returns error name.

func (GetTopicByIdRequestValidationError) Field

Field function returns field value.

func (GetTopicByIdRequestValidationError) Key

Key function returns key value.

func (GetTopicByIdRequestValidationError) Reason

Reason function returns reason value.

type GetTopicByIdResponse

type GetTopicByIdResponse struct {
	Data    *TopicDetail `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	Success bool         `protobuf:"varint,2,opt,name=success,proto3" json:"success,omitempty"`
	// contains filtered or unexported fields
}

func (*GetTopicByIdResponse) Descriptor deprecated

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

Deprecated: Use GetTopicByIdResponse.ProtoReflect.Descriptor instead.

func (*GetTopicByIdResponse) GetData

func (x *GetTopicByIdResponse) GetData() *TopicDetail

func (*GetTopicByIdResponse) GetSuccess

func (x *GetTopicByIdResponse) GetSuccess() bool

func (*GetTopicByIdResponse) ProtoMessage

func (*GetTopicByIdResponse) ProtoMessage()

func (*GetTopicByIdResponse) ProtoReflect

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

func (*GetTopicByIdResponse) Reset

func (x *GetTopicByIdResponse) Reset()

func (*GetTopicByIdResponse) String

func (x *GetTopicByIdResponse) String() string

func (*GetTopicByIdResponse) Validate

func (m *GetTopicByIdResponse) Validate() error

Validate checks the field values on GetTopicByIdResponse with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type GetTopicByIdResponseValidationError

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

GetTopicByIdResponseValidationError is the validation error returned by GetTopicByIdResponse.Validate if the designated constraints aren't met.

func (GetTopicByIdResponseValidationError) Cause

Cause function returns cause value.

func (GetTopicByIdResponseValidationError) Error

Error satisfies the builtin error interface

func (GetTopicByIdResponseValidationError) ErrorName

ErrorName returns error name.

func (GetTopicByIdResponseValidationError) Field

Field function returns field value.

func (GetTopicByIdResponseValidationError) Key

Key function returns key value.

func (GetTopicByIdResponseValidationError) Reason

Reason function returns reason value.

type GetTopicsByPageRequest

type GetTopicsByPageRequest struct {
	Page     int32  `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"`
	Limit    int32  `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"`
	Tab      Tab    `protobuf:"varint,3,opt,name=tab,proto3,enum=topic.Tab" json:"tab,omitempty"`
	Mdrender string `protobuf:"bytes,4,opt,name=mdrender,proto3" json:"mdrender,omitempty"`
	// contains filtered or unexported fields
}

func (*GetTopicsByPageRequest) Descriptor deprecated

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

Deprecated: Use GetTopicsByPageRequest.ProtoReflect.Descriptor instead.

func (*GetTopicsByPageRequest) GetLimit

func (x *GetTopicsByPageRequest) GetLimit() int32

func (*GetTopicsByPageRequest) GetMdrender

func (x *GetTopicsByPageRequest) GetMdrender() string

func (*GetTopicsByPageRequest) GetPage

func (x *GetTopicsByPageRequest) GetPage() int32

func (*GetTopicsByPageRequest) GetTab

func (x *GetTopicsByPageRequest) GetTab() Tab

func (*GetTopicsByPageRequest) ProtoMessage

func (*GetTopicsByPageRequest) ProtoMessage()

func (*GetTopicsByPageRequest) ProtoReflect

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

func (*GetTopicsByPageRequest) Reset

func (x *GetTopicsByPageRequest) Reset()

func (*GetTopicsByPageRequest) String

func (x *GetTopicsByPageRequest) String() string

func (*GetTopicsByPageRequest) Validate

func (m *GetTopicsByPageRequest) Validate() error

Validate checks the field values on GetTopicsByPageRequest with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type GetTopicsByPageRequestValidationError

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

GetTopicsByPageRequestValidationError is the validation error returned by GetTopicsByPageRequest.Validate if the designated constraints aren't met.

func (GetTopicsByPageRequestValidationError) Cause

Cause function returns cause value.

func (GetTopicsByPageRequestValidationError) Error

Error satisfies the builtin error interface

func (GetTopicsByPageRequestValidationError) ErrorName

ErrorName returns error name.

func (GetTopicsByPageRequestValidationError) Field

Field function returns field value.

func (GetTopicsByPageRequestValidationError) Key

Key function returns key value.

func (GetTopicsByPageRequestValidationError) Reason

Reason function returns reason value.

type GetTopicsByPageResponse

type GetTopicsByPageResponse struct {
	Data    []*Topic `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"`
	Success bool     `protobuf:"varint,2,opt,name=success,proto3" json:"success,omitempty"`
	// contains filtered or unexported fields
}

func (*GetTopicsByPageResponse) Descriptor deprecated

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

Deprecated: Use GetTopicsByPageResponse.ProtoReflect.Descriptor instead.

func (*GetTopicsByPageResponse) GetData

func (x *GetTopicsByPageResponse) GetData() []*Topic

func (*GetTopicsByPageResponse) GetSuccess

func (x *GetTopicsByPageResponse) GetSuccess() bool

func (*GetTopicsByPageResponse) ProtoMessage

func (*GetTopicsByPageResponse) ProtoMessage()

func (*GetTopicsByPageResponse) ProtoReflect

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

func (*GetTopicsByPageResponse) Reset

func (x *GetTopicsByPageResponse) Reset()

func (*GetTopicsByPageResponse) String

func (x *GetTopicsByPageResponse) String() string

func (*GetTopicsByPageResponse) Validate

func (m *GetTopicsByPageResponse) Validate() error

Validate checks the field values on GetTopicsByPageResponse with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type GetTopicsByPageResponseValidationError

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

GetTopicsByPageResponseValidationError is the validation error returned by GetTopicsByPageResponse.Validate if the designated constraints aren't met.

func (GetTopicsByPageResponseValidationError) Cause

Cause function returns cause value.

func (GetTopicsByPageResponseValidationError) Error

Error satisfies the builtin error interface

func (GetTopicsByPageResponseValidationError) ErrorName

ErrorName returns error name.

func (GetTopicsByPageResponseValidationError) Field

Field function returns field value.

func (GetTopicsByPageResponseValidationError) Key

Key function returns key value.

func (GetTopicsByPageResponseValidationError) Reason

Reason function returns reason value.

type Tab

type Tab int32
const (
	Tab_share Tab = 0
	Tab_ask   Tab = 1
	Tab_good  Tab = 2
	Tab_job   Tab = 3
)

func (Tab) Descriptor

func (Tab) Descriptor() protoreflect.EnumDescriptor

func (Tab) Enum

func (x Tab) Enum() *Tab

func (Tab) EnumDescriptor deprecated

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

Deprecated: Use Tab.Descriptor instead.

func (Tab) Number

func (x Tab) Number() protoreflect.EnumNumber

func (Tab) String

func (x Tab) String() string

func (Tab) Type

func (Tab) Type() protoreflect.EnumType

type Topic

type Topic struct {
	Id          string           `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	AuthorId    string           `protobuf:"bytes,2,opt,name=author_id,json=authorId,proto3" json:"author_id,omitempty"`
	Tab         Tab              `protobuf:"varint,3,opt,name=tab,proto3,enum=topic.Tab" json:"tab,omitempty"`
	Title       string           `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"`
	Content     string           `protobuf:"bytes,5,opt,name=content,proto3" json:"content,omitempty"`
	Author      *shared.UserBase `protobuf:"bytes,6,opt,name=author,proto3" json:"author,omitempty"`
	Good        bool             `protobuf:"varint,7,opt,name=good,proto3" json:"good,omitempty"`
	Top         bool             `protobuf:"varint,8,opt,name=top,proto3" json:"top,omitempty"`
	ReplyCount  int32            `protobuf:"varint,9,opt,name=reply_count,json=replyCount,proto3" json:"reply_count,omitempty"`
	VisitCount  int32            `protobuf:"varint,10,opt,name=visit_count,json=visitCount,proto3" json:"visit_count,omitempty"`
	CreateAt    string           `protobuf:"bytes,11,opt,name=create_at,json=createAt,proto3" json:"create_at,omitempty"`
	LastReplyAt string           `protobuf:"bytes,12,opt,name=last_reply_at,json=lastReplyAt,proto3" json:"last_reply_at,omitempty"`
	// contains filtered or unexported fields
}

func (*Topic) Descriptor deprecated

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

Deprecated: Use Topic.ProtoReflect.Descriptor instead.

func (*Topic) GetAuthor

func (x *Topic) GetAuthor() *shared.UserBase

func (*Topic) GetAuthorId

func (x *Topic) GetAuthorId() string

func (*Topic) GetContent

func (x *Topic) GetContent() string

func (*Topic) GetCreateAt

func (x *Topic) GetCreateAt() string

func (*Topic) GetGood

func (x *Topic) GetGood() bool

func (*Topic) GetId

func (x *Topic) GetId() string

func (*Topic) GetLastReplyAt

func (x *Topic) GetLastReplyAt() string

func (*Topic) GetReplyCount

func (x *Topic) GetReplyCount() int32

func (*Topic) GetTab

func (x *Topic) GetTab() Tab

func (*Topic) GetTitle

func (x *Topic) GetTitle() string

func (*Topic) GetTop

func (x *Topic) GetTop() bool

func (*Topic) GetVisitCount

func (x *Topic) GetVisitCount() int32

func (*Topic) ProtoMessage

func (*Topic) ProtoMessage()

func (*Topic) ProtoReflect

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

func (*Topic) Reset

func (x *Topic) Reset()

func (*Topic) String

func (x *Topic) String() string

func (*Topic) Validate

func (m *Topic) Validate() error

Validate checks the field values on Topic with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type TopicDetail

type TopicDetail struct {
	Id          string           `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	AuthorId    string           `protobuf:"bytes,2,opt,name=author_id,json=authorId,proto3" json:"author_id,omitempty"`
	Tab         Tab              `protobuf:"varint,3,opt,name=tab,proto3,enum=topic.Tab" json:"tab,omitempty"`
	Title       string           `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"`
	Content     string           `protobuf:"bytes,5,opt,name=content,proto3" json:"content,omitempty"`
	Author      *shared.UserBase `protobuf:"bytes,6,opt,name=author,proto3" json:"author,omitempty"`
	Good        bool             `protobuf:"varint,7,opt,name=good,proto3" json:"good,omitempty"`
	Top         bool             `protobuf:"varint,8,opt,name=top,proto3" json:"top,omitempty"`
	ReplyCount  int32            `protobuf:"varint,9,opt,name=reply_count,json=replyCount,proto3" json:"reply_count,omitempty"`
	VisitCount  int32            `protobuf:"varint,10,opt,name=visit_count,json=visitCount,proto3" json:"visit_count,omitempty"`
	CreateAt    string           `protobuf:"bytes,11,opt,name=create_at,json=createAt,proto3" json:"create_at,omitempty"`
	LastReplyAt string           `protobuf:"bytes,12,opt,name=last_reply_at,json=lastReplyAt,proto3" json:"last_reply_at,omitempty"`
	// different fields
	Replies   []*reply.Reply `protobuf:"bytes,13,rep,name=replies,proto3" json:"replies,omitempty"`
	IsCollect bool           `protobuf:"varint,14,opt,name=is_collect,json=isCollect,proto3" json:"is_collect,omitempty"`
	// contains filtered or unexported fields
}

func (*TopicDetail) Descriptor deprecated

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

Deprecated: Use TopicDetail.ProtoReflect.Descriptor instead.

func (*TopicDetail) GetAuthor

func (x *TopicDetail) GetAuthor() *shared.UserBase

func (*TopicDetail) GetAuthorId

func (x *TopicDetail) GetAuthorId() string

func (*TopicDetail) GetContent

func (x *TopicDetail) GetContent() string

func (*TopicDetail) GetCreateAt

func (x *TopicDetail) GetCreateAt() string

func (*TopicDetail) GetGood

func (x *TopicDetail) GetGood() bool

func (*TopicDetail) GetId

func (x *TopicDetail) GetId() string

func (*TopicDetail) GetIsCollect

func (x *TopicDetail) GetIsCollect() bool

func (*TopicDetail) GetLastReplyAt

func (x *TopicDetail) GetLastReplyAt() string

func (*TopicDetail) GetReplies

func (x *TopicDetail) GetReplies() []*reply.Reply

func (*TopicDetail) GetReplyCount

func (x *TopicDetail) GetReplyCount() int32

func (*TopicDetail) GetTab

func (x *TopicDetail) GetTab() Tab

func (*TopicDetail) GetTitle

func (x *TopicDetail) GetTitle() string

func (*TopicDetail) GetTop

func (x *TopicDetail) GetTop() bool

func (*TopicDetail) GetVisitCount

func (x *TopicDetail) GetVisitCount() int32

func (*TopicDetail) ProtoMessage

func (*TopicDetail) ProtoMessage()

func (*TopicDetail) ProtoReflect

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

func (*TopicDetail) Reset

func (x *TopicDetail) Reset()

func (*TopicDetail) String

func (x *TopicDetail) String() string

func (*TopicDetail) Validate

func (m *TopicDetail) Validate() error

Validate checks the field values on TopicDetail with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type TopicDetailValidationError

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

TopicDetailValidationError is the validation error returned by TopicDetail.Validate if the designated constraints aren't met.

func (TopicDetailValidationError) Cause

Cause function returns cause value.

func (TopicDetailValidationError) Error

Error satisfies the builtin error interface

func (TopicDetailValidationError) ErrorName

func (e TopicDetailValidationError) ErrorName() string

ErrorName returns error name.

func (TopicDetailValidationError) Field

Field function returns field value.

func (TopicDetailValidationError) Key

Key function returns key value.

func (TopicDetailValidationError) Reason

Reason function returns reason value.

type TopicServiceClient

type TopicServiceClient interface {
	GetTopicById(ctx context.Context, in *GetTopicByIdRequest, opts ...grpc.CallOption) (*GetTopicByIdResponse, error)
	GetTopicsByPage(ctx context.Context, in *GetTopicsByPageRequest, opts ...grpc.CallOption) (*GetTopicsByPageResponse, error)
}

TopicServiceClient is the client API for TopicService 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 TopicServiceServer

type TopicServiceServer interface {
	GetTopicById(context.Context, *GetTopicByIdRequest) (*GetTopicByIdResponse, error)
	GetTopicsByPage(context.Context, *GetTopicsByPageRequest) (*GetTopicsByPageResponse, error)
	// contains filtered or unexported methods
}

TopicServiceServer is the server API for TopicService service. All implementations must embed UnimplementedTopicServiceServer for forward compatibility

type TopicValidationError

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

TopicValidationError is the validation error returned by Topic.Validate if the designated constraints aren't met.

func (TopicValidationError) Cause

func (e TopicValidationError) Cause() error

Cause function returns cause value.

func (TopicValidationError) Error

func (e TopicValidationError) Error() string

Error satisfies the builtin error interface

func (TopicValidationError) ErrorName

func (e TopicValidationError) ErrorName() string

ErrorName returns error name.

func (TopicValidationError) Field

func (e TopicValidationError) Field() string

Field function returns field value.

func (TopicValidationError) Key

func (e TopicValidationError) Key() bool

Key function returns key value.

func (TopicValidationError) Reason

func (e TopicValidationError) Reason() string

Reason function returns reason value.

type UnimplementedTopicServiceServer

type UnimplementedTopicServiceServer struct {
}

UnimplementedTopicServiceServer must be embedded to have forward compatible implementations.

func (*UnimplementedTopicServiceServer) GetTopicById

func (*UnimplementedTopicServiceServer) GetTopicsByPage

Jump to

Keyboard shortcuts

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