mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-21 17:21:09 +01:00
refactor: Update models to use DatabaseV2 instead of DataSourceV2
This commit is contained in:
@@ -11,7 +11,7 @@ type DataSource struct {
|
||||
Type string `json:"type" bson:"type"`
|
||||
Description string `json:"description" bson:"description"`
|
||||
Host string `json:"host" bson:"host"`
|
||||
Port string `json:"port" bson:"port"`
|
||||
Port int `json:"port" bson:"port"`
|
||||
Url string `json:"url" bson:"url"`
|
||||
Hosts []string `json:"hosts" bson:"hosts"`
|
||||
Database string `json:"database" bson:"database"`
|
||||
|
||||
@@ -4,12 +4,12 @@ type DatabaseV2 struct {
|
||||
any `collection:"databases"`
|
||||
BaseModelV2[DatabaseV2] `bson:",inline"`
|
||||
Name string `json:"name" bson:"name"`
|
||||
DataSource string `json:"data_source" bson:"data_source"`
|
||||
Type string `json:"type" bson:"type"`
|
||||
Description string `json:"description" bson:"description"`
|
||||
Host string `json:"host" bson:"host"`
|
||||
Port string `json:"port" bson:"port"`
|
||||
Port int `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:"-,omitempty" bson:"password"`
|
||||
@@ -17,4 +17,9 @@ type DatabaseV2 struct {
|
||||
Status string `json:"status" bson:"status"`
|
||||
Error string `json:"error" bson:"error"`
|
||||
Extra map[string]string `json:"extra,omitempty" bson:"extra,omitempty"`
|
||||
|
||||
MongoParams *struct {
|
||||
AuthSource string `json:"auth_source,omitempty" bson:"auth_source,omitempty"`
|
||||
AuthMechanism string `json:"auth_mechanism,omitempty" bson:"auth_mechanism,omitempty"`
|
||||
} `json:"mongo_params,omitempty" bson:"mongo_params,omitempty"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user