-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
667 additions
and
97 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package controllers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package models | ||
|
||
import ( | ||
"github.com/crawlab-team/crawlab-core/entity" | ||
"go.mongodb.org/mongo-driver/bson/primitive" | ||
) | ||
|
||
type DataCollectionV2 struct { | ||
Id primitive.ObjectID `json:"_id" bson:"_id" collection:"data_collections"` | ||
BaseModelV2[DataCollection] `bson:",inline"` | ||
Name string `json:"name" bson:"name"` | ||
Fields []entity.DataField `json:"fields" bson:"fields"` | ||
Dedup struct { | ||
Enabled bool `json:"enabled" bson:"enabled"` | ||
Keys []string `json:"keys" bson:"keys"` | ||
Type string `json:"type" bson:"type"` | ||
} `json:"dedup" bson:"dedup"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package models | ||
|
||
import ( | ||
"go.mongodb.org/mongo-driver/bson/primitive" | ||
) | ||
|
||
type DataSourceV2 struct { | ||
Id primitive.ObjectID `json:"_id" bson:"_id" collection:"data_sources"` | ||
BaseModelV2[DataSource] `bson:",inline"` | ||
Name string `json:"name" bson:"name"` | ||
Type string `json:"type" bson:"type"` | ||
Description string `json:"description" bson:"description"` | ||
Host string `json:"host" bson:"host"` | ||
Port string `json:"port" bson:"port"` | ||
Url string `json:"url" bson:"url"` | ||
Hosts []string `json:"hosts" bson:"hosts"` | ||
Database string `json:"database" bson:"database"` | ||
Username string `json:"username" bson:"username"` | ||
Password string `json:"password,omitempty" bson:"-"` | ||
ConnectType string `json:"connect_type" bson:"connect_type"` | ||
Status string `json:"status" bson:"status"` | ||
Error string `json:"error" bson:"error"` | ||
Extra map[string]string `json:"extra,omitempty" bson:"extra,omitempty"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package models | ||
|
||
import ( | ||
"go.mongodb.org/mongo-driver/bson/primitive" | ||
"time" | ||
) | ||
|
||
type DependencySettingV2 struct { | ||
Id primitive.ObjectID `json:"_id" bson:"_id" collection:"dependency_settings"` | ||
BaseModelV2[DependencySetting] `bson:",inline"` | ||
Key string `json:"key" bson:"key"` | ||
Name string `json:"name" bson:"name"` | ||
Description string `json:"description" bson:"description"` | ||
Enabled bool `json:"enabled" bson:"enabled"` | ||
Cmd string `json:"cmd" bson:"cmd"` | ||
Proxy string `json:"proxy" bson:"proxy"` | ||
LastUpdateTs time.Time `json:"last_update_ts" bson:"last_update_ts"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package models | ||
|
||
import ( | ||
"go.mongodb.org/mongo-driver/bson/primitive" | ||
) | ||
|
||
type EnvironmentV2 struct { | ||
Id primitive.ObjectID `json:"_id" bson:"_id" collection:"environments"` | ||
BaseModelV2[EnvironmentV2] `bson:",inline"` | ||
Key string `json:"key" bson:"key"` | ||
Value string `json:"value" bson:"value"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package models | ||
|
||
import ( | ||
"go.mongodb.org/mongo-driver/bson/primitive" | ||
) | ||
|
||
type GitV2 struct { | ||
Id primitive.ObjectID `json:"_id" bson:"_id" collection:"gits"` | ||
BaseModelV2[GitV2] `bson:",inline"` | ||
Url string `json:"url" bson:"url"` | ||
AuthType string `json:"auth_type" bson:"auth_type"` | ||
Username string `json:"username" bson:"username"` | ||
Password string `json:"password" bson:"password"` | ||
CurrentBranch string `json:"current_branch" bson:"current_branch"` | ||
AutoPull bool `json:"auto_pull" bson:"auto_pull"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package models | ||
|
||
import ( | ||
"go.mongodb.org/mongo-driver/bson/primitive" | ||
) | ||
|
||
type PermissionV2 struct { | ||
Id primitive.ObjectID `json:"_id" bson:"_id" collection:"permissions"` | ||
BaseModelV2[PermissionV2] `bson:",inline"` | ||
Key string `json:"key" bson:"key"` | ||
Name string `json:"name" bson:"name"` | ||
Description string `json:"description" bson:"description"` | ||
Type string `json:"type" bson:"type"` | ||
Target []string `json:"target" bson:"target"` | ||
Allow []string `json:"allow" bson:"allow"` | ||
Deny []string `json:"deny" bson:"deny"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package models | ||
|
||
import ( | ||
"go.mongodb.org/mongo-driver/bson/primitive" | ||
) | ||
|
||
type RolePermissionV2 struct { | ||
Id primitive.ObjectID `json:"_id" bson:"_id" collection:"role_permissions"` | ||
BaseModelV2[RolePermissionV2] `bson:",inline"` | ||
RoleId primitive.ObjectID `json:"role_id" bson:"role_id"` | ||
PermissionId primitive.ObjectID `json:"permission_id" bson:"permission_id"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package models | ||
|
||
import ( | ||
"go.mongodb.org/mongo-driver/bson/primitive" | ||
) | ||
|
||
type RoleV2 struct { | ||
Id primitive.ObjectID `json:"_id" bson:"_id" collection:"roles"` | ||
BaseModelV2[RoleV2] `bson:",inline"` | ||
Key string `json:"key" bson:"key"` | ||
Name string `json:"name" bson:"name"` | ||
Description string `json:"description" bson:"description"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package models | ||
|
||
import ( | ||
"github.com/robfig/cron/v3" | ||
"go.mongodb.org/mongo-driver/bson/primitive" | ||
) | ||
|
||
type ScheduleV2 struct { | ||
Id primitive.ObjectID `json:"_id" bson:"_id" collection:"schedules"` | ||
BaseModelV2[ScheduleV2] `bson:",inline"` | ||
Name string `json:"name" bson:"name"` | ||
Description string `json:"description" bson:"description"` | ||
SpiderId primitive.ObjectID `json:"spider_id" bson:"spider_id"` | ||
Cron string `json:"cron" bson:"cron"` | ||
EntryId cron.EntryID `json:"entry_id" bson:"entry_id"` | ||
Cmd string `json:"cmd" bson:"cmd"` | ||
Param string `json:"param" bson:"param"` | ||
Mode string `json:"mode" bson:"mode"` | ||
NodeIds []primitive.ObjectID `json:"node_ids" bson:"node_ids"` | ||
Priority int `json:"priority" bson:"priority"` | ||
Enabled bool `json:"enabled" bson:"enabled"` | ||
UserId primitive.ObjectID `json:"user_id" bson:"user_id"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package models | ||
|
||
import ( | ||
"go.mongodb.org/mongo-driver/bson" | ||
"go.mongodb.org/mongo-driver/bson/primitive" | ||
) | ||
|
||
type SettingV2 struct { | ||
Id primitive.ObjectID `json:"_id" bson:"_id" collection:"settings"` | ||
BaseModelV2[SettingV2] `bson:",inline"` | ||
Key string `json:"key" bson:"key"` | ||
Value bson.M `json:"value" bson:"value"` | ||
} |
Oops, something went wrong.