Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrorAlreadyUpToDate = "up to date"
View Source
var ErrorDocumentNotFound = "document not found"
View Source
var ErrorNameEmailPasswordEmpty = "either name or email or password cannot be empty"
View Source
var ErrorTitleAndTextEmpty = "title and text cannot be empty"
Functions ¶
func NewMongoDBRepo ¶
NewMongoDBRepo is the function for returning a mongoDBRepo.
func NewTestingRepo ¶
func NewTestingRepo(app *config.AppConfig) database.DatabaseRepo
NewTestingRepo is the function for returning a testDBRepo.
Types ¶
type Post ¶
type Post struct { ID primitive.ObjectID `bson:"_id,omitempty"` Title string `bson:"title,omitempty"` Text string `bson:"text,omitempty"` Creator string `bson:"creator,omitempty"` CreatedAt time.Time `bson:"created_at,omitempty"` UpdatedAt time.Time `bson:"updated_at,omitempty"` }
Post is the Post type used for communication with the mongo driver.
type User ¶
type User struct { ID primitive.ObjectID `bson:"_id,omitempty"` Name string `bson:"name,omitempty"` Email string `bson:"email,omitempty" validate:"omitempty,email"` Password string `bson:"password,omitempty"` Roles []string `bson:"roles,omitempty"` CreatedAt time.Time `bson:"created_at,omitempty"` }
User is the User type used for communication with the mongo driver.
Click to show internal directories.
Click to hide internal directories.