Documentation ¶
Index ¶
- type ConversantRepository
- type ConversationRepository
- func (repo *ConversationRepository) CreateConversation(conversation repositories.Conversation) (*repositories.Conversation, error)
- func (repo *ConversationRepository) GetConversants(conversationID string) ([]repositories.Conversant, error)
- func (repo *ConversationRepository) RetrieveConversation(conversationID string, limit, offset int) (*repositories.Conversation, error)
- type MessageRepository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConversantRepository ¶
type ConversantRepository struct {
// contains filtered or unexported fields
}
func NewConversantRepository ¶
func NewConversantRepository(db *sqlx.DB) *ConversantRepository
func (*ConversantRepository) UpdateOrCreate ¶
func (repo *ConversantRepository) UpdateOrCreate(conversant repositories.Conversant) (*repositories.Conversant, error)
type ConversationRepository ¶
type ConversationRepository struct {
// contains filtered or unexported fields
}
ConversationRepository is an implementation of ConversationRepo that uses Postgres as it's backend
func NewConversationRepository ¶
func NewConversationRepository(db *sqlx.DB) *ConversationRepository
NewConversationRepository creates a Postgres instance of a ConversationRepo
func (*ConversationRepository) CreateConversation ¶
func (repo *ConversationRepository) CreateConversation(conversation repositories.Conversation) (*repositories.Conversation, error)
CreateConversation creates a conversation with a postgres transaction. If any of it fails, it rolls back or returns an error
func (*ConversationRepository) GetConversants ¶
func (repo *ConversationRepository) GetConversants(conversationID string) ([]repositories.Conversant, error)
GetConversants gets the conversants for a given conversation
func (*ConversationRepository) RetrieveConversation ¶
func (repo *ConversationRepository) RetrieveConversation(conversationID string, limit, offset int) (*repositories.Conversation, error)
RetrieveConversation grabs a conversation with the messages given a limit and offset
type MessageRepository ¶
type MessageRepository struct {
// contains filtered or unexported fields
}
MessageRepository is a MessageRepo implementation that uses Postgres to store messages
func NewMessageRepository ¶
func NewMessageRepository(db *sqlx.DB) *MessageRepository
NewMessageRepository creates a new Postgres MessageRepository
func (*MessageRepository) CreateMessage ¶
func (repo *MessageRepository) CreateMessage(message repositories.Message) (*repositories.Message, error)
CreateMessage stores a message in Postgres