mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-13 19:45:26 +00:00
Rename streams to threads (#55)
This commit is contained in:
@@ -1,3 +0,0 @@
|
||||
FROM alpine
|
||||
ADD streams /streams
|
||||
ENTRYPOINT [ "/streams" ]
|
||||
@@ -1,23 +0,0 @@
|
||||
# Streams Service
|
||||
|
||||
This is the Streams service
|
||||
|
||||
Generated with
|
||||
|
||||
```
|
||||
micro new streams
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Generate the proto code
|
||||
|
||||
```
|
||||
make proto
|
||||
```
|
||||
|
||||
Run the service
|
||||
|
||||
```
|
||||
micro run .
|
||||
```
|
||||
@@ -1 +0,0 @@
|
||||
service streams
|
||||
File diff suppressed because it is too large
Load Diff
0
streams/.gitignore → threads/.gitignore
vendored
0
streams/.gitignore → threads/.gitignore
vendored
3
threads/Dockerfile
Normal file
3
threads/Dockerfile
Normal file
@@ -0,0 +1,3 @@
|
||||
FROM alpine
|
||||
ADD threads /threads
|
||||
ENTRYPOINT [ "/threads" ]
|
||||
@@ -7,11 +7,11 @@ init:
|
||||
go get github.com/micro/micro/v3/cmd/protoc-gen-micro
|
||||
.PHONY: proto
|
||||
proto:
|
||||
protoc --proto_path=. --micro_out=. --go_out=:. proto/streams.proto
|
||||
protoc --proto_path=. --micro_out=. --go_out=:. proto/threads.proto
|
||||
|
||||
.PHONY: build
|
||||
build:
|
||||
go build -o streams *.go
|
||||
go build -o threads *.go
|
||||
|
||||
.PHONY: test
|
||||
test:
|
||||
@@ -19,4 +19,4 @@ test:
|
||||
|
||||
.PHONY: docker
|
||||
docker:
|
||||
docker build . -t streams:latest
|
||||
docker build . -t threads:latest
|
||||
27
threads/README.md
Normal file
27
threads/README.md
Normal file
@@ -0,0 +1,27 @@
|
||||
Threads conversations
|
||||
|
||||
# Threads Service
|
||||
|
||||
Threads provides threaded conversations as a service grouped by topics.
|
||||
|
||||
## Usage
|
||||
|
||||
Generated with
|
||||
|
||||
```
|
||||
micro new threads
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Generate the proto code
|
||||
|
||||
```
|
||||
make proto
|
||||
```
|
||||
|
||||
Run the service
|
||||
|
||||
```
|
||||
micro run .
|
||||
```
|
||||
@@ -6,11 +6,11 @@ import (
|
||||
"github.com/google/uuid"
|
||||
"github.com/micro/micro/v3/service/errors"
|
||||
"github.com/micro/micro/v3/service/logger"
|
||||
pb "github.com/micro/services/streams/proto"
|
||||
pb "github.com/micro/services/threads/proto"
|
||||
)
|
||||
|
||||
// Create a conversation
|
||||
func (s *Streams) CreateConversation(ctx context.Context, req *pb.CreateConversationRequest, rsp *pb.CreateConversationResponse) error {
|
||||
func (s *Threads) CreateConversation(ctx context.Context, req *pb.CreateConversationRequest, rsp *pb.CreateConversationResponse) error {
|
||||
// validate the request
|
||||
if len(req.GroupId) == 0 {
|
||||
return ErrMissingGroupID
|
||||
@@ -4,8 +4,8 @@ import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/micro/services/streams/handler"
|
||||
pb "github.com/micro/services/streams/proto"
|
||||
"github.com/micro/services/threads/handler"
|
||||
pb "github.com/micro/services/threads/proto"
|
||||
"google.golang.org/protobuf/types/known/timestamppb"
|
||||
|
||||
"github.com/google/uuid"
|
||||
@@ -6,12 +6,12 @@ import (
|
||||
"github.com/google/uuid"
|
||||
"github.com/micro/micro/v3/service/errors"
|
||||
"github.com/micro/micro/v3/service/logger"
|
||||
pb "github.com/micro/services/streams/proto"
|
||||
pb "github.com/micro/services/threads/proto"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// Create a message within a conversation
|
||||
func (s *Streams) CreateMessage(ctx context.Context, req *pb.CreateMessageRequest, rsp *pb.CreateMessageResponse) error {
|
||||
func (s *Threads) CreateMessage(ctx context.Context, req *pb.CreateMessageRequest, rsp *pb.CreateMessageResponse) error {
|
||||
// validate the request
|
||||
if len(req.AuthorId) == 0 {
|
||||
return ErrMissingAuthorID
|
||||
@@ -4,8 +4,8 @@ import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/micro/services/streams/handler"
|
||||
pb "github.com/micro/services/streams/proto"
|
||||
"github.com/micro/services/threads/handler"
|
||||
pb "github.com/micro/services/threads/proto"
|
||||
"google.golang.org/protobuf/types/known/timestamppb"
|
||||
|
||||
"github.com/google/uuid"
|
||||
@@ -5,12 +5,12 @@ import (
|
||||
|
||||
"github.com/micro/micro/v3/service/errors"
|
||||
"github.com/micro/micro/v3/service/logger"
|
||||
pb "github.com/micro/services/streams/proto"
|
||||
pb "github.com/micro/services/threads/proto"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// Delete a conversation and all the messages within
|
||||
func (s *Streams) DeleteConversation(ctx context.Context, req *pb.DeleteConversationRequest, rsp *pb.DeleteConversationResponse) error {
|
||||
func (s *Threads) DeleteConversation(ctx context.Context, req *pb.DeleteConversationRequest, rsp *pb.DeleteConversationResponse) error {
|
||||
// validate the request
|
||||
if len(req.Id) == 0 {
|
||||
return ErrMissingID
|
||||
@@ -4,8 +4,8 @@ import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/micro/services/streams/handler"
|
||||
pb "github.com/micro/services/streams/proto"
|
||||
"github.com/micro/services/threads/handler"
|
||||
pb "github.com/micro/services/threads/proto"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/stretchr/testify/assert"
|
||||
@@ -5,11 +5,11 @@ import (
|
||||
|
||||
"github.com/micro/micro/v3/service/errors"
|
||||
"github.com/micro/micro/v3/service/logger"
|
||||
pb "github.com/micro/services/streams/proto"
|
||||
pb "github.com/micro/services/threads/proto"
|
||||
)
|
||||
|
||||
// List all the conversations for a group
|
||||
func (s *Streams) ListConversations(ctx context.Context, req *pb.ListConversationsRequest, rsp *pb.ListConversationsResponse) error {
|
||||
func (s *Threads) ListConversations(ctx context.Context, req *pb.ListConversationsRequest, rsp *pb.ListConversationsResponse) error {
|
||||
// validate the request
|
||||
if len(req.GroupId) == 0 {
|
||||
return ErrMissingGroupID
|
||||
@@ -5,8 +5,8 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/micro/services/streams/handler"
|
||||
pb "github.com/micro/services/streams/proto"
|
||||
"github.com/micro/services/threads/handler"
|
||||
pb "github.com/micro/services/threads/proto"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
@@ -5,14 +5,14 @@ import (
|
||||
|
||||
"github.com/micro/micro/v3/service/errors"
|
||||
"github.com/micro/micro/v3/service/logger"
|
||||
pb "github.com/micro/services/streams/proto"
|
||||
pb "github.com/micro/services/threads/proto"
|
||||
)
|
||||
|
||||
const DefaultLimit = 25
|
||||
|
||||
// List the messages within a conversation in reverse chronological order, using sent_before to
|
||||
// offset as older messages need to be loaded
|
||||
func (s *Streams) ListMessages(ctx context.Context, req *pb.ListMessagesRequest, rsp *pb.ListMessagesResponse) error {
|
||||
func (s *Threads) ListMessages(ctx context.Context, req *pb.ListMessagesRequest, rsp *pb.ListMessagesResponse) error {
|
||||
// validate the request
|
||||
if len(req.ConversationId) == 0 {
|
||||
return ErrMissingConversationID
|
||||
@@ -8,8 +8,8 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/micro/services/streams/handler"
|
||||
pb "github.com/micro/services/streams/proto"
|
||||
"github.com/micro/services/threads/handler"
|
||||
pb "github.com/micro/services/threads/proto"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"google.golang.org/protobuf/types/known/wrapperspb"
|
||||
)
|
||||
@@ -7,11 +7,11 @@ import (
|
||||
|
||||
"github.com/micro/micro/v3/service/errors"
|
||||
"github.com/micro/micro/v3/service/logger"
|
||||
pb "github.com/micro/services/streams/proto"
|
||||
pb "github.com/micro/services/threads/proto"
|
||||
)
|
||||
|
||||
// Read a conversation using its ID, can filter using group ID if provided
|
||||
func (s *Streams) ReadConversation(ctx context.Context, req *pb.ReadConversationRequest, rsp *pb.ReadConversationResponse) error {
|
||||
func (s *Threads) ReadConversation(ctx context.Context, req *pb.ReadConversationRequest, rsp *pb.ReadConversationResponse) error {
|
||||
// validate the request
|
||||
if len(req.Id) == 0 {
|
||||
return ErrMissingID
|
||||
@@ -5,8 +5,8 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/micro/services/streams/handler"
|
||||
pb "github.com/micro/services/streams/proto"
|
||||
"github.com/micro/services/threads/handler"
|
||||
pb "github.com/micro/services/threads/proto"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"google.golang.org/protobuf/types/known/wrapperspb"
|
||||
)
|
||||
@@ -5,14 +5,14 @@ import (
|
||||
|
||||
"github.com/micro/micro/v3/service/errors"
|
||||
"github.com/micro/micro/v3/service/logger"
|
||||
pb "github.com/micro/services/streams/proto"
|
||||
pb "github.com/micro/services/threads/proto"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// RecentMessages returns the most recent messages in a group of conversations. By default the
|
||||
// most messages retrieved per conversation is 25, however this can be overriden using the
|
||||
// limit_per_conversation option
|
||||
func (s *Streams) RecentMessages(ctx context.Context, req *pb.RecentMessagesRequest, rsp *pb.RecentMessagesResponse) error {
|
||||
func (s *Threads) RecentMessages(ctx context.Context, req *pb.RecentMessagesRequest, rsp *pb.RecentMessagesResponse) error {
|
||||
// validate the request
|
||||
if len(req.ConversationIds) == 0 {
|
||||
return ErrMissingConversationIDs
|
||||
@@ -7,8 +7,8 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/micro/services/streams/handler"
|
||||
pb "github.com/micro/services/streams/proto"
|
||||
"github.com/micro/services/threads/handler"
|
||||
pb "github.com/micro/services/threads/proto"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"google.golang.org/protobuf/types/known/wrapperspb"
|
||||
)
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/micro/micro/v3/service/errors"
|
||||
pb "github.com/micro/services/streams/proto"
|
||||
pb "github.com/micro/services/threads/proto"
|
||||
"google.golang.org/protobuf/types/known/timestamppb"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
@@ -20,7 +20,7 @@ var (
|
||||
ErrNotFound = errors.NotFound("NOT_FOUND", "Conversation not found")
|
||||
)
|
||||
|
||||
type Streams struct {
|
||||
type Threads struct {
|
||||
DB *gorm.DB
|
||||
Time func() time.Time
|
||||
}
|
||||
@@ -4,17 +4,17 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/micro/services/streams/handler"
|
||||
pb "github.com/micro/services/streams/proto"
|
||||
"github.com/micro/services/threads/handler"
|
||||
pb "github.com/micro/services/threads/proto"
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"gorm.io/driver/postgres"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
func testHandler(t *testing.T) *handler.Streams {
|
||||
func testHandler(t *testing.T) *handler.Threads {
|
||||
// connect to the database
|
||||
db, err := gorm.Open(postgres.Open("postgresql://postgres@localhost:5432/streams?sslmode=disable"), &gorm.Config{})
|
||||
db, err := gorm.Open(postgres.Open("postgresql://postgres@localhost:5432/threads?sslmode=disable"), &gorm.Config{})
|
||||
if err != nil {
|
||||
t.Fatalf("Error connecting to database: %v", err)
|
||||
}
|
||||
@@ -29,7 +29,7 @@ func testHandler(t *testing.T) *handler.Streams {
|
||||
t.Fatalf("Error cleaning database: %v", err)
|
||||
}
|
||||
|
||||
return &handler.Streams{DB: db, Time: func() time.Time { return time.Unix(1611327673, 0) }}
|
||||
return &handler.Threads{DB: db, Time: func() time.Time { return time.Unix(1611327673, 0) }}
|
||||
}
|
||||
|
||||
func assertConversationsMatch(t *testing.T, exp, act *pb.Conversation) {
|
||||
@@ -5,12 +5,12 @@ import (
|
||||
|
||||
"github.com/micro/micro/v3/service/errors"
|
||||
"github.com/micro/micro/v3/service/logger"
|
||||
pb "github.com/micro/services/streams/proto"
|
||||
pb "github.com/micro/services/threads/proto"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// Update a conversations topic
|
||||
func (s *Streams) UpdateConversation(ctx context.Context, req *pb.UpdateConversationRequest, rsp *pb.UpdateConversationResponse) error {
|
||||
func (s *Threads) UpdateConversation(ctx context.Context, req *pb.UpdateConversationRequest, rsp *pb.UpdateConversationResponse) error {
|
||||
// validate the request
|
||||
if len(req.Id) == 0 {
|
||||
return ErrMissingID
|
||||
@@ -5,8 +5,8 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/micro/services/streams/handler"
|
||||
pb "github.com/micro/services/streams/proto"
|
||||
"github.com/micro/services/threads/handler"
|
||||
pb "github.com/micro/services/threads/proto"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
@@ -3,8 +3,8 @@ package main
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/micro/services/streams/handler"
|
||||
pb "github.com/micro/services/streams/proto"
|
||||
"github.com/micro/services/threads/handler"
|
||||
pb "github.com/micro/services/threads/proto"
|
||||
|
||||
"github.com/micro/micro/v3/service"
|
||||
"github.com/micro/micro/v3/service/config"
|
||||
@@ -13,17 +13,17 @@ import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
var dbAddress = "postgresql://postgres@localhost:5432/streams?sslmode=disable"
|
||||
var dbAddress = "postgresql://postgres@localhost:5432/threads?sslmode=disable"
|
||||
|
||||
func main() {
|
||||
// Create service
|
||||
srv := service.New(
|
||||
service.Name("streams"),
|
||||
service.Name("threads"),
|
||||
service.Version("latest"),
|
||||
)
|
||||
|
||||
// Connect to the database
|
||||
cfg, err := config.Get("streams.database")
|
||||
cfg, err := config.Get("threads.database")
|
||||
if err != nil {
|
||||
logger.Fatalf("Error loading config: %v", err)
|
||||
}
|
||||
@@ -37,7 +37,7 @@ func main() {
|
||||
}
|
||||
|
||||
// Register handler
|
||||
pb.RegisterStreamsHandler(srv.Server(), &handler.Streams{DB: db, Time: time.Now})
|
||||
pb.RegisterThreadsHandler(srv.Server(), &handler.Threads{DB: db, Time: time.Now})
|
||||
|
||||
// Run service
|
||||
if err := srv.Run(); err != nil {
|
||||
1
threads/micro.mu
Normal file
1
threads/micro.mu
Normal file
@@ -0,0 +1 @@
|
||||
service threads
|
||||
911
threads/proto/threads.pb.go
Normal file
911
threads/proto/threads.pb.go
Normal file
@@ -0,0 +1,911 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// source: proto/threads.proto
|
||||
|
||||
package threads
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
timestamp "github.com/golang/protobuf/ptypes/timestamp"
|
||||
wrappers "github.com/golang/protobuf/ptypes/wrappers"
|
||||
math "math"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
// A compilation error at this line likely means your copy of the
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
type Conversation struct {
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
GroupId string `protobuf:"bytes,2,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"`
|
||||
Topic string `protobuf:"bytes,3,opt,name=topic,proto3" json:"topic,omitempty"`
|
||||
CreatedAt *timestamp.Timestamp `protobuf:"bytes,4,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *Conversation) Reset() { *m = Conversation{} }
|
||||
func (m *Conversation) String() string { return proto.CompactTextString(m) }
|
||||
func (*Conversation) ProtoMessage() {}
|
||||
func (*Conversation) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_78fcd0275ccaea0d, []int{0}
|
||||
}
|
||||
|
||||
func (m *Conversation) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_Conversation.Unmarshal(m, b)
|
||||
}
|
||||
func (m *Conversation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_Conversation.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *Conversation) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Conversation.Merge(m, src)
|
||||
}
|
||||
func (m *Conversation) XXX_Size() int {
|
||||
return xxx_messageInfo_Conversation.Size(m)
|
||||
}
|
||||
func (m *Conversation) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Conversation.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Conversation proto.InternalMessageInfo
|
||||
|
||||
func (m *Conversation) GetId() string {
|
||||
if m != nil {
|
||||
return m.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Conversation) GetGroupId() string {
|
||||
if m != nil {
|
||||
return m.GroupId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Conversation) GetTopic() string {
|
||||
if m != nil {
|
||||
return m.Topic
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Conversation) GetCreatedAt() *timestamp.Timestamp {
|
||||
if m != nil {
|
||||
return m.CreatedAt
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type Message 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"`
|
||||
ConversationId string `protobuf:"bytes,3,opt,name=conversation_id,json=conversationId,proto3" json:"conversation_id,omitempty"`
|
||||
Text string `protobuf:"bytes,4,opt,name=text,proto3" json:"text,omitempty"`
|
||||
SentAt *timestamp.Timestamp `protobuf:"bytes,5,opt,name=sent_at,json=sentAt,proto3" json:"sent_at,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *Message) Reset() { *m = Message{} }
|
||||
func (m *Message) String() string { return proto.CompactTextString(m) }
|
||||
func (*Message) ProtoMessage() {}
|
||||
func (*Message) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_78fcd0275ccaea0d, []int{1}
|
||||
}
|
||||
|
||||
func (m *Message) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_Message.Unmarshal(m, b)
|
||||
}
|
||||
func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_Message.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *Message) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Message.Merge(m, src)
|
||||
}
|
||||
func (m *Message) XXX_Size() int {
|
||||
return xxx_messageInfo_Message.Size(m)
|
||||
}
|
||||
func (m *Message) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Message.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Message proto.InternalMessageInfo
|
||||
|
||||
func (m *Message) GetId() string {
|
||||
if m != nil {
|
||||
return m.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Message) GetAuthorId() string {
|
||||
if m != nil {
|
||||
return m.AuthorId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Message) GetConversationId() string {
|
||||
if m != nil {
|
||||
return m.ConversationId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Message) GetText() string {
|
||||
if m != nil {
|
||||
return m.Text
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Message) GetSentAt() *timestamp.Timestamp {
|
||||
if m != nil {
|
||||
return m.SentAt
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type CreateConversationRequest struct {
|
||||
GroupId string `protobuf:"bytes,1,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"`
|
||||
Topic string `protobuf:"bytes,2,opt,name=topic,proto3" json:"topic,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *CreateConversationRequest) Reset() { *m = CreateConversationRequest{} }
|
||||
func (m *CreateConversationRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*CreateConversationRequest) ProtoMessage() {}
|
||||
func (*CreateConversationRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_78fcd0275ccaea0d, []int{2}
|
||||
}
|
||||
|
||||
func (m *CreateConversationRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_CreateConversationRequest.Unmarshal(m, b)
|
||||
}
|
||||
func (m *CreateConversationRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_CreateConversationRequest.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *CreateConversationRequest) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_CreateConversationRequest.Merge(m, src)
|
||||
}
|
||||
func (m *CreateConversationRequest) XXX_Size() int {
|
||||
return xxx_messageInfo_CreateConversationRequest.Size(m)
|
||||
}
|
||||
func (m *CreateConversationRequest) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_CreateConversationRequest.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_CreateConversationRequest proto.InternalMessageInfo
|
||||
|
||||
func (m *CreateConversationRequest) GetGroupId() string {
|
||||
if m != nil {
|
||||
return m.GroupId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *CreateConversationRequest) GetTopic() string {
|
||||
if m != nil {
|
||||
return m.Topic
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type CreateConversationResponse struct {
|
||||
Conversation *Conversation `protobuf:"bytes,1,opt,name=conversation,proto3" json:"conversation,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *CreateConversationResponse) Reset() { *m = CreateConversationResponse{} }
|
||||
func (m *CreateConversationResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*CreateConversationResponse) ProtoMessage() {}
|
||||
func (*CreateConversationResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_78fcd0275ccaea0d, []int{3}
|
||||
}
|
||||
|
||||
func (m *CreateConversationResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_CreateConversationResponse.Unmarshal(m, b)
|
||||
}
|
||||
func (m *CreateConversationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_CreateConversationResponse.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *CreateConversationResponse) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_CreateConversationResponse.Merge(m, src)
|
||||
}
|
||||
func (m *CreateConversationResponse) XXX_Size() int {
|
||||
return xxx_messageInfo_CreateConversationResponse.Size(m)
|
||||
}
|
||||
func (m *CreateConversationResponse) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_CreateConversationResponse.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_CreateConversationResponse proto.InternalMessageInfo
|
||||
|
||||
func (m *CreateConversationResponse) GetConversation() *Conversation {
|
||||
if m != nil {
|
||||
return m.Conversation
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type ReadConversationRequest struct {
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
GroupId *wrappers.StringValue `protobuf:"bytes,2,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *ReadConversationRequest) Reset() { *m = ReadConversationRequest{} }
|
||||
func (m *ReadConversationRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*ReadConversationRequest) ProtoMessage() {}
|
||||
func (*ReadConversationRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_78fcd0275ccaea0d, []int{4}
|
||||
}
|
||||
|
||||
func (m *ReadConversationRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_ReadConversationRequest.Unmarshal(m, b)
|
||||
}
|
||||
func (m *ReadConversationRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_ReadConversationRequest.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *ReadConversationRequest) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_ReadConversationRequest.Merge(m, src)
|
||||
}
|
||||
func (m *ReadConversationRequest) XXX_Size() int {
|
||||
return xxx_messageInfo_ReadConversationRequest.Size(m)
|
||||
}
|
||||
func (m *ReadConversationRequest) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_ReadConversationRequest.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_ReadConversationRequest proto.InternalMessageInfo
|
||||
|
||||
func (m *ReadConversationRequest) GetId() string {
|
||||
if m != nil {
|
||||
return m.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *ReadConversationRequest) GetGroupId() *wrappers.StringValue {
|
||||
if m != nil {
|
||||
return m.GroupId
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type ReadConversationResponse struct {
|
||||
Conversation *Conversation `protobuf:"bytes,1,opt,name=conversation,proto3" json:"conversation,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *ReadConversationResponse) Reset() { *m = ReadConversationResponse{} }
|
||||
func (m *ReadConversationResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*ReadConversationResponse) ProtoMessage() {}
|
||||
func (*ReadConversationResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_78fcd0275ccaea0d, []int{5}
|
||||
}
|
||||
|
||||
func (m *ReadConversationResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_ReadConversationResponse.Unmarshal(m, b)
|
||||
}
|
||||
func (m *ReadConversationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_ReadConversationResponse.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *ReadConversationResponse) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_ReadConversationResponse.Merge(m, src)
|
||||
}
|
||||
func (m *ReadConversationResponse) XXX_Size() int {
|
||||
return xxx_messageInfo_ReadConversationResponse.Size(m)
|
||||
}
|
||||
func (m *ReadConversationResponse) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_ReadConversationResponse.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_ReadConversationResponse proto.InternalMessageInfo
|
||||
|
||||
func (m *ReadConversationResponse) GetConversation() *Conversation {
|
||||
if m != nil {
|
||||
return m.Conversation
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type ListConversationsRequest struct {
|
||||
GroupId string `protobuf:"bytes,1,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *ListConversationsRequest) Reset() { *m = ListConversationsRequest{} }
|
||||
func (m *ListConversationsRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*ListConversationsRequest) ProtoMessage() {}
|
||||
func (*ListConversationsRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_78fcd0275ccaea0d, []int{6}
|
||||
}
|
||||
|
||||
func (m *ListConversationsRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_ListConversationsRequest.Unmarshal(m, b)
|
||||
}
|
||||
func (m *ListConversationsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_ListConversationsRequest.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *ListConversationsRequest) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_ListConversationsRequest.Merge(m, src)
|
||||
}
|
||||
func (m *ListConversationsRequest) XXX_Size() int {
|
||||
return xxx_messageInfo_ListConversationsRequest.Size(m)
|
||||
}
|
||||
func (m *ListConversationsRequest) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_ListConversationsRequest.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_ListConversationsRequest proto.InternalMessageInfo
|
||||
|
||||
func (m *ListConversationsRequest) GetGroupId() string {
|
||||
if m != nil {
|
||||
return m.GroupId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type ListConversationsResponse struct {
|
||||
Conversations []*Conversation `protobuf:"bytes,1,rep,name=conversations,proto3" json:"conversations,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *ListConversationsResponse) Reset() { *m = ListConversationsResponse{} }
|
||||
func (m *ListConversationsResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*ListConversationsResponse) ProtoMessage() {}
|
||||
func (*ListConversationsResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_78fcd0275ccaea0d, []int{7}
|
||||
}
|
||||
|
||||
func (m *ListConversationsResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_ListConversationsResponse.Unmarshal(m, b)
|
||||
}
|
||||
func (m *ListConversationsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_ListConversationsResponse.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *ListConversationsResponse) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_ListConversationsResponse.Merge(m, src)
|
||||
}
|
||||
func (m *ListConversationsResponse) XXX_Size() int {
|
||||
return xxx_messageInfo_ListConversationsResponse.Size(m)
|
||||
}
|
||||
func (m *ListConversationsResponse) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_ListConversationsResponse.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_ListConversationsResponse proto.InternalMessageInfo
|
||||
|
||||
func (m *ListConversationsResponse) GetConversations() []*Conversation {
|
||||
if m != nil {
|
||||
return m.Conversations
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type UpdateConversationRequest struct {
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Topic string `protobuf:"bytes,2,opt,name=topic,proto3" json:"topic,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *UpdateConversationRequest) Reset() { *m = UpdateConversationRequest{} }
|
||||
func (m *UpdateConversationRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*UpdateConversationRequest) ProtoMessage() {}
|
||||
func (*UpdateConversationRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_78fcd0275ccaea0d, []int{8}
|
||||
}
|
||||
|
||||
func (m *UpdateConversationRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_UpdateConversationRequest.Unmarshal(m, b)
|
||||
}
|
||||
func (m *UpdateConversationRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_UpdateConversationRequest.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *UpdateConversationRequest) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_UpdateConversationRequest.Merge(m, src)
|
||||
}
|
||||
func (m *UpdateConversationRequest) XXX_Size() int {
|
||||
return xxx_messageInfo_UpdateConversationRequest.Size(m)
|
||||
}
|
||||
func (m *UpdateConversationRequest) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_UpdateConversationRequest.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_UpdateConversationRequest proto.InternalMessageInfo
|
||||
|
||||
func (m *UpdateConversationRequest) GetId() string {
|
||||
if m != nil {
|
||||
return m.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *UpdateConversationRequest) GetTopic() string {
|
||||
if m != nil {
|
||||
return m.Topic
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type UpdateConversationResponse struct {
|
||||
Conversation *Conversation `protobuf:"bytes,1,opt,name=conversation,proto3" json:"conversation,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *UpdateConversationResponse) Reset() { *m = UpdateConversationResponse{} }
|
||||
func (m *UpdateConversationResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*UpdateConversationResponse) ProtoMessage() {}
|
||||
func (*UpdateConversationResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_78fcd0275ccaea0d, []int{9}
|
||||
}
|
||||
|
||||
func (m *UpdateConversationResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_UpdateConversationResponse.Unmarshal(m, b)
|
||||
}
|
||||
func (m *UpdateConversationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_UpdateConversationResponse.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *UpdateConversationResponse) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_UpdateConversationResponse.Merge(m, src)
|
||||
}
|
||||
func (m *UpdateConversationResponse) XXX_Size() int {
|
||||
return xxx_messageInfo_UpdateConversationResponse.Size(m)
|
||||
}
|
||||
func (m *UpdateConversationResponse) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_UpdateConversationResponse.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_UpdateConversationResponse proto.InternalMessageInfo
|
||||
|
||||
func (m *UpdateConversationResponse) GetConversation() *Conversation {
|
||||
if m != nil {
|
||||
return m.Conversation
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type DeleteConversationRequest struct {
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *DeleteConversationRequest) Reset() { *m = DeleteConversationRequest{} }
|
||||
func (m *DeleteConversationRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*DeleteConversationRequest) ProtoMessage() {}
|
||||
func (*DeleteConversationRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_78fcd0275ccaea0d, []int{10}
|
||||
}
|
||||
|
||||
func (m *DeleteConversationRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_DeleteConversationRequest.Unmarshal(m, b)
|
||||
}
|
||||
func (m *DeleteConversationRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_DeleteConversationRequest.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *DeleteConversationRequest) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_DeleteConversationRequest.Merge(m, src)
|
||||
}
|
||||
func (m *DeleteConversationRequest) XXX_Size() int {
|
||||
return xxx_messageInfo_DeleteConversationRequest.Size(m)
|
||||
}
|
||||
func (m *DeleteConversationRequest) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_DeleteConversationRequest.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_DeleteConversationRequest proto.InternalMessageInfo
|
||||
|
||||
func (m *DeleteConversationRequest) GetId() string {
|
||||
if m != nil {
|
||||
return m.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type DeleteConversationResponse struct {
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *DeleteConversationResponse) Reset() { *m = DeleteConversationResponse{} }
|
||||
func (m *DeleteConversationResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*DeleteConversationResponse) ProtoMessage() {}
|
||||
func (*DeleteConversationResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_78fcd0275ccaea0d, []int{11}
|
||||
}
|
||||
|
||||
func (m *DeleteConversationResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_DeleteConversationResponse.Unmarshal(m, b)
|
||||
}
|
||||
func (m *DeleteConversationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_DeleteConversationResponse.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *DeleteConversationResponse) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_DeleteConversationResponse.Merge(m, src)
|
||||
}
|
||||
func (m *DeleteConversationResponse) XXX_Size() int {
|
||||
return xxx_messageInfo_DeleteConversationResponse.Size(m)
|
||||
}
|
||||
func (m *DeleteConversationResponse) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_DeleteConversationResponse.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_DeleteConversationResponse proto.InternalMessageInfo
|
||||
|
||||
type CreateMessageRequest struct {
|
||||
ConversationId string `protobuf:"bytes,1,opt,name=conversation_id,json=conversationId,proto3" json:"conversation_id,omitempty"`
|
||||
AuthorId string `protobuf:"bytes,2,opt,name=author_id,json=authorId,proto3" json:"author_id,omitempty"`
|
||||
Text string `protobuf:"bytes,3,opt,name=text,proto3" json:"text,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *CreateMessageRequest) Reset() { *m = CreateMessageRequest{} }
|
||||
func (m *CreateMessageRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*CreateMessageRequest) ProtoMessage() {}
|
||||
func (*CreateMessageRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_78fcd0275ccaea0d, []int{12}
|
||||
}
|
||||
|
||||
func (m *CreateMessageRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_CreateMessageRequest.Unmarshal(m, b)
|
||||
}
|
||||
func (m *CreateMessageRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_CreateMessageRequest.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *CreateMessageRequest) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_CreateMessageRequest.Merge(m, src)
|
||||
}
|
||||
func (m *CreateMessageRequest) XXX_Size() int {
|
||||
return xxx_messageInfo_CreateMessageRequest.Size(m)
|
||||
}
|
||||
func (m *CreateMessageRequest) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_CreateMessageRequest.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_CreateMessageRequest proto.InternalMessageInfo
|
||||
|
||||
func (m *CreateMessageRequest) GetConversationId() string {
|
||||
if m != nil {
|
||||
return m.ConversationId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *CreateMessageRequest) GetAuthorId() string {
|
||||
if m != nil {
|
||||
return m.AuthorId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *CreateMessageRequest) GetText() string {
|
||||
if m != nil {
|
||||
return m.Text
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type CreateMessageResponse struct {
|
||||
Message *Message `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *CreateMessageResponse) Reset() { *m = CreateMessageResponse{} }
|
||||
func (m *CreateMessageResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*CreateMessageResponse) ProtoMessage() {}
|
||||
func (*CreateMessageResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_78fcd0275ccaea0d, []int{13}
|
||||
}
|
||||
|
||||
func (m *CreateMessageResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_CreateMessageResponse.Unmarshal(m, b)
|
||||
}
|
||||
func (m *CreateMessageResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_CreateMessageResponse.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *CreateMessageResponse) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_CreateMessageResponse.Merge(m, src)
|
||||
}
|
||||
func (m *CreateMessageResponse) XXX_Size() int {
|
||||
return xxx_messageInfo_CreateMessageResponse.Size(m)
|
||||
}
|
||||
func (m *CreateMessageResponse) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_CreateMessageResponse.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_CreateMessageResponse proto.InternalMessageInfo
|
||||
|
||||
func (m *CreateMessageResponse) GetMessage() *Message {
|
||||
if m != nil {
|
||||
return m.Message
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type ListMessagesRequest struct {
|
||||
ConversationId string `protobuf:"bytes,1,opt,name=conversation_id,json=conversationId,proto3" json:"conversation_id,omitempty"`
|
||||
SentBefore *timestamp.Timestamp `protobuf:"bytes,2,opt,name=sent_before,json=sentBefore,proto3" json:"sent_before,omitempty"`
|
||||
Limit *wrappers.Int32Value `protobuf:"bytes,3,opt,name=limit,proto3" json:"limit,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *ListMessagesRequest) Reset() { *m = ListMessagesRequest{} }
|
||||
func (m *ListMessagesRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*ListMessagesRequest) ProtoMessage() {}
|
||||
func (*ListMessagesRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_78fcd0275ccaea0d, []int{14}
|
||||
}
|
||||
|
||||
func (m *ListMessagesRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_ListMessagesRequest.Unmarshal(m, b)
|
||||
}
|
||||
func (m *ListMessagesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_ListMessagesRequest.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *ListMessagesRequest) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_ListMessagesRequest.Merge(m, src)
|
||||
}
|
||||
func (m *ListMessagesRequest) XXX_Size() int {
|
||||
return xxx_messageInfo_ListMessagesRequest.Size(m)
|
||||
}
|
||||
func (m *ListMessagesRequest) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_ListMessagesRequest.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_ListMessagesRequest proto.InternalMessageInfo
|
||||
|
||||
func (m *ListMessagesRequest) GetConversationId() string {
|
||||
if m != nil {
|
||||
return m.ConversationId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *ListMessagesRequest) GetSentBefore() *timestamp.Timestamp {
|
||||
if m != nil {
|
||||
return m.SentBefore
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ListMessagesRequest) GetLimit() *wrappers.Int32Value {
|
||||
if m != nil {
|
||||
return m.Limit
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type ListMessagesResponse struct {
|
||||
Messages []*Message `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *ListMessagesResponse) Reset() { *m = ListMessagesResponse{} }
|
||||
func (m *ListMessagesResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*ListMessagesResponse) ProtoMessage() {}
|
||||
func (*ListMessagesResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_78fcd0275ccaea0d, []int{15}
|
||||
}
|
||||
|
||||
func (m *ListMessagesResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_ListMessagesResponse.Unmarshal(m, b)
|
||||
}
|
||||
func (m *ListMessagesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_ListMessagesResponse.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *ListMessagesResponse) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_ListMessagesResponse.Merge(m, src)
|
||||
}
|
||||
func (m *ListMessagesResponse) XXX_Size() int {
|
||||
return xxx_messageInfo_ListMessagesResponse.Size(m)
|
||||
}
|
||||
func (m *ListMessagesResponse) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_ListMessagesResponse.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_ListMessagesResponse proto.InternalMessageInfo
|
||||
|
||||
func (m *ListMessagesResponse) GetMessages() []*Message {
|
||||
if m != nil {
|
||||
return m.Messages
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type RecentMessagesRequest struct {
|
||||
ConversationIds []string `protobuf:"bytes,1,rep,name=conversation_ids,json=conversationIds,proto3" json:"conversation_ids,omitempty"`
|
||||
LimitPerConversation *wrappers.Int32Value `protobuf:"bytes,2,opt,name=limit_per_conversation,json=limitPerConversation,proto3" json:"limit_per_conversation,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *RecentMessagesRequest) Reset() { *m = RecentMessagesRequest{} }
|
||||
func (m *RecentMessagesRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*RecentMessagesRequest) ProtoMessage() {}
|
||||
func (*RecentMessagesRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_78fcd0275ccaea0d, []int{16}
|
||||
}
|
||||
|
||||
func (m *RecentMessagesRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_RecentMessagesRequest.Unmarshal(m, b)
|
||||
}
|
||||
func (m *RecentMessagesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_RecentMessagesRequest.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *RecentMessagesRequest) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_RecentMessagesRequest.Merge(m, src)
|
||||
}
|
||||
func (m *RecentMessagesRequest) XXX_Size() int {
|
||||
return xxx_messageInfo_RecentMessagesRequest.Size(m)
|
||||
}
|
||||
func (m *RecentMessagesRequest) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_RecentMessagesRequest.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_RecentMessagesRequest proto.InternalMessageInfo
|
||||
|
||||
func (m *RecentMessagesRequest) GetConversationIds() []string {
|
||||
if m != nil {
|
||||
return m.ConversationIds
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *RecentMessagesRequest) GetLimitPerConversation() *wrappers.Int32Value {
|
||||
if m != nil {
|
||||
return m.LimitPerConversation
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type RecentMessagesResponse struct {
|
||||
Messages []*Message `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *RecentMessagesResponse) Reset() { *m = RecentMessagesResponse{} }
|
||||
func (m *RecentMessagesResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*RecentMessagesResponse) ProtoMessage() {}
|
||||
func (*RecentMessagesResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_78fcd0275ccaea0d, []int{17}
|
||||
}
|
||||
|
||||
func (m *RecentMessagesResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_RecentMessagesResponse.Unmarshal(m, b)
|
||||
}
|
||||
func (m *RecentMessagesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_RecentMessagesResponse.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *RecentMessagesResponse) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_RecentMessagesResponse.Merge(m, src)
|
||||
}
|
||||
func (m *RecentMessagesResponse) XXX_Size() int {
|
||||
return xxx_messageInfo_RecentMessagesResponse.Size(m)
|
||||
}
|
||||
func (m *RecentMessagesResponse) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_RecentMessagesResponse.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_RecentMessagesResponse proto.InternalMessageInfo
|
||||
|
||||
func (m *RecentMessagesResponse) GetMessages() []*Message {
|
||||
if m != nil {
|
||||
return m.Messages
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*Conversation)(nil), "threads.Conversation")
|
||||
proto.RegisterType((*Message)(nil), "threads.Message")
|
||||
proto.RegisterType((*CreateConversationRequest)(nil), "threads.CreateConversationRequest")
|
||||
proto.RegisterType((*CreateConversationResponse)(nil), "threads.CreateConversationResponse")
|
||||
proto.RegisterType((*ReadConversationRequest)(nil), "threads.ReadConversationRequest")
|
||||
proto.RegisterType((*ReadConversationResponse)(nil), "threads.ReadConversationResponse")
|
||||
proto.RegisterType((*ListConversationsRequest)(nil), "threads.ListConversationsRequest")
|
||||
proto.RegisterType((*ListConversationsResponse)(nil), "threads.ListConversationsResponse")
|
||||
proto.RegisterType((*UpdateConversationRequest)(nil), "threads.UpdateConversationRequest")
|
||||
proto.RegisterType((*UpdateConversationResponse)(nil), "threads.UpdateConversationResponse")
|
||||
proto.RegisterType((*DeleteConversationRequest)(nil), "threads.DeleteConversationRequest")
|
||||
proto.RegisterType((*DeleteConversationResponse)(nil), "threads.DeleteConversationResponse")
|
||||
proto.RegisterType((*CreateMessageRequest)(nil), "threads.CreateMessageRequest")
|
||||
proto.RegisterType((*CreateMessageResponse)(nil), "threads.CreateMessageResponse")
|
||||
proto.RegisterType((*ListMessagesRequest)(nil), "threads.ListMessagesRequest")
|
||||
proto.RegisterType((*ListMessagesResponse)(nil), "threads.ListMessagesResponse")
|
||||
proto.RegisterType((*RecentMessagesRequest)(nil), "threads.RecentMessagesRequest")
|
||||
proto.RegisterType((*RecentMessagesResponse)(nil), "threads.RecentMessagesResponse")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("proto/threads.proto", fileDescriptor_78fcd0275ccaea0d) }
|
||||
|
||||
var fileDescriptor_78fcd0275ccaea0d = []byte{
|
||||
// 749 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0xdb, 0x6e, 0xd3, 0x4a,
|
||||
0x14, 0x95, 0xd3, 0xa6, 0x69, 0x76, 0x7a, 0x3b, 0xd3, 0xb4, 0xc7, 0x71, 0x6f, 0x39, 0x73, 0x1e,
|
||||
0x4e, 0x0f, 0xa0, 0x54, 0xa4, 0x42, 0xa8, 0xea, 0x53, 0x2f, 0x42, 0x8a, 0x28, 0x88, 0x9a, 0x96,
|
||||
0xa2, 0x4a, 0x55, 0xe4, 0xc4, 0xd3, 0xd4, 0x52, 0x62, 0x1b, 0xcf, 0x04, 0xf8, 0x06, 0xde, 0xf9,
|
||||
0x07, 0x9e, 0xf8, 0x11, 0x7e, 0x0a, 0x65, 0x66, 0x9c, 0x8c, 0x2f, 0x93, 0x02, 0x7d, 0xf3, 0xcc,
|
||||
0xac, 0xd9, 0x5e, 0x6b, 0xcf, 0x5e, 0x0b, 0x56, 0xc3, 0x28, 0x60, 0xc1, 0x1e, 0xbb, 0x8b, 0x88,
|
||||
0xe3, 0xd2, 0x06, 0x5f, 0xa1, 0x92, 0x5c, 0x5a, 0x3b, 0xbd, 0x20, 0xe8, 0xf5, 0xc9, 0x1e, 0xdf,
|
||||
0xee, 0x0c, 0x6f, 0xf7, 0x98, 0x37, 0x20, 0x94, 0x39, 0x83, 0x50, 0x20, 0xad, 0xed, 0x34, 0xe0,
|
||||
0x53, 0xe4, 0x84, 0x21, 0x89, 0x64, 0x25, 0xfc, 0xc5, 0x80, 0x85, 0x93, 0xc0, 0xff, 0x48, 0x22,
|
||||
0xea, 0x30, 0x2f, 0xf0, 0xd1, 0x12, 0x14, 0x3c, 0xd7, 0x34, 0xea, 0xc6, 0x6e, 0xd9, 0x2e, 0x78,
|
||||
0x2e, 0xaa, 0xc1, 0x7c, 0x2f, 0x0a, 0x86, 0x61, 0xdb, 0x73, 0xcd, 0x02, 0xdf, 0x2d, 0xf1, 0x75,
|
||||
0xcb, 0x45, 0x55, 0x28, 0xb2, 0x20, 0xf4, 0xba, 0xe6, 0x0c, 0xdf, 0x17, 0x0b, 0x74, 0x00, 0xd0,
|
||||
0x8d, 0x88, 0xc3, 0x88, 0xdb, 0x76, 0x98, 0x39, 0x5b, 0x37, 0x76, 0x2b, 0x4d, 0xab, 0x21, 0x68,
|
||||
0x34, 0x62, 0x1a, 0x8d, 0x8b, 0x98, 0xa7, 0x5d, 0x96, 0xe8, 0x23, 0x86, 0xbf, 0x19, 0x50, 0x7a,
|
||||
0x45, 0x28, 0x75, 0x7a, 0x24, 0xc3, 0x63, 0x03, 0xca, 0xce, 0x90, 0xdd, 0x05, 0xd1, 0x84, 0xc8,
|
||||
0xbc, 0xd8, 0x68, 0xb9, 0xe8, 0x3f, 0x58, 0xee, 0x2a, 0x22, 0x46, 0x10, 0xc1, 0x69, 0x49, 0xdd,
|
||||
0x6e, 0xb9, 0x08, 0xc1, 0x2c, 0x23, 0x9f, 0x05, 0xad, 0xb2, 0xcd, 0xbf, 0xd1, 0x3e, 0x94, 0x28,
|
||||
0xf1, 0xd9, 0x88, 0x6d, 0xf1, 0x5e, 0xb6, 0x73, 0x23, 0xe8, 0x11, 0xc3, 0x67, 0x50, 0x3b, 0xe1,
|
||||
0xbc, 0xd5, 0xe6, 0xd9, 0xe4, 0xc3, 0x90, 0x50, 0x96, 0xe8, 0x99, 0xa1, 0xe9, 0x59, 0x41, 0xe9,
|
||||
0x19, 0xbe, 0x02, 0x2b, 0xaf, 0x1a, 0x0d, 0x03, 0x9f, 0x12, 0x74, 0x00, 0x0b, 0xaa, 0x0c, 0x5e,
|
||||
0xb2, 0xd2, 0x5c, 0x6b, 0xc4, 0x33, 0x91, 0xb8, 0x94, 0x80, 0xe2, 0x0e, 0xfc, 0x6d, 0x13, 0xc7,
|
||||
0xcd, 0x23, 0x99, 0x6e, 0xf0, 0xf3, 0xd4, 0x43, 0x57, 0x9a, 0x9b, 0x99, 0x3e, 0xbc, 0x65, 0x91,
|
||||
0xe7, 0xf7, 0xde, 0x39, 0xfd, 0x21, 0x19, 0x4b, 0xc2, 0x97, 0x60, 0x66, 0xff, 0xf1, 0x70, 0xea,
|
||||
0xcf, 0xc0, 0x3c, 0xf3, 0x28, 0x53, 0x11, 0xf4, 0xfe, 0x06, 0xe3, 0xf7, 0x50, 0xcb, 0xb9, 0x26,
|
||||
0xe9, 0x1c, 0xc2, 0xa2, 0xfa, 0x0f, 0x6a, 0x1a, 0xf5, 0x19, 0x3d, 0x9f, 0x24, 0x16, 0x1f, 0x41,
|
||||
0xed, 0x32, 0x74, 0x35, 0x4f, 0x9e, 0xee, 0xa6, 0xf6, 0x9d, 0xf3, 0x4a, 0x3c, 0xbc, 0x59, 0x8f,
|
||||
0xa1, 0x76, 0x4a, 0xfa, 0xe4, 0x97, 0xb8, 0xe1, 0x4d, 0xb0, 0xf2, 0xc0, 0x82, 0x05, 0x0e, 0xa1,
|
||||
0x2a, 0x66, 0x51, 0x3a, 0x31, 0xae, 0x92, 0xe3, 0x31, 0x23, 0xd7, 0x63, 0x53, 0x9d, 0x1a, 0x1b,
|
||||
0x70, 0x66, 0x62, 0x40, 0x7c, 0x02, 0x6b, 0xa9, 0x3f, 0xca, 0x86, 0x3c, 0x82, 0xd2, 0x40, 0x6c,
|
||||
0xc9, 0x5e, 0xac, 0x8c, 0x7b, 0x11, 0x43, 0x63, 0x00, 0xfe, 0x6e, 0xc0, 0xea, 0xe8, 0xe1, 0xe5,
|
||||
0x01, 0xfd, 0x6d, 0xda, 0x87, 0x50, 0xe1, 0x31, 0xd0, 0x21, 0xb7, 0x41, 0x44, 0xa4, 0x05, 0xa6,
|
||||
0x45, 0x01, 0x8c, 0xe0, 0xc7, 0x1c, 0x8d, 0x9e, 0x42, 0xb1, 0xef, 0x0d, 0x3c, 0xa1, 0xab, 0xd2,
|
||||
0xdc, 0xc8, 0x5c, 0x6b, 0xf9, 0x6c, 0xbf, 0x29, 0x8c, 0x23, 0x90, 0xf8, 0x14, 0xaa, 0x49, 0xbe,
|
||||
0x52, 0xf4, 0x13, 0x98, 0x97, 0x9a, 0xe2, 0xf1, 0xcc, 0xaa, 0x1e, 0x23, 0xf0, 0x57, 0x03, 0xd6,
|
||||
0x6c, 0xd2, 0x25, 0x7e, 0x46, 0xf8, 0xff, 0xb0, 0x92, 0x12, 0x2e, 0xea, 0x95, 0xed, 0xe5, 0xa4,
|
||||
0x72, 0x8a, 0xce, 0x61, 0x9d, 0x73, 0x6a, 0x87, 0x24, 0x6a, 0x27, 0x46, 0xb0, 0x70, 0xbf, 0x9c,
|
||||
0x2a, 0xbf, 0xfa, 0x86, 0x44, 0xea, 0x34, 0xe1, 0x17, 0xb0, 0x9e, 0xa6, 0xf5, 0x27, 0xfa, 0x9a,
|
||||
0x3f, 0x8a, 0x50, 0xba, 0x10, 0xa7, 0xe8, 0x06, 0x50, 0x36, 0x25, 0x11, 0x9e, 0xf8, 0x43, 0x17,
|
||||
0xc8, 0xd6, 0xbf, 0x53, 0x31, 0x92, 0xd8, 0x15, 0xac, 0xa4, 0x73, 0x0c, 0xd5, 0xc7, 0x17, 0x35,
|
||||
0x31, 0x6a, 0xfd, 0x33, 0x05, 0x21, 0x0b, 0xdf, 0x00, 0xca, 0xba, 0x5e, 0xe1, 0xad, 0x4d, 0x15,
|
||||
0x85, 0xf7, 0x94, 0xd8, 0xb8, 0x01, 0x94, 0xb5, 0xb3, 0x52, 0x5e, 0x1b, 0x0c, 0x4a, 0x79, 0x7d,
|
||||
0x1e, 0xa0, 0x6b, 0xf8, 0x2b, 0x13, 0xa8, 0x68, 0xa2, 0x5a, 0x97, 0xd1, 0x16, 0x9e, 0x06, 0x91,
|
||||
0xb5, 0x5f, 0xc3, 0x62, 0xc2, 0xf9, 0x68, 0x2b, 0xf5, 0x50, 0xc9, 0x0c, 0xb2, 0xb6, 0x75, 0xc7,
|
||||
0xb2, 0xde, 0x4b, 0x58, 0x50, 0x3d, 0x85, 0x36, 0x13, 0x1c, 0x52, 0x0e, 0xb1, 0xb6, 0x34, 0xa7,
|
||||
0xb2, 0xd8, 0x39, 0x2c, 0x25, 0x47, 0x18, 0x6d, 0x2b, 0x6f, 0x9d, 0x63, 0x39, 0x6b, 0x47, 0x7b,
|
||||
0x2e, 0x4a, 0x1e, 0x2f, 0x5f, 0x2f, 0x72, 0x0b, 0x1d, 0x4a, 0x5c, 0x67, 0x8e, 0x2f, 0xf7, 0x7f,
|
||||
0x06, 0x00, 0x00, 0xff, 0xff, 0x8c, 0xab, 0xc6, 0xc8, 0xe6, 0x09, 0x00, 0x00,
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
// Code generated by protoc-gen-micro. DO NOT EDIT.
|
||||
// source: proto/streams.proto
|
||||
// source: proto/threads.proto
|
||||
|
||||
package streams
|
||||
package threads
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
@@ -35,15 +35,15 @@ var _ context.Context
|
||||
var _ client.Option
|
||||
var _ server.Option
|
||||
|
||||
// Api Endpoints for Streams service
|
||||
// Api Endpoints for Threads service
|
||||
|
||||
func NewStreamsEndpoints() []*api.Endpoint {
|
||||
func NewThreadsEndpoints() []*api.Endpoint {
|
||||
return []*api.Endpoint{}
|
||||
}
|
||||
|
||||
// Client API for Streams service
|
||||
// Client API for Threads service
|
||||
|
||||
type StreamsService interface {
|
||||
type ThreadsService interface {
|
||||
// Create a conversation
|
||||
CreateConversation(ctx context.Context, in *CreateConversationRequest, opts ...client.CallOption) (*CreateConversationResponse, error)
|
||||
// Read a conversation using its ID, can filter using group ID if provided
|
||||
@@ -60,25 +60,25 @@ type StreamsService interface {
|
||||
// offset as older messages need to be loaded
|
||||
ListMessages(ctx context.Context, in *ListMessagesRequest, opts ...client.CallOption) (*ListMessagesResponse, error)
|
||||
// RecentMessages returns the most recent messages in a group of conversations. By default the
|
||||
// most messages retrieved per conversation is 10, however this can be overriden using the
|
||||
// most messages retrieved per conversation is 25, however this can be overriden using the
|
||||
// limit_per_conversation option
|
||||
RecentMessages(ctx context.Context, in *RecentMessagesRequest, opts ...client.CallOption) (*RecentMessagesResponse, error)
|
||||
}
|
||||
|
||||
type streamsService struct {
|
||||
type threadsService struct {
|
||||
c client.Client
|
||||
name string
|
||||
}
|
||||
|
||||
func NewStreamsService(name string, c client.Client) StreamsService {
|
||||
return &streamsService{
|
||||
func NewThreadsService(name string, c client.Client) ThreadsService {
|
||||
return &threadsService{
|
||||
c: c,
|
||||
name: name,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *streamsService) CreateConversation(ctx context.Context, in *CreateConversationRequest, opts ...client.CallOption) (*CreateConversationResponse, error) {
|
||||
req := c.c.NewRequest(c.name, "Streams.CreateConversation", in)
|
||||
func (c *threadsService) CreateConversation(ctx context.Context, in *CreateConversationRequest, opts ...client.CallOption) (*CreateConversationResponse, error) {
|
||||
req := c.c.NewRequest(c.name, "Threads.CreateConversation", in)
|
||||
out := new(CreateConversationResponse)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
@@ -87,8 +87,8 @@ func (c *streamsService) CreateConversation(ctx context.Context, in *CreateConve
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *streamsService) ReadConversation(ctx context.Context, in *ReadConversationRequest, opts ...client.CallOption) (*ReadConversationResponse, error) {
|
||||
req := c.c.NewRequest(c.name, "Streams.ReadConversation", in)
|
||||
func (c *threadsService) ReadConversation(ctx context.Context, in *ReadConversationRequest, opts ...client.CallOption) (*ReadConversationResponse, error) {
|
||||
req := c.c.NewRequest(c.name, "Threads.ReadConversation", in)
|
||||
out := new(ReadConversationResponse)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
@@ -97,8 +97,8 @@ func (c *streamsService) ReadConversation(ctx context.Context, in *ReadConversat
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *streamsService) UpdateConversation(ctx context.Context, in *UpdateConversationRequest, opts ...client.CallOption) (*UpdateConversationResponse, error) {
|
||||
req := c.c.NewRequest(c.name, "Streams.UpdateConversation", in)
|
||||
func (c *threadsService) UpdateConversation(ctx context.Context, in *UpdateConversationRequest, opts ...client.CallOption) (*UpdateConversationResponse, error) {
|
||||
req := c.c.NewRequest(c.name, "Threads.UpdateConversation", in)
|
||||
out := new(UpdateConversationResponse)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
@@ -107,8 +107,8 @@ func (c *streamsService) UpdateConversation(ctx context.Context, in *UpdateConve
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *streamsService) DeleteConversation(ctx context.Context, in *DeleteConversationRequest, opts ...client.CallOption) (*DeleteConversationResponse, error) {
|
||||
req := c.c.NewRequest(c.name, "Streams.DeleteConversation", in)
|
||||
func (c *threadsService) DeleteConversation(ctx context.Context, in *DeleteConversationRequest, opts ...client.CallOption) (*DeleteConversationResponse, error) {
|
||||
req := c.c.NewRequest(c.name, "Threads.DeleteConversation", in)
|
||||
out := new(DeleteConversationResponse)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
@@ -117,8 +117,8 @@ func (c *streamsService) DeleteConversation(ctx context.Context, in *DeleteConve
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *streamsService) ListConversations(ctx context.Context, in *ListConversationsRequest, opts ...client.CallOption) (*ListConversationsResponse, error) {
|
||||
req := c.c.NewRequest(c.name, "Streams.ListConversations", in)
|
||||
func (c *threadsService) ListConversations(ctx context.Context, in *ListConversationsRequest, opts ...client.CallOption) (*ListConversationsResponse, error) {
|
||||
req := c.c.NewRequest(c.name, "Threads.ListConversations", in)
|
||||
out := new(ListConversationsResponse)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
@@ -127,8 +127,8 @@ func (c *streamsService) ListConversations(ctx context.Context, in *ListConversa
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *streamsService) CreateMessage(ctx context.Context, in *CreateMessageRequest, opts ...client.CallOption) (*CreateMessageResponse, error) {
|
||||
req := c.c.NewRequest(c.name, "Streams.CreateMessage", in)
|
||||
func (c *threadsService) CreateMessage(ctx context.Context, in *CreateMessageRequest, opts ...client.CallOption) (*CreateMessageResponse, error) {
|
||||
req := c.c.NewRequest(c.name, "Threads.CreateMessage", in)
|
||||
out := new(CreateMessageResponse)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
@@ -137,8 +137,8 @@ func (c *streamsService) CreateMessage(ctx context.Context, in *CreateMessageReq
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *streamsService) ListMessages(ctx context.Context, in *ListMessagesRequest, opts ...client.CallOption) (*ListMessagesResponse, error) {
|
||||
req := c.c.NewRequest(c.name, "Streams.ListMessages", in)
|
||||
func (c *threadsService) ListMessages(ctx context.Context, in *ListMessagesRequest, opts ...client.CallOption) (*ListMessagesResponse, error) {
|
||||
req := c.c.NewRequest(c.name, "Threads.ListMessages", in)
|
||||
out := new(ListMessagesResponse)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
@@ -147,8 +147,8 @@ func (c *streamsService) ListMessages(ctx context.Context, in *ListMessagesReque
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *streamsService) RecentMessages(ctx context.Context, in *RecentMessagesRequest, opts ...client.CallOption) (*RecentMessagesResponse, error) {
|
||||
req := c.c.NewRequest(c.name, "Streams.RecentMessages", in)
|
||||
func (c *threadsService) RecentMessages(ctx context.Context, in *RecentMessagesRequest, opts ...client.CallOption) (*RecentMessagesResponse, error) {
|
||||
req := c.c.NewRequest(c.name, "Threads.RecentMessages", in)
|
||||
out := new(RecentMessagesResponse)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
@@ -157,9 +157,9 @@ func (c *streamsService) RecentMessages(ctx context.Context, in *RecentMessagesR
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// Server API for Streams service
|
||||
// Server API for Threads service
|
||||
|
||||
type StreamsHandler interface {
|
||||
type ThreadsHandler interface {
|
||||
// Create a conversation
|
||||
CreateConversation(context.Context, *CreateConversationRequest, *CreateConversationResponse) error
|
||||
// Read a conversation using its ID, can filter using group ID if provided
|
||||
@@ -176,13 +176,13 @@ type StreamsHandler interface {
|
||||
// offset as older messages need to be loaded
|
||||
ListMessages(context.Context, *ListMessagesRequest, *ListMessagesResponse) error
|
||||
// RecentMessages returns the most recent messages in a group of conversations. By default the
|
||||
// most messages retrieved per conversation is 10, however this can be overriden using the
|
||||
// most messages retrieved per conversation is 25, however this can be overriden using the
|
||||
// limit_per_conversation option
|
||||
RecentMessages(context.Context, *RecentMessagesRequest, *RecentMessagesResponse) error
|
||||
}
|
||||
|
||||
func RegisterStreamsHandler(s server.Server, hdlr StreamsHandler, opts ...server.HandlerOption) error {
|
||||
type streams interface {
|
||||
func RegisterThreadsHandler(s server.Server, hdlr ThreadsHandler, opts ...server.HandlerOption) error {
|
||||
type threads interface {
|
||||
CreateConversation(ctx context.Context, in *CreateConversationRequest, out *CreateConversationResponse) error
|
||||
ReadConversation(ctx context.Context, in *ReadConversationRequest, out *ReadConversationResponse) error
|
||||
UpdateConversation(ctx context.Context, in *UpdateConversationRequest, out *UpdateConversationResponse) error
|
||||
@@ -192,45 +192,45 @@ func RegisterStreamsHandler(s server.Server, hdlr StreamsHandler, opts ...server
|
||||
ListMessages(ctx context.Context, in *ListMessagesRequest, out *ListMessagesResponse) error
|
||||
RecentMessages(ctx context.Context, in *RecentMessagesRequest, out *RecentMessagesResponse) error
|
||||
}
|
||||
type Streams struct {
|
||||
streams
|
||||
type Threads struct {
|
||||
threads
|
||||
}
|
||||
h := &streamsHandler{hdlr}
|
||||
return s.Handle(s.NewHandler(&Streams{h}, opts...))
|
||||
h := &threadsHandler{hdlr}
|
||||
return s.Handle(s.NewHandler(&Threads{h}, opts...))
|
||||
}
|
||||
|
||||
type streamsHandler struct {
|
||||
StreamsHandler
|
||||
type threadsHandler struct {
|
||||
ThreadsHandler
|
||||
}
|
||||
|
||||
func (h *streamsHandler) CreateConversation(ctx context.Context, in *CreateConversationRequest, out *CreateConversationResponse) error {
|
||||
return h.StreamsHandler.CreateConversation(ctx, in, out)
|
||||
func (h *threadsHandler) CreateConversation(ctx context.Context, in *CreateConversationRequest, out *CreateConversationResponse) error {
|
||||
return h.ThreadsHandler.CreateConversation(ctx, in, out)
|
||||
}
|
||||
|
||||
func (h *streamsHandler) ReadConversation(ctx context.Context, in *ReadConversationRequest, out *ReadConversationResponse) error {
|
||||
return h.StreamsHandler.ReadConversation(ctx, in, out)
|
||||
func (h *threadsHandler) ReadConversation(ctx context.Context, in *ReadConversationRequest, out *ReadConversationResponse) error {
|
||||
return h.ThreadsHandler.ReadConversation(ctx, in, out)
|
||||
}
|
||||
|
||||
func (h *streamsHandler) UpdateConversation(ctx context.Context, in *UpdateConversationRequest, out *UpdateConversationResponse) error {
|
||||
return h.StreamsHandler.UpdateConversation(ctx, in, out)
|
||||
func (h *threadsHandler) UpdateConversation(ctx context.Context, in *UpdateConversationRequest, out *UpdateConversationResponse) error {
|
||||
return h.ThreadsHandler.UpdateConversation(ctx, in, out)
|
||||
}
|
||||
|
||||
func (h *streamsHandler) DeleteConversation(ctx context.Context, in *DeleteConversationRequest, out *DeleteConversationResponse) error {
|
||||
return h.StreamsHandler.DeleteConversation(ctx, in, out)
|
||||
func (h *threadsHandler) DeleteConversation(ctx context.Context, in *DeleteConversationRequest, out *DeleteConversationResponse) error {
|
||||
return h.ThreadsHandler.DeleteConversation(ctx, in, out)
|
||||
}
|
||||
|
||||
func (h *streamsHandler) ListConversations(ctx context.Context, in *ListConversationsRequest, out *ListConversationsResponse) error {
|
||||
return h.StreamsHandler.ListConversations(ctx, in, out)
|
||||
func (h *threadsHandler) ListConversations(ctx context.Context, in *ListConversationsRequest, out *ListConversationsResponse) error {
|
||||
return h.ThreadsHandler.ListConversations(ctx, in, out)
|
||||
}
|
||||
|
||||
func (h *streamsHandler) CreateMessage(ctx context.Context, in *CreateMessageRequest, out *CreateMessageResponse) error {
|
||||
return h.StreamsHandler.CreateMessage(ctx, in, out)
|
||||
func (h *threadsHandler) CreateMessage(ctx context.Context, in *CreateMessageRequest, out *CreateMessageResponse) error {
|
||||
return h.ThreadsHandler.CreateMessage(ctx, in, out)
|
||||
}
|
||||
|
||||
func (h *streamsHandler) ListMessages(ctx context.Context, in *ListMessagesRequest, out *ListMessagesResponse) error {
|
||||
return h.StreamsHandler.ListMessages(ctx, in, out)
|
||||
func (h *threadsHandler) ListMessages(ctx context.Context, in *ListMessagesRequest, out *ListMessagesResponse) error {
|
||||
return h.ThreadsHandler.ListMessages(ctx, in, out)
|
||||
}
|
||||
|
||||
func (h *streamsHandler) RecentMessages(ctx context.Context, in *RecentMessagesRequest, out *RecentMessagesResponse) error {
|
||||
return h.StreamsHandler.RecentMessages(ctx, in, out)
|
||||
func (h *threadsHandler) RecentMessages(ctx context.Context, in *RecentMessagesRequest, out *RecentMessagesResponse) error {
|
||||
return h.ThreadsHandler.RecentMessages(ctx, in, out)
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package streams;
|
||||
option go_package = "proto;streams";
|
||||
package threads;
|
||||
option go_package = "proto;threads";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "google/protobuf/wrappers.proto";
|
||||
|
||||
service Streams {
|
||||
service Threads {
|
||||
// Create a conversation
|
||||
rpc CreateConversation(CreateConversationRequest) returns (CreateConversationResponse);
|
||||
// Read a conversation using its ID, can filter using group ID if provided
|
||||
@@ -110,4 +110,4 @@ message RecentMessagesRequest {
|
||||
|
||||
message RecentMessagesResponse {
|
||||
repeated Message messages = 1;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user