Documentation ¶
Index ¶
- Variables
- type MongoHandler
- func (h *MongoHandler) AddUser(c models.Credentials) error
- func (h *MongoHandler) GetAllRosters() ([]models.Roster, error)
- func (h *MongoHandler) GetRoster(id int64) (*models.Roster, error)
- func (h *MongoHandler) GetUser(login string) (*models.Credentials, error)
- func (h *MongoHandler) PushPlayer(id int64, p models.Player) error
- func (h *MongoHandler) UpdateRoster(r models.Roster) error
- type NotFoundError
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrExists = errors.New("already exists")
ErrExists data already exists
Functions ¶
This section is empty.
Types ¶
type MongoHandler ¶
type MongoHandler struct {
// contains filtered or unexported fields
}
func NewMongoHandler ¶
func NewMongoHandler(cfg config.Database) (*MongoHandler, error)
NewMongoHandler connects to a MongoDB and creates database handler
func (*MongoHandler) AddUser ¶
func (h *MongoHandler) AddUser(c models.Credentials) error
func (*MongoHandler) GetAllRosters ¶
func (h *MongoHandler) GetAllRosters() ([]models.Roster, error)
func (*MongoHandler) GetUser ¶
func (h *MongoHandler) GetUser(login string) (*models.Credentials, error)
func (*MongoHandler) PushPlayer ¶
func (h *MongoHandler) PushPlayer(id int64, p models.Player) error
func (*MongoHandler) UpdateRoster ¶
func (h *MongoHandler) UpdateRoster(r models.Roster) error
type NotFoundError ¶
NotFoundError not found in database
var ErrNotFound *NotFoundError
ErrNotFound not found
func NewNotFoundError ¶
func NewNotFoundError(err error) *NotFoundError
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
func (*NotFoundError) Unwrap ¶
func (e *NotFoundError) Unwrap() error
Click to show internal directories.
Click to hide internal directories.