Documentation ¶
Index ¶
Constants ¶
View Source
const ( QUERY_TIMEOUT = 5 * time.Second COLLECTION = "users" )
View Source
const (
DB_TIMEOUT = 20 * time.Second
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type IUserStorage ¶
type IUserStorage interface { Insert(context.Context, models.User) error GetAll(context.Context, models.GetUserQueryParams) ([]models.User, error) GetById(context.Context, string) (*models.User, error) Update(context.Context, models.User) error DeleteById(context.Context, string) error }
DB CRUD opertions for the 'users' collection
func NewStorage ¶
func NewStorage(database *mongo.Database) IUserStorage
Click to show internal directories.
Click to hide internal directories.