database

package
v0.0.0-...-3b1adbd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 12, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

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) GetRoster

func (h *MongoHandler) GetRoster(id int64) (*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

type NotFoundError struct {
	Err  error
	Text string
}

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL