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 interfaces
type ColorService interface {
Injectable
GetByName(name string) (res Color, err error)
GetRandom() (res Color, err error)
}
| 2302_79757062/crawlab | core/interfaces/color_service.go | Go | bsd-3-clause | 147 |
package interfaces
type ControllerParams interface {
IsZero() (ok bool)
IsDefault() (ok bool)
}
| 2302_79757062/crawlab | core/interfaces/controller_params.go | Go | bsd-3-clause | 99 |
package interfaces
import (
"go.mongodb.org/mongo-driver/bson/primitive"
"time"
)
type DataSourceService interface {
ChangePassword(id primitive.ObjectID, password string) (err error)
Monitor()
CheckStatus(id primitive.ObjectID) (err error)
SetTimeout(duration time.Duration)
SetMonitorInterval(duration time.Du... | 2302_79757062/crawlab | core/interfaces/data_source_service.go | Go | bsd-3-clause | 330 |
package interfaces
type Entity interface {
Value() interface{}
}
| 2302_79757062/crawlab | core/interfaces/entity.go | Go | bsd-3-clause | 67 |
package interfaces
type EventData interface {
GetEvent() string
GetData() interface{}
}
| 2302_79757062/crawlab | core/interfaces/event_data.go | Go | bsd-3-clause | 91 |
package interfaces
type EventFn func(data ...interface{}) (err error)
type EventService interface {
Register(key, include, exclude string, ch *chan EventData)
Unregister(key string)
SendEvent(eventName string, data ...interface{})
}
| 2302_79757062/crawlab | core/interfaces/event_service.go | Go | bsd-3-clause | 238 |
package interfaces
import "time"
type Export interface {
GetId() string
GetType() string
GetTarget() string
GetFilter() Filter
GetStatus() string
GetStartTs() time.Time
GetEndTs() time.Time
GetDownloadPath() string
}
| 2302_79757062/crawlab | core/interfaces/export.go | Go | bsd-3-clause | 227 |
package interfaces
type ExportService interface {
GenerateId() (exportId string, err error)
Export(exportType, target string, filter Filter) (exportId string, err error)
GetExport(exportId string) (export Export, err error)
}
| 2302_79757062/crawlab | core/interfaces/export_service.go | Go | bsd-3-clause | 230 |
package interfaces
type Filter interface {
GetIsOr() (isOr bool)
SetIsOr(isOr bool)
GetConditions() (conditions []FilterCondition)
SetConditions(conditions []FilterCondition)
IsNil() (ok bool)
}
| 2302_79757062/crawlab | core/interfaces/filter.go | Go | bsd-3-clause | 201 |
package interfaces
type FilterCondition interface {
GetKey() (key string)
SetKey(key string)
GetOp() (op string)
SetOp(op string)
GetValue() (value interface{})
SetValue(value interface{})
}
| 2302_79757062/crawlab | core/interfaces/filter_condition.go | Go | bsd-3-clause | 198 |
package interfaces
import (
"os"
"time"
)
type FsFileInfo interface {
GetName() string
GetPath() string
GetFullPath() string
GetExtension() string
GetIsDir() bool
GetFileSize() int64
GetModTime() time.Time
GetMode() os.FileMode
GetHash() string
GetChildren() []FsFileInfo
}
| 2302_79757062/crawlab | core/interfaces/fs_file_info.go | Go | bsd-3-clause | 288 |
package interfaces
import (
cfs "github.com/crawlab-team/crawlab/fs"
vcs "github.com/crawlab-team/crawlab/vcs"
)
type FsService interface {
WithConfigPath
List(path string, opts ...ServiceCrudOption) (files []FsFileInfo, err error)
GetFile(path string, opts ...ServiceCrudOption) (data []byte, err error)
GetFile... | 2302_79757062/crawlab | core/interfaces/fs_service.go | Go | bsd-3-clause | 1,007 |
package interfaces
type ServiceCrudOptions struct {
IsAbsolute bool // whether the path is absolute
OnlyFromWorkspace bool // whether only sync from workspace
NotSyncToWorkspace bool // whether not sync to workspace
}
type ServiceCrudOption func(o *ServiceCrudOptions)
func WithOnlyFromWorkspace() Service... | 2302_79757062/crawlab | core/interfaces/fs_service_options.go | Go | bsd-3-clause | 529 |
package interfaces
type FsServiceV2 interface {
List(path string) (files []FsFileInfo, err error)
GetFile(path string) (data []byte, err error)
GetFileInfo(path string) (file FsFileInfo, err error)
Save(path string, data []byte) (err error)
CreateDir(path string) (err error)
Rename(path, newPath string) (err err... | 2302_79757062/crawlab | core/interfaces/fs_service_v2.go | Go | bsd-3-clause | 399 |
package interfaces
type GrpcBase interface {
WithConfigPath
Init() (err error)
Start() (err error)
Stop() (err error)
Register() (err error)
}
| 2302_79757062/crawlab | core/interfaces/grpc_base.go | Go | bsd-3-clause | 149 |
package interfaces
type GrpcBaseServiceParams interface {
Entity
}
| 2302_79757062/crawlab | core/interfaces/grpc_base_service_params.go | Go | bsd-3-clause | 69 |
package interfaces
import (
"context"
grpc "github.com/crawlab-team/crawlab/grpc"
"time"
)
type GrpcClient interface {
GrpcBase
WithConfigPath
GetModelDelegateClient() grpc.ModelDelegateClient
GetModelBaseServiceClient() grpc.ModelBaseServiceClient
GetNodeClient() grpc.NodeServiceClient
GetTaskClient() grpc.... | 2302_79757062/crawlab | core/interfaces/grpc_client.go | Go | bsd-3-clause | 812 |
package interfaces
type GrpcClientModelBaseService interface {
WithModelId
WithConfigPath
ModelBaseService
}
| 2302_79757062/crawlab | core/interfaces/grpc_client_model_base_service.go | Go | bsd-3-clause | 113 |
package interfaces
type GrpcClientModelDelegate interface {
ModelDelegate
WithConfigPath
Close() error
}
| 2302_79757062/crawlab | core/interfaces/grpc_client_model_delegate.go | Go | bsd-3-clause | 109 |
package interfaces
import (
"github.com/crawlab-team/crawlab/db/mongo"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
)
type GrpcClientModelEnvironmentService interface {
ModelBaseService
GetEnvironmentById(id primitive.ObjectID) (s Environment, err error)
GetEnvironment(query b... | 2302_79757062/crawlab | core/interfaces/grpc_client_model_environment_service.go | Go | bsd-3-clause | 471 |
package interfaces
import (
"github.com/crawlab-team/crawlab/db/mongo"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
)
type GrpcClientModelNodeService interface {
ModelBaseService
GetNodeById(id primitive.ObjectID) (n Node, err error)
GetNode(query bson.M, opts *mongo.FindOptio... | 2302_79757062/crawlab | core/interfaces/grpc_client_model_node_service.go | Go | bsd-3-clause | 468 |
package interfaces
type GrpcClientModelService interface {
WithConfigPath
NewBaseServiceDelegate(id ModelId) (GrpcClientModelBaseService, error)
}
| 2302_79757062/crawlab | core/interfaces/grpc_client_model_service.go | Go | bsd-3-clause | 150 |
package interfaces
import (
"github.com/crawlab-team/crawlab/db/mongo"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
)
type GrpcClientModelSpiderService interface {
ModelBaseService
GetSpiderById(id primitive.ObjectID) (s Spider, err error)
GetSpider(query bson.M, opts *mongo.F... | 2302_79757062/crawlab | core/interfaces/grpc_client_model_spider_service.go | Go | bsd-3-clause | 436 |
package interfaces
import (
"github.com/crawlab-team/crawlab/db/mongo"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
)
type GrpcClientModelTaskService interface {
ModelBaseService
GetTaskById(id primitive.ObjectID) (s Task, err error)
GetTask(query bson.M, opts *mongo.FindOptio... | 2302_79757062/crawlab | core/interfaces/grpc_client_model_task_service.go | Go | bsd-3-clause | 422 |
package interfaces
import (
"github.com/crawlab-team/crawlab/db/mongo"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
)
type GrpcClientModelTaskStatService interface {
ModelBaseService
GetTaskStatById(id primitive.ObjectID) (s TaskStat, err error)
GetTaskStat(query bson.M, opts ... | 2302_79757062/crawlab | core/interfaces/grpc_client_model_task_stat_service.go | Go | bsd-3-clause | 450 |
package interfaces
type GrpcClientPool interface {
WithConfigPath
Init() error
NewClient() error
GetClient() (GrpcClient, error)
SetSize(int)
}
| 2302_79757062/crawlab | core/interfaces/grpc_client_pool.go | Go | bsd-3-clause | 150 |
package interfaces
type GrpcModelBaseServiceMessage interface {
GetModelId() ModelId
GetData() []byte
ToBytes() (data []byte)
}
| 2302_79757062/crawlab | core/interfaces/grpc_model_base_service_message.go | Go | bsd-3-clause | 132 |
package interfaces
type GrpcModelBinder interface {
ModelBinder
}
| 2302_79757062/crawlab | core/interfaces/grpc_model_binder.go | Go | bsd-3-clause | 68 |
package interfaces
type GrpcModelDelegateMessage interface {
GetModelId() ModelId
GetMethod() ModelDelegateMethod
GetData() []byte
ToBytes() (data []byte)
}
| 2302_79757062/crawlab | core/interfaces/grpc_model_delegate_message.go | Go | bsd-3-clause | 162 |
package interfaces
type GrpcModelListBinder interface {
ModelListBinder
}
| 2302_79757062/crawlab | core/interfaces/grpc_model_list_binder.go | Go | bsd-3-clause | 76 |
package interfaces
import (
grpc "github.com/crawlab-team/crawlab/grpc"
)
type GrpcServer interface {
GrpcBase
SetAddress(Address)
GetSubscribe(key string) (sub GrpcSubscribe, err error)
SetSubscribe(key string, sub GrpcSubscribe)
DeleteSubscribe(key string)
SendStreamMessage(key string, code grpc.StreamMessag... | 2302_79757062/crawlab | core/interfaces/grpc_server.go | Go | bsd-3-clause | 464 |
package interfaces
import grpc "github.com/crawlab-team/crawlab/grpc"
type GrpcStream interface {
Send(msg *grpc.StreamMessage) (err error)
}
type GrpcStreamBidirectional interface {
GrpcStream
Recv() (msg *grpc.StreamMessage, err error)
}
| 2302_79757062/crawlab | core/interfaces/grpc_stream.go | Go | bsd-3-clause | 246 |
package interfaces
type GrpcSubscribe interface {
GetStream() GrpcStream
GetStreamBidirectional() GrpcStreamBidirectional
GetFinished() chan bool
}
| 2302_79757062/crawlab | core/interfaces/grpc_subscribe.go | Go | bsd-3-clause | 152 |
package interfaces
type I18nService interface {
AddTranslations(t []Translation)
GetTranslations() (t []Translation)
}
| 2302_79757062/crawlab | core/interfaces/i18n_service.go | Go | bsd-3-clause | 122 |
package interfaces
type Injectable interface {
Inject() error
}
| 2302_79757062/crawlab | core/interfaces/injectable.go | Go | bsd-3-clause | 66 |
package interfaces
type List interface {
GetModels() (res []Model)
}
| 2302_79757062/crawlab | core/interfaces/list.go | Go | bsd-3-clause | 71 |
package interfaces
import (
"go.mongodb.org/mongo-driver/bson/primitive"
)
type Model interface {
GetId() (id primitive.ObjectID)
SetId(id primitive.ObjectID)
}
type ModelV2 interface {
GetId() (id primitive.ObjectID)
SetId(id primitive.ObjectID)
SetCreated(by primitive.ObjectID)
SetUpdated(by primitive.Objec... | 2302_79757062/crawlab | core/interfaces/model.go | Go | bsd-3-clause | 2,342 |
package interfaces
import "go.mongodb.org/mongo-driver/bson/primitive"
type ModelArtifact interface {
Model
GetSys() (sys ModelArtifactSys)
GetTagIds() (ids []primitive.ObjectID)
SetTagIds(ids []primitive.ObjectID)
SetObj(obj Model)
SetDel(del bool)
}
| 2302_79757062/crawlab | core/interfaces/model_artifact.go | Go | bsd-3-clause | 260 |
package interfaces
import (
"go.mongodb.org/mongo-driver/bson/primitive"
"time"
)
type ModelArtifactSys interface {
GetCreateTs() time.Time
SetCreateTs(ts time.Time)
GetUpdateTs() time.Time
SetUpdateTs(ts time.Time)
GetDeleteTs() time.Time
SetDeleteTs(ts time.Time)
GetCreateUid() primitive.ObjectID
SetCreat... | 2302_79757062/crawlab | core/interfaces/model_artifact_sys.go | Go | bsd-3-clause | 494 |
package interfaces
import (
"github.com/crawlab-team/crawlab/db/mongo"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
)
type ModelBaseService interface {
GetModelId() (id ModelId)
SetModelId(id ModelId)
GetById(id primitive.ObjectID) (res Model, err error)
Get(query bson.M, opt... | 2302_79757062/crawlab | core/interfaces/model_base_service.go | Go | bsd-3-clause | 1,116 |
package interfaces
type ModelBinder interface {
Bind() (res Model, err error)
Process(d Model) (res Model, err error)
}
| 2302_79757062/crawlab | core/interfaces/model_binder.go | Go | bsd-3-clause | 123 |
package interfaces
type ModelDelegateMethod string
type ModelDelegate interface {
Add() error
Save() error
Delete() error
GetArtifact() (ModelArtifact, error)
GetModel() Model
Refresh() error
ToBytes(interface{}) ([]byte, error)
}
const (
ModelDelegateMethodAdd = "add"
ModelDelegateMethodSave ... | 2302_79757062/crawlab | core/interfaces/model_delegate.go | Go | bsd-3-clause | 511 |
package interfaces
type Environment interface {
Model
GetKey() (key string)
SetKey(key string)
GetValue() (value string)
SetValue(value string)
}
| 2302_79757062/crawlab | core/interfaces/model_environment.go | Go | bsd-3-clause | 152 |
package interfaces
import (
"go.mongodb.org/mongo-driver/bson/primitive"
)
type ExtraValue interface {
Model
GetValue() (v interface{})
SetValue(v interface{})
GetObjectId() (oid primitive.ObjectID)
SetObjectId(oid primitive.ObjectID)
GetModel() (m string)
SetModel(m string)
GetType() (t string)
SetType(t s... | 2302_79757062/crawlab | core/interfaces/model_extra_value.go | Go | bsd-3-clause | 329 |
package interfaces
// Git interface
type Git interface {
Model
GetUrl() (url string)
SetUrl(url string)
GetAuthType() (authType string)
SetAuthType(authType string)
GetUsername() (username string)
SetUsername(username string)
GetPassword() (password string)
SetPassword(password string)
GetCurrentBranch() (cu... | 2302_79757062/crawlab | core/interfaces/model_git.go | Go | bsd-3-clause | 441 |
package interfaces
type ModelListBinder interface {
Bind() (l List, err error)
Process(d interface{}) (l List, err error)
}
| 2302_79757062/crawlab | core/interfaces/model_list_binder.go | Go | bsd-3-clause | 127 |
package interfaces
import "time"
type Node interface {
ModelWithNameDescription
GetKey() (key string)
GetIsMaster() (ok bool)
GetActive() (active bool)
SetActive(active bool)
SetActiveTs(activeTs time.Time)
GetStatus() (status string)
SetStatus(status string)
GetEnabled() (enabled bool)
SetEnabled(enabled b... | 2302_79757062/crawlab | core/interfaces/model_node.go | Go | bsd-3-clause | 515 |
package interfaces
import "time"
type ModelNodeDelegate interface {
ModelDelegate
UpdateStatus(active bool, activeTs *time.Time, status string) (err error)
UpdateStatusOnline() (err error)
UpdateStatusOffline() (err error)
}
| 2302_79757062/crawlab | core/interfaces/model_node_delegate.go | Go | bsd-3-clause | 231 |
package interfaces
type Permission interface {
ModelWithKey
ModelWithNameDescription
GetType() (t string)
SetType(t string)
GetTarget() (target []string)
SetTarget(target []string)
GetAllow() (allow []string)
SetAllow(allow []string)
GetDeny() (deny []string)
SetDeny(deny []string)
}
| 2302_79757062/crawlab | core/interfaces/model_permission.go | Go | bsd-3-clause | 296 |
package interfaces
import "go.mongodb.org/mongo-driver/bson/primitive"
type Result interface {
Value() map[string]interface{}
SetValue(key string, value interface{})
GetValue(key string) (value interface{})
GetTaskId() (id primitive.ObjectID)
SetTaskId(id primitive.ObjectID)
}
| 2302_79757062/crawlab | core/interfaces/model_result.go | Go | bsd-3-clause | 285 |
package interfaces
type Role interface {
ModelWithKey
ModelWithNameDescription
}
| 2302_79757062/crawlab | core/interfaces/model_role.go | Go | bsd-3-clause | 84 |
package interfaces
import (
"github.com/robfig/cron/v3"
"go.mongodb.org/mongo-driver/bson/primitive"
)
type Schedule interface {
Model
GetEnabled() (enabled bool)
SetEnabled(enabled bool)
GetEntryId() (id cron.EntryID)
SetEntryId(id cron.EntryID)
GetCron() (c string)
SetCron(c string)
GetSpiderId() (id prim... | 2302_79757062/crawlab | core/interfaces/model_schedule.go | Go | bsd-3-clause | 637 |
package interfaces
import (
"github.com/crawlab-team/crawlab/db/mongo"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
)
type ModelServiceV2[T any] interface {
GetById(id primitive.ObjectID) (model *T, err error)
Get(query bson.M, options *mongo.FindOptions) (model *T, err error)
... | 2302_79757062/crawlab | core/interfaces/model_service_v2.go | Go | bsd-3-clause | 972 |
package interfaces
import "go.mongodb.org/mongo-driver/bson/primitive"
type Spider interface {
ModelWithNameDescription
GetType() (ty string)
GetMode() (mode string)
SetMode(mode string)
GetNodeIds() (ids []primitive.ObjectID)
SetNodeIds(ids []primitive.ObjectID)
GetCmd() (cmd string)
SetCmd(cmd string)
GetP... | 2302_79757062/crawlab | core/interfaces/model_spider.go | Go | bsd-3-clause | 638 |
package interfaces
type Tag interface {
Model
GetName() string
GetColor() string
SetCol(string)
}
| 2302_79757062/crawlab | core/interfaces/model_tag.go | Go | bsd-3-clause | 103 |
package interfaces
import "go.mongodb.org/mongo-driver/bson/primitive"
type Task interface {
Model
GetNodeId() (id primitive.ObjectID)
SetNodeId(id primitive.ObjectID)
GetNodeIds() (ids []primitive.ObjectID)
GetStatus() (status string)
SetStatus(status string)
GetError() (error string)
SetError(error string)
... | 2302_79757062/crawlab | core/interfaces/model_task.go | Go | bsd-3-clause | 565 |
package interfaces
import "time"
type TaskStat interface {
Model
GetCreateTs() (ts time.Time)
SetCreateTs(ts time.Time)
GetStartTs() (ts time.Time)
SetStartTs(ts time.Time)
GetEndTs() (ts time.Time)
SetEndTs(ts time.Time)
GetWaitDuration() (d int64)
SetWaitDuration(d int64)
GetRuntimeDuration() (d int64)
S... | 2302_79757062/crawlab | core/interfaces/model_task_stat.go | Go | bsd-3-clause | 516 |
package interfaces
type User interface {
Model
GetUsername() (name string)
GetPassword() (p string)
GetRole() (r string)
GetEmail() (email string)
}
| 2302_79757062/crawlab | core/interfaces/model_user.go | Go | bsd-3-clause | 155 |
package interfaces
type UserGroup interface {
Model
GetUsers() (users []User, err error)
}
| 2302_79757062/crawlab | core/interfaces/model_user_group.go | Go | bsd-3-clause | 94 |
package interfaces
type ModuleId int
type Module interface {
Init() error
Start()
Wait()
Stop()
}
| 2302_79757062/crawlab | core/interfaces/module.go | Go | bsd-3-clause | 104 |
package interfaces
type NodeConfigService interface {
WithConfigPath
Init() error
Reload() error
GetBasicNodeInfo() Entity
GetNodeKey() string
GetNodeName() string
IsMaster() bool
GetAuthKey() string
GetMaxRunners() int
}
| 2302_79757062/crawlab | core/interfaces/node_config_service.go | Go | bsd-3-clause | 232 |
package interfaces
import (
"time"
)
type NodeMasterService interface {
NodeService
Monitor()
SetMonitorInterval(duration time.Duration)
Register() error
StopOnError()
GetServer() GrpcServer
}
| 2302_79757062/crawlab | core/interfaces/node_master_service.go | Go | bsd-3-clause | 202 |
package interfaces
type NodeService interface {
Module
WithConfigPath
WithAddress
GetConfigService() NodeConfigService
}
| 2302_79757062/crawlab | core/interfaces/node_service.go | Go | bsd-3-clause | 126 |
package interfaces
type NodeServiceOption interface {
}
| 2302_79757062/crawlab | core/interfaces/node_service_option.go | Go | bsd-3-clause | 57 |
package interfaces
import "time"
type NodeWorkerService interface {
NodeService
Register()
Recv()
ReportStatus()
SetHeartbeatInterval(duration time.Duration)
}
| 2302_79757062/crawlab | core/interfaces/node_worker_service.go | Go | bsd-3-clause | 167 |
package interfaces
| 2302_79757062/crawlab | core/interfaces/options.go | Go | bsd-3-clause | 19 |
package interfaces
import (
"os/exec"
"time"
)
type ProcessDaemon interface {
Start() (err error)
Stop()
GetMaxErrors() (maxErrors int)
SetMaxErrors(maxErrors int)
GetExitTimeout() (timeout time.Duration)
SetExitTimeout(timeout time.Duration)
GetCmd() (cmd *exec.Cmd)
GetCh() (ch chan int)
}
| 2302_79757062/crawlab | core/interfaces/process_daemon.go | Go | bsd-3-clause | 304 |
package interfaces
type Provide func(env string)
| 2302_79757062/crawlab | core/interfaces/provide.go | Go | bsd-3-clause | 50 |
package interfaces
import (
"github.com/crawlab-team/crawlab/db/generic"
"time"
)
type ResultService interface {
Insert(records ...interface{}) (err error)
List(query generic.ListQuery, opts *generic.ListOptions) (results []interface{}, err error)
Count(query generic.ListQuery) (n int, err error)
Index(fields [... | 2302_79757062/crawlab | core/interfaces/result_service.go | Go | bsd-3-clause | 378 |
package interfaces
import (
"github.com/crawlab-team/crawlab/db/mongo"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
)
type ResultServiceMongo interface {
GetId() (id primitive.ObjectID)
SetId(id primitive.ObjectID)
List(query bson.M, opts *mongo.FindOptions) (results []Result,... | 2302_79757062/crawlab | core/interfaces/result_service_mongo.go | Go | bsd-3-clause | 419 |
package interfaces
import "go.mongodb.org/mongo-driver/bson/primitive"
type ResultServiceRegistry interface {
Register(key string, fn ResultServiceRegistryFn)
Unregister(key string)
Get(key string) (fn ResultServiceRegistryFn)
}
type ResultServiceRegistryFn func(colId primitive.ObjectID, dsId primitive.ObjectID) ... | 2302_79757062/crawlab | core/interfaces/result_service_registry.go | Go | bsd-3-clause | 343 |
package interfaces
import (
"github.com/robfig/cron/v3"
"time"
)
type ScheduleService interface {
WithConfigPath
Module
GetLocation() (loc *time.Location)
SetLocation(loc *time.Location)
GetDelay() (delay bool)
SetDelay(delay bool)
GetSkip() (skip bool)
SetSkip(skip bool)
GetUpdateInterval() (interval time... | 2302_79757062/crawlab | core/interfaces/schedule_service.go | Go | bsd-3-clause | 519 |
package interfaces
import (
"go.mongodb.org/mongo-driver/bson/primitive"
)
type SpiderAdminService interface {
WithConfigPath
Start() (err error)
// Schedule a new task of the spider
Schedule(id primitive.ObjectID, opts *SpiderRunOptions) (taskIds []primitive.ObjectID, err error)
// Clone the spider
Clone(id p... | 2302_79757062/crawlab | core/interfaces/spider_admin_service.go | Go | bsd-3-clause | 692 |
package interfaces
import "go.mongodb.org/mongo-driver/bson/primitive"
type SpiderRunOptions struct {
Mode string `json:"mode"`
NodeIds []primitive.ObjectID `json:"node_ids"`
Cmd string `json:"cmd"`
Param string `json:"param"`
ScheduleId primitive.Ob... | 2302_79757062/crawlab | core/interfaces/spider_service_options.go | Go | bsd-3-clause | 496 |
package interfaces
import "go.mongodb.org/mongo-driver/bson"
type StatsService interface {
GetOverviewStats(query bson.M) (data interface{}, err error)
GetDailyStats(query bson.M) (data interface{}, err error)
GetTaskStats(query bson.M) (data interface{}, err error)
}
| 2302_79757062/crawlab | core/interfaces/stats_service.go | Go | bsd-3-clause | 274 |
package interfaces
import "go.mongodb.org/mongo-driver/bson/primitive"
type TaskBaseService interface {
WithConfigPath
Module
SaveTask(t Task, status string) (err error)
IsStopped() (res bool)
GetQueue(nodeId primitive.ObjectID) (queue string)
}
| 2302_79757062/crawlab | core/interfaces/task_base_service.go | Go | bsd-3-clause | 253 |
package interfaces
import (
"go.mongodb.org/mongo-driver/bson/primitive"
"time"
)
type TaskHandlerService interface {
TaskBaseService
// Run task and execute locally
Run(taskId primitive.ObjectID) (err error)
// Cancel task locally
Cancel(taskId primitive.ObjectID) (err error)
// Fetch tasks and run
Fetch()
... | 2302_79757062/crawlab | core/interfaces/task_handler_service.go | Go | bsd-3-clause | 2,340 |
package interfaces
type TaskHookService interface {
PreActions(Task, Spider, FsServiceV2, TaskHandlerService) (err error)
PostActions(Task, Spider, FsServiceV2, TaskHandlerService) (err error)
}
| 2302_79757062/crawlab | core/interfaces/task_hook_service.go | Go | bsd-3-clause | 198 |
package interfaces
import (
"go.mongodb.org/mongo-driver/bson/primitive"
"time"
)
type TaskRunner interface {
Init() (err error)
Run() (err error)
Cancel() (err error)
SetSubscribeTimeout(timeout time.Duration)
GetTaskId() (id primitive.ObjectID)
CleanUp() (err error)
}
| 2302_79757062/crawlab | core/interfaces/task_runner.go | Go | bsd-3-clause | 281 |
package interfaces
import (
"go.mongodb.org/mongo-driver/bson/primitive"
"time"
)
type TaskSchedulerService interface {
TaskBaseService
// Enqueue task into the task queue
Enqueue(t Task) (t2 Task, err error)
// Cancel task to corresponding node
Cancel(id primitive.ObjectID, args ...interface{}) (err error)
/... | 2302_79757062/crawlab | core/interfaces/task_scheduler_service.go | Go | bsd-3-clause | 431 |
package interfaces
import "go.mongodb.org/mongo-driver/bson/primitive"
type TaskStatsService interface {
TaskBaseService
InsertData(id primitive.ObjectID, records ...interface{}) (err error)
InsertLogs(id primitive.ObjectID, logs ...string) (err error)
}
| 2302_79757062/crawlab | core/interfaces/task_stats_service.go | Go | bsd-3-clause | 260 |
package interfaces
import "testing"
type Test interface {
Setup(*testing.T)
Cleanup()
}
| 2302_79757062/crawlab | core/interfaces/test.go | Go | bsd-3-clause | 92 |
package interfaces
type Translation interface {
GetLang() (l string)
}
| 2302_79757062/crawlab | core/interfaces/translation.go | Go | bsd-3-clause | 73 |
package interfaces
import (
"github.com/gin-gonic/gin"
"github.com/golang-jwt/jwt/v5"
"go.mongodb.org/mongo-driver/bson/primitive"
)
type UserService interface {
Init() (err error)
SetJwtSecret(secret string)
SetJwtSigningMethod(method jwt.SigningMethod)
Create(opts *UserCreateOptions, args ...interface{}) (er... | 2302_79757062/crawlab | core/interfaces/user_service.go | Go | bsd-3-clause | 634 |
package interfaces
type UserCreateOptions struct {
Username string
Password string
Email string
Role string
}
type UserLoginOptions struct {
Username string
Password string
}
| 2302_79757062/crawlab | core/interfaces/user_service_options.go | Go | bsd-3-clause | 190 |
package interfaces
type WithAddress interface {
GetAddress() (address Address)
SetAddress(address Address)
}
| 2302_79757062/crawlab | core/interfaces/with_address.go | Go | bsd-3-clause | 112 |
package interfaces
type WithConfigPath interface {
GetConfigPath() (path string)
SetConfigPath(path string)
}
| 2302_79757062/crawlab | core/interfaces/with_config_path.go | Go | bsd-3-clause | 113 |
package interfaces
type WithModelId interface {
GetModelId() (id ModelId)
SetModelId(id ModelId)
}
| 2302_79757062/crawlab | core/interfaces/with_model_id.go | Go | bsd-3-clause | 102 |
package main
func main() {
}
| 2302_79757062/crawlab | core/main.go | Go | bsd-3-clause | 30 |
package middlewares
import (
"github.com/crawlab-team/crawlab/core/constants"
"github.com/crawlab-team/crawlab/core/errors"
"github.com/crawlab-team/crawlab/core/models/service"
"github.com/crawlab-team/crawlab/core/user"
"github.com/crawlab-team/crawlab/core/utils"
"github.com/gin-gonic/gin"
"github.com/spf13/... | 2302_79757062/crawlab | core/middlewares/auth.go | Go | bsd-3-clause | 1,235 |
package middlewares
import (
"github.com/crawlab-team/crawlab/core/constants"
"github.com/crawlab-team/crawlab/core/errors"
"github.com/crawlab-team/crawlab/core/models/service"
"github.com/crawlab-team/crawlab/core/user"
"github.com/crawlab-team/crawlab/core/utils"
"github.com/gin-gonic/gin"
"github.com/spf13/... | 2302_79757062/crawlab | core/middlewares/auth_v2.go | Go | bsd-3-clause | 1,239 |
package middlewares
import "github.com/gin-gonic/gin"
func CORSMiddleware() gin.HandlerFunc {
return func(c *gin.Context) {
c.Writer.Header().Set("Access-Control-Allow-Origin", "*")
c.Writer.Header().Set("Access-Control-Allow-Credentials", "true")
c.Writer.Header().Set("Access-Control-Allow-Headers", "Content-... | 2302_79757062/crawlab | core/middlewares/cors.go | Go | bsd-3-clause | 624 |
package middlewares
import (
"github.com/crawlab-team/crawlab/core/errors"
"github.com/crawlab-team/crawlab/core/utils"
"github.com/gin-gonic/gin"
"github.com/spf13/viper"
)
func FilerAuthorizationMiddleware() gin.HandlerFunc {
return func(c *gin.Context) {
// auth key
authKey := c.GetHeader("Authorization")... | 2302_79757062/crawlab | core/middlewares/filer_auth.go | Go | bsd-3-clause | 710 |
package middlewares
import "github.com/gin-gonic/gin"
func InitMiddlewares(app *gin.Engine) (err error) {
// default logger
app.Use(gin.Logger())
// recovery from panics
app.Use(gin.Recovery())
// cors
app.Use(CORSMiddleware())
return nil
}
| 2302_79757062/crawlab | core/middlewares/middlewares.go | Go | bsd-3-clause | 253 |
package client
import (
"encoding/json"
"github.com/crawlab-team/crawlab/core/errors"
"github.com/crawlab-team/crawlab/core/interfaces"
"github.com/crawlab-team/crawlab/core/models/models"
grpc "github.com/crawlab-team/crawlab/grpc"
"github.com/crawlab-team/crawlab/trace"
)
func NewBasicBinder(id interfaces.Mod... | 2302_79757062/crawlab | core/models/client/binder_basic.go | Go | bsd-3-clause | 2,642 |
package client
import (
"encoding/json"
"github.com/crawlab-team/crawlab/core/errors"
"github.com/crawlab-team/crawlab/core/interfaces"
"github.com/crawlab-team/crawlab/core/models/models"
grpc "github.com/crawlab-team/crawlab/grpc"
"github.com/crawlab-team/crawlab/trace"
)
func NewListBinder(id interfaces.Mode... | 2302_79757062/crawlab | core/models/client/binder_list.go | Go | bsd-3-clause | 2,803 |
package client
import (
"encoding/json"
"github.com/apex/log"
"github.com/cenkalti/backoff/v4"
"github.com/crawlab-team/crawlab/core/container"
"github.com/crawlab-team/crawlab/core/entity"
"github.com/crawlab-team/crawlab/core/errors"
"github.com/crawlab-team/crawlab/core/interfaces"
"github.com/crawlab-team/... | 2302_79757062/crawlab | core/models/client/model_base_service.go | Go | bsd-3-clause | 7,490 |
package client
import (
"encoding/json"
config2 "github.com/crawlab-team/crawlab/core/config"
"github.com/crawlab-team/crawlab/core/entity"
"github.com/crawlab-team/crawlab/core/errors"
"github.com/crawlab-team/crawlab/core/grpc/client"
"github.com/crawlab-team/crawlab/core/interfaces"
"github.com/crawlab-team/... | 2302_79757062/crawlab | core/models/client/model_delegate.go | Go | bsd-3-clause | 8,998 |
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 EnvironmentServiceDelegate struct {
interfaces.GrpcClientModel... | 2302_79757062/crawlab | core/models/client/model_environment_service.go | Go | bsd-3-clause | 1,782 |
package client
import (
"github.com/crawlab-team/crawlab/core/constants"
"github.com/crawlab-team/crawlab/core/interfaces"
"time"
)
type ModelNodeDelegate struct {
n interfaces.Node
interfaces.GrpcClientModelDelegate
}
func (d *ModelNodeDelegate) UpdateStatus(active bool, activeTs *time.Time, status string) (er... | 2302_79757062/crawlab | core/models/client/model_node_delegate.go | Go | bsd-3-clause | 917 |