mongo

package
v0.0.0-...-c1868ec Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MongoClient

type MongoClient struct {
	DB *mongo.Client
}

func (*MongoClient) CreatePlayer

func (m *MongoClient) CreatePlayer(ctx context.Context, player *models.Player) error

func (*MongoClient) FindOnePlayer

func (m *MongoClient) FindOnePlayer(ctx context.Context, filters *bson.M) (models.Player, error)

func (*MongoClient) FindPlayers

func (m *MongoClient) FindPlayers(ctx context.Context, filters *bson.M) ([]models.Player, error)

func (*MongoClient) GetPlayerCollection

func (m *MongoClient) GetPlayerCollection() *mongo.Collection

func (*MongoClient) ModifyPlayer

func (m *MongoClient) ModifyPlayer(ctx context.Context, playerID string, modifyFilter *bson.M) error

func (*MongoClient) Ready

func (c *MongoClient) Ready() bool

type MongoDBClient

type MongoDBClient interface {
	Ready() bool

	//Players
	CreatePlayer(context.Context, *models.Player) error
	FindOnePlayer(context.Context, *bson.M) (models.Player, error)
	FindPlayers(context.Context, *bson.M) ([]models.Player, error)
	ModifyPlayer(ctx context.Context, playerID string, modifyFilter *bson.M) error
}

func ReturnMongoClient

func ReturnMongoClient() (MongoDBClient, error)

Jump to

Keyboard shortcuts

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