Documentation
¶
Index ¶
- type MongoDBDriver
- func (m *MongoDBDriver) Close() error
- func (m *MongoDBDriver) Connect() error
- func (m *MongoDBDriver) DeleteUserData(accountID string) error
- func (m *MongoDBDriver) GetUserData(accountID string) (string, time.Time, error)
- func (m *MongoDBDriver) InsertUserData(accountID string, data string) error
- func (m *MongoDBDriver) Migrate() error
- type UserData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MongoDBDriver ¶
type MongoDBDriver struct { // External data DbHost string DbPort int DbUser string DbPass string DbName string // Internal data Db *mongo.Client }
MongoDBDriver represents the MongoDB database driver
func NewMongoDBDriver ¶
func NewMongoDBDriver(host string, port int, user string, pass string, dbName string, logger zerolog.Logger) *MongoDBDriver
NewMongoDBDriver creates a new instance of MongoDBDriver
func (*MongoDBDriver) Close ¶
func (m *MongoDBDriver) Close() error
Close closes the connection to the database
func (*MongoDBDriver) Connect ¶
func (m *MongoDBDriver) Connect() error
Connect establishes a connection to the database
func (*MongoDBDriver) DeleteUserData ¶
func (m *MongoDBDriver) DeleteUserData(accountID string) error
DeleteUserData deletes a user data record from the database
func (*MongoDBDriver) GetUserData ¶
GetUserData retrieves a user data record from the database
func (*MongoDBDriver) InsertUserData ¶
func (m *MongoDBDriver) InsertUserData(accountID string, data string) error
InsertUserData inserts a new user data record into the database
func (*MongoDBDriver) Migrate ¶
func (m *MongoDBDriver) Migrate() error
Migrate the schema to the database
Click to show internal directories.
Click to hide internal directories.