Documentation ¶
Index ¶
- Variables
- func InitializeMongo(uri, username, password string) (*mongo.Client, error)
- type MongoRepo
- type MongoRepository
- func (m MongoRepository) Create(ctx context.Context, trainer *model.Trainer) (string, error)
- func (m MongoRepository) FindOne(ctx context.Context, id string) (*model.Trainer, error)
- func (m MongoRepository) List(ctx context.Context) (*[]model.Trainer, error)
- func (m MongoRepository) Update(ctx context.Context, trainer *model.Trainer) (*model.Trainer, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrTrainerNotFound = errors.New("trainer not found")
Functions ¶
Types ¶
type MongoRepository ¶
type MongoRepository struct {
// contains filtered or unexported fields
}
func NewMongoRepository ¶
func NewMongoRepository(collection *mongo.Collection) *MongoRepository
Click to show internal directories.
Click to hide internal directories.