Documentation ¶
Index ¶
- Variables
- type MockTextChat
- func (mp *MockTextChat) AddConversation(ctx context.Context, conversation *data.Conversation) (*data.Conversation, error)
- func (mp *MockTextChat) AddMessage(ctx context.Context, message *data.Message) error
- func (mp *MockTextChat) AddUserToConversation(ctx context.Context, conversation *data.Conversation) error
- func (mp *MockTextChat) CloseDB()
- func (mp *MockTextChat) Connect() error
- func (mp *MockTextChat) DeleteConversation(ctx context.Context, id string) error
- func (mp *MockTextChat) DeleteMessage(ctx context.Context, id string) error
- func (mp *MockTextChat) GetConversationByID(ctx context.Context, id string) (*data.Conversation, error)
- func (mp *MockTextChat) GetMessageByID(ctx context.Context, id string) (*data.Message, error)
- func (mp *MockTextChat) GetMessagesByConversationID(ctx context.Context, id string) (data.Messages, error)
- func (mp *MockTextChat) PingDB() error
- type MongoTextChat
- func (mp *MongoTextChat) AddConversation(ctx context.Context, conversation *data.Conversation) (*data.Conversation, error)
- func (mp *MongoTextChat) AddMessage(ctx context.Context, message *data.Message) error
- func (mp *MongoTextChat) AddUserToConversation(ctx context.Context, conversation *data.Conversation) error
- func (mp *MongoTextChat) CloseDB()
- func (mp *MongoTextChat) Connect() error
- func (mp *MongoTextChat) DeleteConversation(ctx context.Context, id string) error
- func (mp *MongoTextChat) DeleteMessage(ctx context.Context, id string) error
- func (mp *MongoTextChat) GetConversationByID(ctx context.Context, id string) (*data.Conversation, error)
- func (mp *MongoTextChat) GetMessageByID(ctx context.Context, id string) (*data.Message, error)
- func (mp *MongoTextChat) GetMessagesByConversationID(ctx context.Context, id string) (data.Messages, error)
- func (mp *MongoTextChat) PingDB() error
- type TextChatDB
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrorEnvVar = fmt.Errorf("missing environment variable")
ErrorEnvVar : Environment variable error
Functions ¶
This section is empty.
Types ¶
type MockTextChat ¶
type MockTextChat struct { }
func (*MockTextChat) AddConversation ¶
func (mp *MockTextChat) AddConversation(ctx context.Context, conversation *data.Conversation) (*data.Conversation, error)
func (*MockTextChat) AddMessage ¶
func (*MockTextChat) AddUserToConversation ¶
func (mp *MockTextChat) AddUserToConversation(ctx context.Context, conversation *data.Conversation) error
func (*MockTextChat) CloseDB ¶
func (mp *MockTextChat) CloseDB()
func (*MockTextChat) Connect ¶
func (mp *MockTextChat) Connect() error
func (*MockTextChat) DeleteConversation ¶
func (mp *MockTextChat) DeleteConversation(ctx context.Context, id string) error
func (*MockTextChat) DeleteMessage ¶
func (mp *MockTextChat) DeleteMessage(ctx context.Context, id string) error
func (*MockTextChat) GetConversationByID ¶
func (mp *MockTextChat) GetConversationByID(ctx context.Context, id string) (*data.Conversation, error)
func (*MockTextChat) GetMessageByID ¶
func (*MockTextChat) GetMessagesByConversationID ¶
func (*MockTextChat) PingDB ¶
func (mp *MockTextChat) PingDB() error
type MongoTextChat ¶
type MongoTextChat struct {
// contains filtered or unexported fields
}
func (*MongoTextChat) AddConversation ¶
func (mp *MongoTextChat) AddConversation(ctx context.Context, conversation *data.Conversation) (*data.Conversation, error)
func (*MongoTextChat) AddMessage ¶
func (*MongoTextChat) AddUserToConversation ¶
func (mp *MongoTextChat) AddUserToConversation(ctx context.Context, conversation *data.Conversation) error
func (*MongoTextChat) CloseDB ¶
func (mp *MongoTextChat) CloseDB()
func (*MongoTextChat) Connect ¶
func (mp *MongoTextChat) Connect() error
func (*MongoTextChat) DeleteConversation ¶
func (mp *MongoTextChat) DeleteConversation(ctx context.Context, id string) error
func (*MongoTextChat) DeleteMessage ¶
func (mp *MongoTextChat) DeleteMessage(ctx context.Context, id string) error
func (*MongoTextChat) GetConversationByID ¶
func (mp *MongoTextChat) GetConversationByID(ctx context.Context, id string) (*data.Conversation, error)
func (*MongoTextChat) GetMessageByID ¶
func (*MongoTextChat) GetMessagesByConversationID ¶
func (*MongoTextChat) PingDB ¶
func (mp *MongoTextChat) PingDB() error
type TextChatDB ¶
type TextChatDB interface { GetMessageByID(ctx context.Context, id string) (*data.Message, error) GetConversationByID(ctx context.Context, id string) (*data.Conversation, error) GetMessagesByConversationID(ctx context.Context, id string) (data.Messages, error) AddMessage(ctx context.Context, message *data.Message) error AddConversation(ctx context.Context, conversation *data.Conversation) (*data.Conversation, error) AddUserToConversation(ctx context.Context, conversation *data.Conversation) error DeleteMessage(ctx context.Context, id string) error DeleteConversation(ctx context.Context, id string) error Connect() error PingDB() error CloseDB() }
The interface that any kind of database must implement
func NewMockTextChat ¶
func NewMockTextChat() TextChatDB
func NewMongoTextChat ¶
func NewMongoTextChat() TextChatDB
Click to show internal directories.
Click to hide internal directories.