code stringlengths 1 1.05M | repo_name stringlengths 6 83 | path stringlengths 3 242 | language stringclasses 222
values | license stringclasses 20
values | size int64 1 1.05M |
|---|---|---|---|---|---|
package client
import (
"github.com/crawlab-team/crawlab/core/errors"
"github.com/crawlab-team/crawlab/core/interfaces"
"github.com/crawlab-team/crawlab/db/mongo"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
)
type NodeServiceDelegate struct {
interfaces.GrpcClientModelBaseSer... | 2302_79757062/crawlab | core/models/client/model_node_service.go | Go | bsd-3-clause | 1,801 |
package client
import (
config2 "github.com/crawlab-team/crawlab/core/config"
"github.com/crawlab-team/crawlab/core/container"
"github.com/crawlab-team/crawlab/core/interfaces"
)
type ServiceDelegate struct {
// settings
cfgPath string
// internals
c interfaces.GrpcClient
}
func (d *ServiceDelegate) GetConfi... | 2302_79757062/crawlab | core/models/client/model_service.go | Go | bsd-3-clause | 1,131 |
package client
import (
"encoding/json"
"github.com/crawlab-team/crawlab/core/grpc/client"
"github.com/crawlab-team/crawlab/core/interfaces"
nodeconfig "github.com/crawlab-team/crawlab/core/node/config"
"github.com/crawlab-team/crawlab/db/mongo"
grpc "github.com/crawlab-team/crawlab/grpc"
"go.mongodb.org/mongo-... | 2302_79757062/crawlab | core/models/client/model_service_v2.go | Go | bsd-3-clause | 8,795 |
package client
import (
"github.com/crawlab-team/crawlab/core/errors"
"github.com/crawlab-team/crawlab/core/interfaces"
"github.com/crawlab-team/crawlab/db/mongo"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
)
type SpiderServiceDelegate struct {
interfaces.GrpcClientModelBaseS... | 2302_79757062/crawlab | core/models/client/model_spider_service.go | Go | bsd-3-clause | 1,697 |
package client
import (
"github.com/crawlab-team/crawlab/core/errors"
"github.com/crawlab-team/crawlab/core/interfaces"
"github.com/crawlab-team/crawlab/db/mongo"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
)
type TaskServiceDelegate struct {
interfaces.GrpcClientModelBaseSer... | 2302_79757062/crawlab | core/models/client/model_task_service.go | Go | bsd-3-clause | 1,663 |
package client
import (
"github.com/crawlab-team/crawlab/core/errors"
"github.com/crawlab-team/crawlab/core/interfaces"
"github.com/crawlab-team/crawlab/db/mongo"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
)
type TaskStatServiceDelegate struct {
interfaces.GrpcClientModelBas... | 2302_79757062/crawlab | core/models/client/model_task_stat_service.go | Go | bsd-3-clause | 1,731 |
package client
import "github.com/crawlab-team/crawlab/core/interfaces"
type ModelDelegateOption func(delegate interfaces.GrpcClientModelDelegate)
func WithDelegateConfigPath(path string) ModelDelegateOption {
return func(d interfaces.GrpcClientModelDelegate) {
d.SetConfigPath(path)
}
}
type ModelServiceDelegat... | 2302_79757062/crawlab | core/models/client/options.go | Go | bsd-3-clause | 946 |
package common
import (
"github.com/crawlab-team/crawlab/core/constants"
"github.com/crawlab-team/crawlab/core/interfaces"
"github.com/crawlab-team/crawlab/db/mongo"
"go.mongodb.org/mongo-driver/bson"
mongo2 "go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"
)
func CreateIndexes() {... | 2302_79757062/crawlab | core/models/common/index_service.go | Go | bsd-3-clause | 4,560 |
package config_spider
import "github.com/crawlab-team/crawlab/core/entity"
func GetAllFields(data entity.ConfigSpiderData) []entity.Field {
var fields []entity.Field
for _, stage := range data.Stages {
fields = append(fields, stage.Fields...)
}
return fields
}
func GetStartStageName(data entity.ConfigSpiderDat... | 2302_79757062/crawlab | core/models/config_spider/common.go | Go | bsd-3-clause | 556 |
package config_spider
//import (
// "errors"
// "fmt"
// "github.com/crawlab-team/crawlab/core/constants"
// "github.com/crawlab-team/crawlab/core/entity"
// "github.com/crawlab-team/crawlab/core/models"
// "github.com/crawlab-team/crawlab/core/utils"
// "path/filepath"
//)
//
//type ScrapyGenerator struct {
// Spider... | 2302_79757062/crawlab | core/models/config_spider/scrapy.go | Go | bsd-3-clause | 7,516 |
package delegate
import (
"encoding/json"
errors2 "github.com/crawlab-team/crawlab/core/errors"
"github.com/crawlab-team/crawlab/core/event"
"github.com/crawlab-team/crawlab/core/interfaces"
"github.com/crawlab-team/crawlab/core/models/models"
"github.com/crawlab-team/crawlab/core/utils"
"github.com/crawlab-tea... | 2302_79757062/crawlab | core/models/delegate/model.go | Go | bsd-3-clause | 9,658 |
package delegate
import (
"github.com/crawlab-team/crawlab/core/constants"
"github.com/crawlab-team/crawlab/core/interfaces"
"time"
)
type ModelNodeDelegate struct {
n interfaces.Node
interfaces.ModelDelegate
}
func (d *ModelNodeDelegate) UpdateStatus(active bool, activeTs *time.Time, status string) (err error)... | 2302_79757062/crawlab | core/models/delegate/model_node.go | Go | bsd-3-clause | 889 |
package delegate
import (
"fmt"
"github.com/crawlab-team/crawlab/core/interfaces"
)
func GetEventName(d *ModelDelegate, method interfaces.ModelDelegateMethod) (eventName string) {
return getEventName(d, method)
}
func getEventName(d *ModelDelegate, method interfaces.ModelDelegateMethod) (eventName string) {
if m... | 2302_79757062/crawlab | core/models/delegate/utils_event.go | Go | bsd-3-clause | 524 |
package models
import (
"github.com/crawlab-team/crawlab/core/interfaces"
"go.mongodb.org/mongo-driver/bson/primitive"
)
type Artifact struct {
Id primitive.ObjectID `bson:"_id" json:"_id"`
Col string `bson:"_col" json:"_col"`
Del bool `bson:"_del" json:"_del"`
TagIds [... | 2302_79757062/crawlab | core/models/models/artifact.go | Go | bsd-3-clause | 1,185 |
package models
import (
"go.mongodb.org/mongo-driver/bson/primitive"
"time"
)
type ArtifactSys struct {
CreateTs time.Time `json:"create_ts" bson:"create_ts"`
CreateUid primitive.ObjectID `json:"create_uid" bson:"create_uid"`
UpdateTs time.Time `json:"update_ts" bson:"update_ts"`
UpdateUid p... | 2302_79757062/crawlab | core/models/models/artifact_sys.go | Go | bsd-3-clause | 1,466 |
package models
import (
"go.mongodb.org/mongo-driver/bson/primitive"
)
type BaseModel struct {
Id primitive.ObjectID `json:"_id" bson:"_id"`
}
func (d *BaseModel) GetId() (id primitive.ObjectID) {
return d.Id
}
| 2302_79757062/crawlab | core/models/models/base.go | Go | bsd-3-clause | 217 |
package models
import (
"go.mongodb.org/mongo-driver/bson/primitive"
"time"
)
type BaseModelV2[T any] struct {
Id primitive.ObjectID `json:"_id" bson:"_id"`
CreatedAt time.Time `json:"created_ts" bson:"created_ts"`
CreatedBy primitive.ObjectID `json:"created_by" bson:"created_by"`
UpdatedAt time... | 2302_79757062/crawlab | core/models/models/base_v2.go | Go | bsd-3-clause | 1,439 |
package models
import (
"github.com/crawlab-team/crawlab/core/entity"
"github.com/crawlab-team/crawlab/core/interfaces"
"go.mongodb.org/mongo-driver/bson/primitive"
)
type DataCollection struct {
Id primitive.ObjectID `json:"_id" bson:"_id"`
Name string `json:"name" bson:"name"`
Fields []entit... | 2302_79757062/crawlab | core/models/models/data_collection.go | Go | bsd-3-clause | 890 |
package models
import (
"github.com/crawlab-team/crawlab/core/entity"
)
type DataCollectionV2 struct {
any `collection:"data_collections"`
BaseModelV2[DataCollection] `bson:",inline"`
Name string `json:"name" bson:"name"`
Fields []en... | 2302_79757062/crawlab | core/models/models/data_collection_v2.go | Go | bsd-3-clause | 577 |
package models
import (
"github.com/crawlab-team/crawlab/core/interfaces"
"go.mongodb.org/mongo-driver/bson/primitive"
)
type DataSource struct {
Id primitive.ObjectID `json:"_id" bson:"_id"`
Name string `json:"name" bson:"name"`
Type string `json:"type" bson:"type"... | 2302_79757062/crawlab | core/models/models/data_source.go | Go | bsd-3-clause | 1,422 |
package models
type DataSourceV2 struct {
any `collection:"data_sources"`
BaseModelV2[DataSource] `bson:",inline"`
Name string `json:"name" bson:"name"`
Type string `json:"type" bson:"type"`
Description string `... | 2302_79757062/crawlab | core/models/models/data_source_v2.go | Go | bsd-3-clause | 1,191 |
package models
import (
"github.com/crawlab-team/crawlab/core/interfaces"
"go.mongodb.org/mongo-driver/bson/primitive"
"time"
)
type DependencySetting struct {
Id primitive.ObjectID `json:"_id" bson:"_id"`
Key string `json:"key" bson:"key"`
Name string `json:"n... | 2302_79757062/crawlab | core/models/models/dependency_setting.go | Go | bsd-3-clause | 1,023 |
package models
import (
"time"
)
type DependencySettingV2 struct {
any `collection:"dependency_settings"`
BaseModelV2[DependencySetting] `bson:",inline"`
Key string `json:"key" bson:"key"`
Name string `json:"name" bson:"name"`
... | 2302_79757062/crawlab | core/models/models/dependency_setting_v2.go | Go | bsd-3-clause | 702 |
package models
import (
"github.com/crawlab-team/crawlab/core/interfaces"
"go.mongodb.org/mongo-driver/bson/primitive"
)
type Environment struct {
Id primitive.ObjectID `json:"_id" bson:"_id"`
Key string `json:"key" bson:"key"`
Value string `json:"value" bson:"value"`
}
func (e *Env... | 2302_79757062/crawlab | core/models/models/environment.go | Go | bsd-3-clause | 883 |
package models
type EnvironmentV2 struct {
any `collection:"environments"`
BaseModelV2[EnvironmentV2] `bson:",inline"`
Key string `json:"key" bson:"key"`
Value string `json:"value" bson:"value"`
}
| 2302_79757062/crawlab | core/models/models/environment_v2.go | Go | bsd-3-clause | 269 |
package models
import (
"github.com/crawlab-team/crawlab/core/interfaces"
"go.mongodb.org/mongo-driver/bson/primitive"
)
type ExtraValue struct {
Id primitive.ObjectID `json:"_id" bson:"_id"`
ObjectId primitive.ObjectID `json:"oid" bson:"oid"`
Model string `json:"model" bson:"m"`
Type s... | 2302_79757062/crawlab | core/models/models/extra_value.go | Go | bsd-3-clause | 1,285 |
package models
import (
"github.com/crawlab-team/crawlab/core/interfaces"
"go.mongodb.org/mongo-driver/bson/primitive"
)
type Git struct {
Id primitive.ObjectID `json:"_id" bson:"_id"`
Url string `json:"url" bson:"url"`
AuthType string `json:"auth_type" bson:"aut... | 2302_79757062/crawlab | core/models/models/git.go | Go | bsd-3-clause | 1,737 |
package models
type GitV2 struct {
any `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... | 2302_79757062/crawlab | core/models/models/git_v2.go | Go | bsd-3-clause | 487 |
package models
import (
"github.com/crawlab-team/crawlab/core/interfaces"
"go.mongodb.org/mongo-driver/bson/primitive"
)
type Job struct {
Id primitive.ObjectID `bson:"_id" json:"_id"`
TaskId primitive.ObjectID `bson:"task_id" json:"task_id"`
}
func (j *Job) GetId() (id primitive.ObjectID) {
return j.Id
}
... | 2302_79757062/crawlab | core/models/models/job.go | Go | bsd-3-clause | 533 |
package models
import (
"github.com/crawlab-team/crawlab/core/interfaces"
"go.mongodb.org/mongo-driver/bson/primitive"
"time"
)
type Node struct {
Id primitive.ObjectID `json:"_id" bson:"_id"`
Key string `json:"key" bson:"key"`
Name string `json:"na... | 2302_79757062/crawlab | core/models/models/node.go | Go | bsd-3-clause | 2,775 |
package models
import (
"time"
)
type NodeV2 struct {
any `collection:"nodes"`
BaseModelV2[NodeV2] `bson:",inline"`
Key string `json:"key" bson:"key"`
Name string `json:"name" bson:"name"`
Ip string `json:"ip" bson:"ip"`
Port ... | 2302_79757062/crawlab | core/models/models/node_v2.go | Go | bsd-3-clause | 1,025 |
package models
import "go.mongodb.org/mongo-driver/bson/primitive"
type NotificationSettingV2 struct {
Id primitive.ObjectID `json:"_id" bson:"_id"`
Type string `json:"type" bson:"type"`
Name string `json:"name" bson:"name"`
Description string ... | 2302_79757062/crawlab | core/models/models/notification_setting_v2.go | Go | bsd-3-clause | 1,660 |
package models
import (
"github.com/crawlab-team/crawlab/core/interfaces"
"go.mongodb.org/mongo-driver/bson/primitive"
)
type Password struct {
Id primitive.ObjectID `json:"_id" bson:"_id"`
Password string `json:"password" bson:"p"`
}
func (p *Password) GetId() (id primitive.ObjectID) {
return... | 2302_79757062/crawlab | core/models/models/password.go | Go | bsd-3-clause | 562 |
package models
import (
"github.com/crawlab-team/crawlab/core/interfaces"
"go.mongodb.org/mongo-driver/bson/primitive"
)
type Permission struct {
Id primitive.ObjectID `json:"_id" bson:"_id"`
Key string `json:"key" bson:"key"`
Name string `json:"name" bson:"name"`
... | 2302_79757062/crawlab | core/models/models/permission.go | Go | bsd-3-clause | 1,915 |
package models
type PermissionV2 struct {
any `collection:"permissions"`
BaseModelV2[PermissionV2] `bson:",inline"`
Key string `json:"key" bson:"key"`
Name string `json:"name" bson:"name"`
Description string `json:"description" b... | 2302_79757062/crawlab | core/models/models/permission_v2.go | Go | bsd-3-clause | 595 |
package models
import (
"github.com/crawlab-team/crawlab/core/interfaces"
"go.mongodb.org/mongo-driver/bson/primitive"
)
type Project struct {
Id primitive.ObjectID `json:"_id" bson:"_id"`
Name string `json:"name" bson:"name"`
Description string `json:"description" bson:"d... | 2302_79757062/crawlab | core/models/models/project.go | Go | bsd-3-clause | 982 |
package models
type ProjectV2 struct {
any `collection:"projects"`
BaseModelV2[ProjectV2] `bson:",inline"`
Name string `json:"name" bson:"name"`
Description string `json:"description" bson:"description"`
Spiders int `json:"spiders" bson:"-"`
}
| 2302_79757062/crawlab | core/models/models/project_v2.go | Go | bsd-3-clause | 316 |
package models
import (
"github.com/crawlab-team/crawlab/core/constants"
"github.com/crawlab-team/crawlab/core/interfaces"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
)
type Result bson.M
func (r *Result) GetId() (id primitive.ObjectID) {
res, ok := r.Value()["_id"]
if ok {
... | 2302_79757062/crawlab | core/models/models/result.go | Go | bsd-3-clause | 1,121 |
package models
import (
"github.com/crawlab-team/crawlab/core/interfaces"
"go.mongodb.org/mongo-driver/bson/primitive"
)
type Role struct {
Id primitive.ObjectID `json:"_id" bson:"_id"`
Key string `json:"key" bson:"key"`
Name string `json:"name" bson:"name"`
Descr... | 2302_79757062/crawlab | core/models/models/role.go | Go | bsd-3-clause | 1,058 |
package models
import (
"github.com/crawlab-team/crawlab/core/interfaces"
"go.mongodb.org/mongo-driver/bson/primitive"
)
type RolePermission struct {
Id primitive.ObjectID `json:"_id" bson:"_id"`
RoleId primitive.ObjectID `json:"role_id" bson:"role_id"`
PermissionId primitive.ObjectID `json:"perm... | 2302_79757062/crawlab | core/models/models/role_permission.go | Go | bsd-3-clause | 692 |
package models
import (
"go.mongodb.org/mongo-driver/bson/primitive"
)
type RolePermissionV2 struct {
any `collection:"role_permissions"`
BaseModelV2[RolePermissionV2] `bson:",inline"`
RoleId primitive.ObjectID `json:"role_id" bson:"role_id"`
PermissionId ... | 2302_79757062/crawlab | core/models/models/role_permission_v2.go | Go | bsd-3-clause | 394 |
package models
type RoleV2 struct {
any `collection:"roles"`
BaseModelV2[RoleV2] `bson:",inline"`
Key string `json:"key" bson:"key"`
Name string `json:"name" bson:"name"`
Description string `json:"description" bson:"description"`
}
| 2302_79757062/crawlab | core/models/models/role_v2.go | Go | bsd-3-clause | 293 |
package models
import (
"github.com/crawlab-team/crawlab/core/interfaces"
"github.com/robfig/cron/v3"
"go.mongodb.org/mongo-driver/bson/primitive"
)
type Schedule struct {
Id primitive.ObjectID `json:"_id" bson:"_id"`
Name string `json:"name" bson:"name"`
Description string ... | 2302_79757062/crawlab | core/models/models/schedule.go | Go | bsd-3-clause | 2,525 |
package models
import (
"github.com/robfig/cron/v3"
"go.mongodb.org/mongo-driver/bson/primitive"
)
type ScheduleV2 struct {
any `collection:"schedules"`
BaseModelV2[ScheduleV2] `bson:",inline"`
Name string `json:"name" bson:"name"`
Description str... | 2302_79757062/crawlab | core/models/models/schedule_v2.go | Go | bsd-3-clause | 1,146 |
package models
import (
"github.com/crawlab-team/crawlab/core/interfaces"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
)
type Setting struct {
Id primitive.ObjectID `json:"_id" bson:"_id"`
Key string `json:"key" bson:"key"`
Value bson.M `json:"valu... | 2302_79757062/crawlab | core/models/models/setting.go | Go | bsd-3-clause | 637 |
package models
import (
"go.mongodb.org/mongo-driver/bson"
)
type SettingV2 struct {
any `collection:"settings"`
BaseModelV2[SettingV2] `bson:",inline"`
Key string `json:"key" bson:"key"`
Value bson.M `json:"value" bson:"value"`
}
| 2302_79757062/crawlab | core/models/models/setting_v2.go | Go | bsd-3-clause | 293 |
package models
import (
"github.com/crawlab-team/crawlab/core/interfaces"
"go.mongodb.org/mongo-driver/bson/primitive"
)
type Env struct {
Name string `json:"name" bson:"name"`
Value string `json:"value" bson:"value"`
}
type Spider struct {
Id primitive.ObjectID `json:"_id" bson:"_id"` ... | 2302_79757062/crawlab | core/models/models/spider.go | Go | bsd-3-clause | 3,568 |
package models
import (
"github.com/crawlab-team/crawlab/core/interfaces"
"go.mongodb.org/mongo-driver/bson/primitive"
)
type SpiderStat struct {
Id primitive.ObjectID `json:"_id" bson:"_id"`
LastTaskId primitive.ObjectID `json:"last_task_id" bson:"last_task_id,omitempty"`
LastTas... | 2302_79757062/crawlab | core/models/models/spider_stat.go | Go | bsd-3-clause | 1,550 |
package models
import (
"go.mongodb.org/mongo-driver/bson/primitive"
)
type SpiderStatV2 struct {
any `collection:"spider_stats"`
BaseModelV2[SpiderStatV2] `bson:",inline"`
LastTaskId primitive.ObjectID `json:"last_task_id" bson:"last_task_id,omitempty"`
LastTask ... | 2302_79757062/crawlab | core/models/models/spider_stat_v2.go | Go | bsd-3-clause | 1,250 |
package models
import (
"go.mongodb.org/mongo-driver/bson/primitive"
)
type SpiderV2 struct {
any `collection:"spiders"` // spider id
BaseModelV2[SpiderV2] `bson:",inline"`
Name string `json:"name" bson:"name"` // spider name
Type ... | 2302_79757062/crawlab | core/models/models/spider_v2.go | Go | bsd-3-clause | 1,751 |
package models
import (
"github.com/crawlab-team/crawlab/core/interfaces"
"go.mongodb.org/mongo-driver/bson/primitive"
)
type Tag struct {
Id primitive.ObjectID `json:"_id" bson:"_id"`
Name string `json:"name" bson:"name"`
Color string `json:"color" bson:"color"`
De... | 2302_79757062/crawlab | core/models/models/tag.go | Go | bsd-3-clause | 892 |
package models
import (
"github.com/crawlab-team/crawlab/core/interfaces"
"go.mongodb.org/mongo-driver/bson/primitive"
"time"
)
type Task struct {
Id primitive.ObjectID `json:"_id" bson:"_id"`
SpiderId primitive.ObjectID `json:"spider_id" bson:"spider_id"`
Status string `json:"st... | 2302_79757062/crawlab | core/models/models/task.go | Go | bsd-3-clause | 3,116 |
package models
import (
"github.com/crawlab-team/crawlab/core/interfaces"
"go.mongodb.org/mongo-driver/bson/primitive"
)
type TaskQueueItem struct {
Id primitive.ObjectID `json:"_id" bson:"_id"`
Priority int `json:"p" bson:"p"`
NodeId primitive.ObjectID `json:"nid,omitempty" bson:"nid,omit... | 2302_79757062/crawlab | core/models/models/task_queue_item.go | Go | bsd-3-clause | 658 |
package models
import (
"go.mongodb.org/mongo-driver/bson/primitive"
)
type TaskQueueItemV2 struct {
any `collection:"task_queue"`
BaseModelV2[TaskQueueItemV2] `bson:",inline"`
Priority int `json:"p" bson:"p"`
NodeId primitive.Obje... | 2302_79757062/crawlab | core/models/models/task_queue_item_v2.go | Go | bsd-3-clause | 371 |
package models
import (
"github.com/crawlab-team/crawlab/core/interfaces"
"go.mongodb.org/mongo-driver/bson/primitive"
"time"
)
type TaskStat struct {
Id primitive.ObjectID `json:"_id" bson:"_id"`
CreateTs time.Time `json:"create_ts" bson:"create_ts,omitempty"`
StartTs time.... | 2302_79757062/crawlab | core/models/models/task_stat.go | Go | bsd-3-clause | 2,419 |
package models
import (
"time"
)
type TaskStatV2 struct {
any `collection:"task_stats"`
BaseModelV2[TaskStatV2] `bson:",inline"`
CreateTs time.Time `json:"create_ts" bson:"create_ts,omitempty"`
StartTs time.Time `json:"start_ts" bson:"start_ts,omitempty"`
EndTs... | 2302_79757062/crawlab | core/models/models/task_stat_v2.go | Go | bsd-3-clause | 890 |
package models
import (
"go.mongodb.org/mongo-driver/bson/primitive"
"time"
)
type TaskV2 struct {
any `collection:"tasks"`
BaseModelV2[TaskV2] `bson:",inline"`
SpiderId primitive.ObjectID `json:"spider_id" bson:"spider_id"`
Status string `json:"status" bs... | 2302_79757062/crawlab | core/models/models/task_v2.go | Go | bsd-3-clause | 1,575 |
package models
type TestModel struct {
any `collection:"testmodels"`
BaseModelV2[TestModel] `bson:",inline"`
Name string `json:"name" bson:"name"`
}
| 2302_79757062/crawlab | core/models/models/test.go | Go | bsd-3-clause | 190 |
package models
import (
"github.com/crawlab-team/crawlab/core/interfaces"
"go.mongodb.org/mongo-driver/bson/primitive"
)
type Token struct {
Id primitive.ObjectID `json:"_id" bson:"_id"`
Name string `json:"name" bson:"name"`
Token string `json:"token" bson:"token"`
}
func (t *Token) ... | 2302_79757062/crawlab | core/models/models/token.go | Go | bsd-3-clause | 591 |
package models
type TokenV2 struct {
any `collection:"tokens"`
BaseModelV2[TokenV2] `bson:",inline"`
Name string `json:"name" bson:"name"`
Token string `json:"token" bson:"token"`
}
| 2302_79757062/crawlab | core/models/models/token_v2.go | Go | bsd-3-clause | 235 |
package models
import (
"github.com/crawlab-team/crawlab/core/interfaces"
"go.mongodb.org/mongo-driver/bson/primitive"
)
type User struct {
Id primitive.ObjectID `json:"_id" bson:"_id"`
Username string `json:"username" bson:"username"`
Password string `json:"password,omitempty" bson... | 2302_79757062/crawlab | core/models/models/user.go | Go | bsd-3-clause | 1,695 |
package models
import (
"github.com/crawlab-team/crawlab/core/interfaces"
"go.mongodb.org/mongo-driver/bson/primitive"
)
type UserRole struct {
Id primitive.ObjectID `json:"_id" bson:"_id"`
RoleId primitive.ObjectID `json:"role_id" bson:"role_id"`
UserId primitive.ObjectID `json:"user_id" bson:"user_id"`
}
... | 2302_79757062/crawlab | core/models/models/user_role.go | Go | bsd-3-clause | 626 |
package models
import (
"go.mongodb.org/mongo-driver/bson/primitive"
)
type UserRoleV2 struct {
any `collection:"user_roles"`
BaseModelV2[UserRoleV2] `bson:",inline"`
RoleId primitive.ObjectID `json:"role_id" bson:"role_id"`
UserId primitive.ObjectID `json:"u... | 2302_79757062/crawlab | core/models/models/user_role_v2.go | Go | bsd-3-clause | 346 |
package models
type UserV2 struct {
any `collection:"users"`
BaseModelV2[UserV2] `bson:",inline"`
Username string `json:"username" bson:"username"`
Password string `json:"-,omitempty" bson:"password"`
Role string `json:"role" bson:"role"`
Email s... | 2302_79757062/crawlab | core/models/models/user_v2.go | Go | bsd-3-clause | 356 |
package models
//func AssignFields(d interface{}, fieldIds ...interfaces.ModelId) (res interface{}, err error) {
// return assignFields(d, fieldIds...)
//}
//
//func AssignListFields(list interface{}, fieldIds ...interfaces.ModelId) (res arraylist.List, err error) {
// return assignListFields(list, fieldIds...)
//}
//... | 2302_79757062/crawlab | core/models/models/utils_binder_legacy.go | Go | bsd-3-clause | 2,569 |
package models
import (
"github.com/crawlab-team/crawlab/core/interfaces"
"github.com/crawlab-team/crawlab/core/utils/binders"
)
func GetModelColName(id interfaces.ModelId) (colName string) {
return binders.NewColNameBinder(id).MustBindString()
}
| 2302_79757062/crawlab | core/models/models/utils_col.go | Go | bsd-3-clause | 252 |
package models
type ModelMap struct {
Artifact Artifact
Tag Tag
Node Node
Project Project
Spider Spider
Task Task
Job Job
Schedule Schedule
User User
Setting Setting
Token Token
V... | 2302_79757062/crawlab | core/models/models/utils_model_map.go | Go | bsd-3-clause | 2,780 |
package models
import (
"github.com/apex/log"
"github.com/crawlab-team/crawlab/core/errors"
"github.com/crawlab-team/crawlab/core/interfaces"
"github.com/crawlab-team/crawlab/trace"
)
func convertInterfacesToTags(tags []interfaces.Tag) (res []Tag) {
if tags == nil {
return nil
}
for _, t := range tags {
ta... | 2302_79757062/crawlab | core/models/models/utils_tag.go | Go | bsd-3-clause | 754 |
package models
import (
"github.com/crawlab-team/crawlab/core/interfaces"
"go.mongodb.org/mongo-driver/bson/primitive"
)
type Variable struct {
Id primitive.ObjectID `json:"_id" bson:"_id"`
Key string `json:"key" bson:"key"`
Value string `json:"value" bson:"value"`
Remark string ... | 2302_79757062/crawlab | core/models/models/variable.go | Go | bsd-3-clause | 667 |
package models
type VariableV2 struct {
any `collection:"variables"`
BaseModelV2[VariableV2] `bson:",inline"`
Key string `json:"key" bson:"key"`
Value string `json:"value" bson:"value"`
Remark string `json:"remark" bson:"remark"`
}
| 2302_79757062/crawlab | core/models/models/variable_v2.go | Go | bsd-3-clause | 313 |
package service
import (
"github.com/crawlab-team/crawlab/core/errors"
"github.com/crawlab-team/crawlab/core/interfaces"
models2 "github.com/crawlab-team/crawlab/core/models/models"
"github.com/crawlab-team/crawlab/db/mongo"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
)
func ... | 2302_79757062/crawlab | core/models/service/artifact_service.go | Go | bsd-3-clause | 1,285 |
package service
import (
"encoding/json"
"github.com/apex/log"
"github.com/crawlab-team/crawlab/core/constants"
"github.com/crawlab-team/crawlab/core/errors"
"github.com/crawlab-team/crawlab/core/interfaces"
"github.com/crawlab-team/crawlab/core/models/delegate"
models2 "github.com/crawlab-team/crawlab/core/mod... | 2302_79757062/crawlab | core/models/service/base_service.go | Go | bsd-3-clause | 10,777 |
package service
import (
"fmt"
"github.com/crawlab-team/crawlab/core/interfaces"
"github.com/crawlab-team/crawlab/db/mongo"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
"reflect"
"sync"
)
var (
instanceMap = make(map[string]any)
onceMap = make(map[string]*sync.Onc... | 2302_79757062/crawlab | core/models/service/base_service_v2.go | Go | bsd-3-clause | 4,776 |
package service
import (
"github.com/crawlab-team/crawlab/core/errors"
"github.com/crawlab-team/crawlab/core/interfaces"
"github.com/crawlab-team/crawlab/core/models/models"
"github.com/crawlab-team/crawlab/db/mongo"
)
func NewBasicBinder(id interfaces.ModelId, fr *mongo.FindResult) (b interfaces.ModelBinder) {
... | 2302_79757062/crawlab | core/models/service/binder_basic.go | Go | bsd-3-clause | 2,576 |
package service
import (
"github.com/crawlab-team/crawlab/core/errors"
"github.com/crawlab-team/crawlab/core/interfaces"
"github.com/crawlab-team/crawlab/core/models/models"
"github.com/crawlab-team/crawlab/db/mongo"
"github.com/crawlab-team/crawlab/trace"
)
func NewListBinder(id interfaces.ModelId, fr *mongo.Fi... | 2302_79757062/crawlab | core/models/service/binder_list.go | Go | bsd-3-clause | 2,678 |
package service
import (
"github.com/crawlab-team/crawlab/core/errors"
"github.com/crawlab-team/crawlab/core/interfaces"
models2 "github.com/crawlab-team/crawlab/core/models/models"
"github.com/crawlab-team/crawlab/db/mongo"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
)
func ... | 2302_79757062/crawlab | core/models/service/data_collection_service.go | Go | bsd-3-clause | 1,577 |
package service
import (
"github.com/crawlab-team/crawlab/core/errors"
"github.com/crawlab-team/crawlab/core/interfaces"
models2 "github.com/crawlab-team/crawlab/core/models/models"
"github.com/crawlab-team/crawlab/db/mongo"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
)
func ... | 2302_79757062/crawlab | core/models/service/data_source_service.go | Go | bsd-3-clause | 1,315 |
package service
import (
"github.com/crawlab-team/crawlab/core/errors"
"github.com/crawlab-team/crawlab/core/interfaces"
models2 "github.com/crawlab-team/crawlab/core/models/models"
"github.com/crawlab-team/crawlab/db/mongo"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
)
func ... | 2302_79757062/crawlab | core/models/service/dependency_setting_service.go | Go | bsd-3-clause | 1,420 |
package service
import (
"github.com/crawlab-team/crawlab/core/errors"
"github.com/crawlab-team/crawlab/core/interfaces"
models2 "github.com/crawlab-team/crawlab/core/models/models"
"github.com/crawlab-team/crawlab/db/mongo"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
)
func ... | 2302_79757062/crawlab | core/models/service/environment_service.go | Go | bsd-3-clause | 1,330 |
package service
import (
"github.com/crawlab-team/crawlab/core/errors"
"github.com/crawlab-team/crawlab/core/interfaces"
"github.com/crawlab-team/crawlab/core/models/models"
"github.com/crawlab-team/crawlab/db/mongo"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
)
func convertT... | 2302_79757062/crawlab | core/models/service/extra_value_service.go | Go | bsd-3-clause | 1,586 |
package service
import (
"github.com/crawlab-team/crawlab/core/errors"
"github.com/crawlab-team/crawlab/core/interfaces"
models2 "github.com/crawlab-team/crawlab/core/models/models"
"github.com/crawlab-team/crawlab/db/mongo"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
)
func ... | 2302_79757062/crawlab | core/models/service/git_service.go | Go | bsd-3-clause | 1,246 |
package service
import (
"github.com/crawlab-team/crawlab/core/interfaces"
"github.com/crawlab-team/crawlab/core/models/models"
"github.com/crawlab-team/crawlab/db/mongo"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
)
type ModelService interface {
interfaces.ModelService
Drop... | 2302_79757062/crawlab | core/models/service/interface.go | Go | bsd-3-clause | 8,183 |
package service
import (
"github.com/crawlab-team/crawlab/core/errors"
"github.com/crawlab-team/crawlab/core/interfaces"
models2 "github.com/crawlab-team/crawlab/core/models/models"
"github.com/crawlab-team/crawlab/db/mongo"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
)
func ... | 2302_79757062/crawlab | core/models/service/job_service.go | Go | bsd-3-clause | 1,210 |
package service
import (
"github.com/crawlab-team/crawlab/core/errors"
"github.com/crawlab-team/crawlab/core/interfaces"
models2 "github.com/crawlab-team/crawlab/core/models/models"
"github.com/crawlab-team/crawlab/db/mongo"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
)
func ... | 2302_79757062/crawlab | core/models/service/node_service.go | Go | bsd-3-clause | 1,393 |
package service
import (
"github.com/crawlab-team/crawlab/core/interfaces"
"github.com/crawlab-team/crawlab/db/mongo"
)
type Option func(ModelService)
type BaseServiceOption func(svc interfaces.ModelBaseService)
func WithBaseServiceModelId(id interfaces.ModelId) BaseServiceOption {
return func(svc interfaces.Mod... | 2302_79757062/crawlab | core/models/service/options.go | Go | bsd-3-clause | 544 |
package service
import (
"github.com/crawlab-team/crawlab/core/errors"
"github.com/crawlab-team/crawlab/core/interfaces"
models2 "github.com/crawlab-team/crawlab/core/models/models"
"github.com/crawlab-team/crawlab/db/mongo"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
)
func ... | 2302_79757062/crawlab | core/models/service/password_service.go | Go | bsd-3-clause | 1,285 |
package service
import (
"github.com/crawlab-team/crawlab/core/errors"
"github.com/crawlab-team/crawlab/core/interfaces"
models2 "github.com/crawlab-team/crawlab/core/models/models"
"github.com/crawlab-team/crawlab/db/mongo"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
)
func ... | 2302_79757062/crawlab | core/models/service/permission_service.go | Go | bsd-3-clause | 1,539 |
package service
import (
"github.com/crawlab-team/crawlab/core/errors"
"github.com/crawlab-team/crawlab/core/interfaces"
models2 "github.com/crawlab-team/crawlab/core/models/models"
"github.com/crawlab-team/crawlab/db/mongo"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
)
func ... | 2302_79757062/crawlab | core/models/service/project_service.go | Go | bsd-3-clause | 1,270 |
package service
import (
"github.com/crawlab-team/crawlab/core/errors"
"github.com/crawlab-team/crawlab/core/interfaces"
models2 "github.com/crawlab-team/crawlab/core/models/models"
"github.com/crawlab-team/crawlab/db/mongo"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
)
func ... | 2302_79757062/crawlab | core/models/service/role_permission_service.go | Go | bsd-3-clause | 1,841 |
package service
import (
"github.com/crawlab-team/crawlab/core/errors"
"github.com/crawlab-team/crawlab/core/interfaces"
models2 "github.com/crawlab-team/crawlab/core/models/models"
"github.com/crawlab-team/crawlab/db/mongo"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
)
func ... | 2302_79757062/crawlab | core/models/service/role_service.go | Go | bsd-3-clause | 1,603 |
package service
import (
"github.com/crawlab-team/crawlab/core/errors"
"github.com/crawlab-team/crawlab/core/interfaces"
models2 "github.com/crawlab-team/crawlab/core/models/models"
"github.com/crawlab-team/crawlab/db/mongo"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
)
func ... | 2302_79757062/crawlab | core/models/service/schedule_service.go | Go | bsd-3-clause | 1,285 |
package service
import (
"context"
"github.com/crawlab-team/crawlab/core/color"
"github.com/crawlab-team/crawlab/core/interfaces"
"github.com/crawlab-team/crawlab/db/mongo"
"go.mongodb.org/mongo-driver/bson"
mongo2 "go.mongodb.org/mongo-driver/mongo"
)
type Service struct {
env string
colorSvc interfaces... | 2302_79757062/crawlab | core/models/service/service.go | Go | bsd-3-clause | 1,254 |
package service
import (
"github.com/crawlab-team/crawlab/core/errors"
"github.com/crawlab-team/crawlab/core/interfaces"
models2 "github.com/crawlab-team/crawlab/core/models/models"
"github.com/crawlab-team/crawlab/db/mongo"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
)
func ... | 2302_79757062/crawlab | core/models/service/setting_service.go | Go | bsd-3-clause | 1,447 |
package service
import (
"github.com/crawlab-team/crawlab/core/errors"
"github.com/crawlab-team/crawlab/core/interfaces"
models2 "github.com/crawlab-team/crawlab/core/models/models"
"github.com/crawlab-team/crawlab/db/mongo"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
)
func ... | 2302_79757062/crawlab | core/models/service/spider_service.go | Go | bsd-3-clause | 1,255 |
package service
import (
"github.com/crawlab-team/crawlab/core/errors"
"github.com/crawlab-team/crawlab/core/interfaces"
models2 "github.com/crawlab-team/crawlab/core/models/models"
"github.com/crawlab-team/crawlab/db/mongo"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
)
func ... | 2302_79757062/crawlab | core/models/service/spider_stat_service.go | Go | bsd-3-clause | 1,315 |
package service
import (
"github.com/crawlab-team/crawlab/core/errors"
"github.com/crawlab-team/crawlab/core/interfaces"
"github.com/crawlab-team/crawlab/core/models/delegate"
models2 "github.com/crawlab-team/crawlab/core/models/models"
"github.com/crawlab-team/crawlab/db/mongo"
"github.com/crawlab-team/crawlab/... | 2302_79757062/crawlab | core/models/service/tag_service.go | Go | bsd-3-clause | 3,294 |
package service
//
//import (
// "github.com/crawlab-team/crawlab/core/interfaces"
// "github.com/crawlab-team/crawlab/db/mongo"
// "go.mongodb.org/mongo-driver/bson"
// "go.mongodb.org/mongo-driver/bson/primitive"
// mongo2 "go.mongodb.org/mongo-driver/mongo"
//)
//
//type TagServiceInterface interface {
// getTagIds... | 2302_79757062/crawlab | core/models/service/tag_service_legacy.go | Go | bsd-3-clause | 3,354 |
package service
import (
"github.com/crawlab-team/crawlab/core/errors"
"github.com/crawlab-team/crawlab/core/interfaces"
models2 "github.com/crawlab-team/crawlab/core/models/models"
"github.com/crawlab-team/crawlab/db/mongo"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
)
func ... | 2302_79757062/crawlab | core/models/service/task_queue_service.go | Go | bsd-3-clause | 1,348 |
package service
import (
"github.com/crawlab-team/crawlab/core/errors"
"github.com/crawlab-team/crawlab/core/interfaces"
models2 "github.com/crawlab-team/crawlab/core/models/models"
"github.com/crawlab-team/crawlab/db/mongo"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
)
func ... | 2302_79757062/crawlab | core/models/service/task_service.go | Go | bsd-3-clause | 1,225 |
package service
import (
"github.com/crawlab-team/crawlab/core/errors"
"github.com/crawlab-team/crawlab/core/interfaces"
models2 "github.com/crawlab-team/crawlab/core/models/models"
"github.com/crawlab-team/crawlab/db/mongo"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
)
func ... | 2302_79757062/crawlab | core/models/service/task_stat_service.go | Go | bsd-3-clause | 1,285 |