Documentation ¶
Index ¶
- Variables
- func ReplaceObjectIds(data interface{}) interface{}
- type Datasource
- func (ds *Datasource) Count(collectionName string, lookups *wst.A) (int64, error)
- func (ds *Datasource) Create(collectionName string, data *wst.M) (*wst.M, error)
- func (ds *Datasource) DeleteById(collectionName string, id interface{}) int64
- func (ds *Datasource) FindMany(collectionName string, lookups *wst.A) (*wst.A, error)
- func (ds *Datasource) Initialize() error
- func (ds *Datasource) UpdateById(collectionName string, id interface{}, data *wst.M) (*wst.M, error)
- type MongoDBDatasourceOptions
- type OperationError
- type Options
Constants ¶
This section is empty.
Variables ¶
View Source
var ( RegexDaysAgo = regexp.MustCompile(`^\$(\d+)dago$`) RegexWeeksAgo = regexp.MustCompile(`^\$(\d+)wago$`) RegexMonthsAgo = regexp.MustCompile(`^\$(\d+)mago$`) RegexYearsAgo = regexp.MustCompile(`^\$(\d+)yago$`) RegexSecondsAgo = regexp.MustCompile(`^\$(\d+)Sago$`) RegexMinutesAgo = regexp.MustCompile(`^\$(\d+)Mago$`) RegexHoursAgo = regexp.MustCompile(`^\$(\d+)Hago$`) RegexDaysFromNow = regexp.MustCompile(`^\$(\d+)dfromnow$`) RegexWeeksFromNow = regexp.MustCompile(`^\$(\d+)wfromnow$`) RegexMonthsFromNow = regexp.MustCompile(`^\$(\d+)mfromnow$`) RegexYearsFromNow = regexp.MustCompile(`^\$(\d+)yfromnow$`) RegexSecondsFromNow = regexp.MustCompile(`^\$(\d+)Sfromnow$`) RegexMinutesFromNow = regexp.MustCompile(`^\$(\d+)Mfromnow$`) RegexHoursFromNow = regexp.MustCompile(`^\$(\d+)Hfromnow$`) )
Functions ¶
func ReplaceObjectIds ¶ added in v1.2.12
func ReplaceObjectIds(data interface{}) interface{}
Types ¶
type Datasource ¶
type Datasource struct { Name string Db interface{} Viper *viper.Viper Key string Context context.Context Options *Options SubViper *viper.Viper // contains filtered or unexported fields }
func (*Datasource) DeleteById ¶
func (ds *Datasource) DeleteById(collectionName string, id interface{}) int64
func (*Datasource) Initialize ¶
func (ds *Datasource) Initialize() error
func (*Datasource) UpdateById ¶
type MongoDBDatasourceOptions ¶ added in v1.5.46
type OperationError ¶
func NewError ¶
func NewError(code int, message string) *OperationError
func (*OperationError) Error ¶
func (e *OperationError) Error() string
type Options ¶ added in v1.3.3
type Options struct {
MongoDB *MongoDBDatasourceOptions
}
Click to show internal directories.
Click to hide internal directories.