Skip to content

Commit

Permalink
Merge pull request #602 from bjwswang/web
Browse files Browse the repository at this point in the history
feat: add new datasource Web
  • Loading branch information
bjwswang authored Jan 24, 2024
2 parents d1eb03b + 51a709b commit 8e6b337
Show file tree
Hide file tree
Showing 14 changed files with 511 additions and 3 deletions.
3 changes: 3 additions & 0 deletions api/base/v1alpha1/datasource.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const (
DatasourceTypeOSS DatasourceType = "oss"
DatasourceTypeRDMA DatasourceType = "RDMA"
DatasourceTypePostgreSQL DatasourceType = "postgresql"
DatasourceTypeWeb DatasourceType = "web"
DatasourceTypeUnknown DatasourceType = "unknown"
)

Expand All @@ -42,6 +43,8 @@ func (ds DatasourceSpec) Type() DatasourceType {
return DatasourceTypeRDMA
case ds.PostgreSQL != nil:
return DatasourceTypePostgreSQL
case ds.Web != nil:
return DatasourceTypeWeb
default:
return DatasourceTypeUnknown
}
Expand Down
9 changes: 9 additions & 0 deletions api/base/v1alpha1/datasource_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ type DatasourceSpec struct {

// PostgreSQL defines info for PostgreSQL
PostgreSQL *PostgreSQL `json:"postgresql,omitempty"`

// Web defines info for web resources
Web *Web `json:"web,omitempty"`
}

type RDMA struct {
Expand Down Expand Up @@ -85,6 +88,12 @@ const (
PGSSLPASSWORD = "PGSSLPASSWORD"
)

// Web defines info for web resources
type Web struct {
// RecommendIntervalTime is the recommended interval time for this crawler
RecommendIntervalTime int `json:"recommendIntervalTime,omitempty"`
}

// DatasourceStatus defines the observed state of Datasource
type DatasourceStatus struct {
// ConditionedStatus is the current status
Expand Down
20 changes: 20 additions & 0 deletions api/base/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8e6b337

Please sign in to comment.