Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultTimeout = time.Second * 30 Insert = "insert" Update = "update" Delete = "delete" )
Variables ¶
This section is empty.
Functions ¶
func GetMongoDbClient ¶ added in v0.8.0
GetMongoDbClient, return new mongo driver client
Types ¶
type AuditAuth ¶ added in v1.0.0
type AuditAuth struct {
User interface{}
}
AuthAudit, auth user for audit
type IBaseRepo ¶ added in v0.8.0
type IBaseRepo interface { InsertOne(doc interface{}, args ...interface{}) (interface{}, error) InsertMany(docs []interface{}, args ...interface{}) ([]interface{}, error) CountDocuments(filter interface{}, args ...interface{}) (int64, error) EstimatedDocumentCount(args ...interface{}) (int64, error) Find(filter interface{}, result interface{}, args ...interface{}) error FindOne(filter interface{}, result interface{}, args ...interface{}) error UpdateOne(filter interface{}, update interface{}, args ...interface{}) error UpdateMany(filter interface{}, update interface{}, args ...interface{}) (*UpdateResult, error) DeleteOne(filter interface{}, args ...interface{}) (int64, error) DeleteMany(filter interface{}, args ...interface{}) (int64, error) }
IBaseRepo
func NewMongoBaseRepo ¶ added in v0.8.0
func NewMongoBaseRepo(collection *mongo.Collection, baseRepoAudit ...IBaseRepoAudit) IBaseRepo
NewMongoBaseRepo, return base repo instance
type IBaseRepoAudit ¶ added in v1.0.0
type NotFoundError ¶ added in v1.0.0
type NotFoundError struct {
Message string
}
NotFoundError
func NewNotFoundError ¶ added in v1.0.0
func NewNotFoundError(message ...interface{}) *NotFoundError
NewApiPostError creates a new HTTPError instance.
func (*NotFoundError) Error ¶ added in v1.0.0
func (e *NotFoundError) Error() string
type UpdateResult ¶ added in v0.8.0
type UpdateResult struct { MatchedCount int64 ModifiedCount int64 UpsertedCount int64 UpsertedID interface{} }
UpdateResult
Click to show internal directories.
Click to hide internal directories.