mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-21 17:21:09 +01:00
feat: added modules
This commit is contained in:
8
db/generic/base.go
Normal file
8
db/generic/base.go
Normal file
@@ -0,0 +1,8 @@
|
||||
package generic
|
||||
|
||||
const (
|
||||
DataSourceTypeMongo = "mongo"
|
||||
DataSourceTypeMysql = "mysql"
|
||||
DataSourceTypePostgres = "postgres"
|
||||
DataSourceTypeElasticSearch = "postgres"
|
||||
)
|
||||
15
db/generic/list.go
Normal file
15
db/generic/list.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package generic
|
||||
|
||||
type ListQueryCondition struct {
|
||||
Key string
|
||||
Op string
|
||||
Value interface{}
|
||||
}
|
||||
|
||||
type ListQuery []ListQueryCondition
|
||||
|
||||
type ListOptions struct {
|
||||
Skip int
|
||||
Limit int
|
||||
Sort []ListSort
|
||||
}
|
||||
7
db/generic/op.go
Normal file
7
db/generic/op.go
Normal file
@@ -0,0 +1,7 @@
|
||||
package generic
|
||||
|
||||
type Op string
|
||||
|
||||
const (
|
||||
OpEqual = "eq"
|
||||
)
|
||||
13
db/generic/sort.go
Normal file
13
db/generic/sort.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package generic
|
||||
|
||||
type SortDirection string
|
||||
|
||||
const (
|
||||
SortDirectionAsc SortDirection = "asc"
|
||||
SortDirectionDesc SortDirection = "desc"
|
||||
)
|
||||
|
||||
type ListSort struct {
|
||||
Key string
|
||||
Direction SortDirection
|
||||
}
|
||||
Reference in New Issue
Block a user