Documentation ¶
Index ¶
- type MongoStore
- func (m *MongoStore) Connect() error
- func (m *MongoStore) CreateGuild(guild *models.Guild) error
- func (m *MongoStore) CreateUser(user *models.User) error
- func (m *MongoStore) Disconnect() error
- func (m *MongoStore) GetGuildById(id int) (*models.Guild, error)
- func (m *MongoStore) GetGuilds() ([]*models.Guild, error)
- func (m *MongoStore) GetUserById(id int) (*models.User, error)
- func (m *MongoStore) GetUsers() ([]*models.User, error)
- func (m *MongoStore) UpdateGuild(guild *models.Guild) error
- func (m *MongoStore) UpdateUser(user *models.User) error
- type Storage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MongoStore ¶
type MongoStore struct { Cfg *config.DBConfig Client *mongo.Client GuildsCollection *mongo.Collection UsersCollection *mongo.Collection }
func NewMongoStore ¶
func NewMongoStore(cfg *config.DBConfig) *MongoStore
func (*MongoStore) Connect ¶
func (m *MongoStore) Connect() error
func (*MongoStore) CreateGuild ¶
func (m *MongoStore) CreateGuild(guild *models.Guild) error
func (*MongoStore) CreateUser ¶
func (m *MongoStore) CreateUser(user *models.User) error
func (*MongoStore) Disconnect ¶
func (m *MongoStore) Disconnect() error
func (*MongoStore) GetGuildById ¶
func (m *MongoStore) GetGuildById(id int) (*models.Guild, error)
func (*MongoStore) GetUserById ¶
func (m *MongoStore) GetUserById(id int) (*models.User, error)
func (*MongoStore) UpdateGuild ¶
func (m *MongoStore) UpdateGuild(guild *models.Guild) error
func (*MongoStore) UpdateUser ¶
func (m *MongoStore) UpdateUser(user *models.User) error
type Storage ¶
type Storage interface { Connect() error Disconnect() error GetGuilds() ([]*models.Guild, error) GetGuildById(id int) (*models.Guild, error) GetUsers() ([]*models.User, error) GetUserById(id int) (*models.User, error) CreateGuild(guild *models.Guild) error CreateUser(user *models.User) error UpdateGuild(guild *models.Guild) error UpdateUser(user *models.User) error }
Click to show internal directories.
Click to hide internal directories.