Documentation ¶
Index ¶
- Constants
- type RealtimeDatabase
- func (db *RealtimeDatabase) GetAllMessages() ([]entity.Message, error)
- func (db *RealtimeDatabase) GetMessageByUserID(userID string) ([]entity.Message, error)
- func (db *RealtimeDatabase) GetMessageByUsername(username string) ([]entity.Message, error)
- func (db *RealtimeDatabase) SaveMessage(sender entity.User, message entity.Message) error
Constants ¶
View Source
const ( MessageRef = "messages" UserIDMapRef = "userid_username_map" UsernameMapRef = "username_userid_map" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RealtimeDatabase ¶
type RealtimeDatabase struct {
// contains filtered or unexported fields
}
func NewRealtimeDatabase ¶
func NewRealtimeDatabase(cfg config.Firebase) (*RealtimeDatabase, error)
func (*RealtimeDatabase) GetAllMessages ¶
func (db *RealtimeDatabase) GetAllMessages() ([]entity.Message, error)
func (*RealtimeDatabase) GetMessageByUserID ¶
func (db *RealtimeDatabase) GetMessageByUserID(userID string) ([]entity.Message, error)
func (*RealtimeDatabase) GetMessageByUsername ¶
func (db *RealtimeDatabase) GetMessageByUsername(username string) ([]entity.Message, error)
func (*RealtimeDatabase) SaveMessage ¶
Click to show internal directories.
Click to hide internal directories.