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 |
|---|---|---|---|---|---|
<!doctype html> <!-- Important: must specify -->
<html>
<head>
<meta charset="utf-8"> <!-- Important: rapi-doc uses utf8 characters -->
<script type="module" src="https://unpkg.com/rapidoc/dist/rapidoc-min.js"></script>
</head>
<body>
<rapi-doc spec-url="./openapi.yaml"></rapi-doc>
</body>
</html>
| 2302_79757062/crawlab | core/docs/api/index.html | HTML | bsd-3-clause | 301 |
const path = require('path')
const qiniu = require('qiniu')
const walkSync = require('walk-sync')
const chalk = require('chalk')
// target directory
const targetDir = './api'
// access key
const accessKey = process.env.QINIU_ACCESS_KEY
// secret key
const secretKey = process.env.QINIU_SECRET_KEY
// bucket
const buc... | 2302_79757062/crawlab | core/docs/scripts/publish.js | JavaScript | bsd-3-clause | 1,878 |
package ds
import (
"github.com/crawlab-team/crawlab/core/constants"
"github.com/crawlab-team/crawlab/core/interfaces"
"github.com/crawlab-team/crawlab/core/models/models"
"github.com/crawlab-team/crawlab/core/models/service"
"github.com/crawlab-team/crawlab/core/utils"
"github.com/crawlab-team/crawlab/trace"
"... | 2302_79757062/crawlab | core/ds/cockroachdb.go | Go | bsd-3-clause | 1,601 |
package ds
| 2302_79757062/crawlab | core/ds/default.go | Go | bsd-3-clause | 11 |
package ds
import (
"context"
"encoding/json"
"errors"
"fmt"
"github.com/crawlab-team/crawlab/core/constants"
constants2 "github.com/crawlab-team/crawlab/core/constants"
"github.com/crawlab-team/crawlab/core/entity"
entity2 "github.com/crawlab-team/crawlab/core/entity"
"github.com/crawlab-team/crawlab/core/in... | 2302_79757062/crawlab | core/ds/es.go | Go | bsd-3-clause | 5,394 |
package ds
import (
"github.com/cenkalti/backoff/v4"
"github.com/crawlab-team/crawlab/core/constants"
"github.com/crawlab-team/crawlab/core/entity"
"github.com/crawlab-team/crawlab/core/interfaces"
"github.com/crawlab-team/crawlab/core/models/models"
"github.com/crawlab-team/crawlab/core/models/service"
"github... | 2302_79757062/crawlab | core/ds/kafka.go | Go | bsd-3-clause | 2,652 |
package ds
import (
"github.com/crawlab-team/crawlab/core/constants"
"github.com/crawlab-team/crawlab/core/interfaces"
"github.com/crawlab-team/crawlab/core/models/models"
"github.com/crawlab-team/crawlab/core/models/service"
"github.com/crawlab-team/crawlab/core/utils"
utils2 "github.com/crawlab-team/crawlab/co... | 2302_79757062/crawlab | core/ds/mongo.go | Go | bsd-3-clause | 2,805 |
package ds
import (
"github.com/crawlab-team/crawlab/core/constants"
"github.com/crawlab-team/crawlab/core/interfaces"
"github.com/crawlab-team/crawlab/core/models/models"
"github.com/crawlab-team/crawlab/core/models/service"
"github.com/crawlab-team/crawlab/core/utils"
utils2 "github.com/crawlab-team/crawlab/co... | 2302_79757062/crawlab | core/ds/mssql.go | Go | bsd-3-clause | 1,625 |
package ds
import (
"github.com/crawlab-team/crawlab/core/constants"
"github.com/crawlab-team/crawlab/core/interfaces"
"github.com/crawlab-team/crawlab/core/models/models"
"github.com/crawlab-team/crawlab/core/models/service"
"github.com/crawlab-team/crawlab/core/utils"
utils2 "github.com/crawlab-team/crawlab/co... | 2302_79757062/crawlab | core/ds/mysql.go | Go | bsd-3-clause | 1,511 |
package ds
import (
"github.com/crawlab-team/crawlab/core/interfaces"
"time"
)
type DataSourceServiceOption func(svc interfaces.DataSourceService)
func WithMonitorInterval(duration time.Duration) DataSourceServiceOption {
return func(svc interfaces.DataSourceService) {
svc.SetMonitorInterval(duration)
}
}
| 2302_79757062/crawlab | core/ds/options.go | Go | bsd-3-clause | 316 |
package ds
import (
"github.com/crawlab-team/crawlab/core/constants"
"github.com/crawlab-team/crawlab/core/interfaces"
"github.com/crawlab-team/crawlab/core/models/models"
"github.com/crawlab-team/crawlab/core/models/service"
"github.com/crawlab-team/crawlab/core/utils"
utils2 "github.com/crawlab-team/crawlab/co... | 2302_79757062/crawlab | core/ds/postgresql.go | Go | bsd-3-clause | 1,650 |
package ds
import (
"github.com/apex/log"
"github.com/crawlab-team/crawlab/core/constants"
constants2 "github.com/crawlab-team/crawlab/core/constants"
"github.com/crawlab-team/crawlab/core/container"
"github.com/crawlab-team/crawlab/core/interfaces"
"github.com/crawlab-team/crawlab/core/models/delegate"
"github... | 2302_79757062/crawlab | core/ds/service.go | Go | bsd-3-clause | 7,072 |
package ds
import (
"github.com/crawlab-team/crawlab/core/entity"
"github.com/crawlab-team/crawlab/core/models/models"
"github.com/crawlab-team/crawlab/core/models/service"
utils2 "github.com/crawlab-team/crawlab/core/utils"
"github.com/crawlab-team/crawlab/db/generic"
"github.com/crawlab-team/crawlab/trace"
"g... | 2302_79757062/crawlab | core/ds/sql.go | Go | bsd-3-clause | 1,694 |
package ds
type SqlOptions struct {
DefaultHost string
DefaultPort string
}
| 2302_79757062/crawlab | core/ds/sql_options.go | Go | bsd-3-clause | 79 |
package ds
import (
"github.com/crawlab-team/crawlab/core/interfaces"
"github.com/crawlab-team/crawlab/core/models/models"
"github.com/crawlab-team/crawlab/core/models/service"
utils2 "github.com/crawlab-team/crawlab/core/utils"
"github.com/crawlab-team/crawlab/trace"
"go.mongodb.org/mongo-driver/bson/primitive"... | 2302_79757062/crawlab | core/ds/sqlite.go | Go | bsd-3-clause | 1,176 |
package entity
import (
"errors"
"fmt"
"strings"
)
type Address struct {
Host string
Port string
}
func (a *Address) String() (res string) {
return fmt.Sprintf("%s:%s", a.Host, a.Port)
}
func (a *Address) IsEmpty() (res bool) {
return a.Host == "" || a.Port == ""
}
func (a *Address) Value() (res interface{}... | 2302_79757062/crawlab | core/entity/address.go | Go | bsd-3-clause | 1,041 |
package entity
type Color struct {
Name string `json:"name"`
Hex string `json:"hex"`
}
func (c *Color) GetHex() string {
return c.Hex
}
func (c *Color) GetName() string {
return c.Name
}
func (c *Color) Value() interface{} {
return c
}
| 2302_79757062/crawlab | core/entity/color.go | Go | bsd-3-clause | 246 |
package entity
import "strconv"
type Page struct {
Skip int
Limit int
PageNum int
PageSize int
}
func (p *Page) GetPage(pageNum string, pageSize string) {
p.PageNum, _ = strconv.Atoi(pageNum)
p.PageSize, _ = strconv.Atoi(pageSize)
p.Skip = p.PageSize * (p.PageNum - 1)
p.Limit = p.PageSize
}
| 2302_79757062/crawlab | core/entity/common.go | Go | bsd-3-clause | 311 |
package entity
type ConfigSpiderData struct {
// 通用
Name string `yaml:"name" json:"name"`
DisplayName string `yaml:"display_name" json:"display_name"`
Col string `yaml:"col" json:"col"`
Remark string `yaml:"remark" json:"remark"`
Type string `yaml:"type" bson:"type"`
// 可配置爬虫
Engine... | 2302_79757062/crawlab | core/entity/config_spider.go | Go | bsd-3-clause | 1,452 |
package entity
type DataField struct {
Key string `json:"key" bson:"key"`
Type string `json:"type" bson:"type"`
}
| 2302_79757062/crawlab | core/entity/data_field.go | Go | bsd-3-clause | 118 |
package entity
type DocItem struct {
Title string `json:"title"`
Url string `json:"url"`
Path string `json:"path"`
Children []DocItem `json:"children"`
}
| 2302_79757062/crawlab | core/entity/doc.go | Go | bsd-3-clause | 180 |
package entity
/* ElasticsearchResponseData JSON format
{
"took" : 6,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 60,
"relation" : "eq"
},
"max_score" : 1.0,
"hits" : [
{
... | 2302_79757062/crawlab | core/entity/es.go | Go | bsd-3-clause | 1,242 |
package entity
type EventData struct {
Event string
Data interface{}
}
func (d *EventData) GetEvent() string {
return d.Event
}
func (d *EventData) GetData() interface{} {
return d.Data
}
| 2302_79757062/crawlab | core/entity/event.go | Go | bsd-3-clause | 196 |
package entity
import (
"github.com/crawlab-team/crawlab/core/interfaces"
"time"
)
type Export struct {
Id string `json:"id"`
Type string `json:"type"`
Target string `json:"target"`
Filter interfaces.Filter `json:"filter"`
Status string ... | 2302_79757062/crawlab | core/entity/export.go | Go | bsd-3-clause | 1,060 |
package entity
import (
"github.com/crawlab-team/crawlab/core/interfaces"
"reflect"
)
type Condition struct {
Key string `json:"key"`
Op string `json:"op"`
Value interface{} `json:"value"`
}
func (c *Condition) GetKey() (key string) {
return c.Key
}
func (c *Condition) SetKey(key string) {
c.K... | 2302_79757062/crawlab | core/entity/filter.go | Go | bsd-3-clause | 1,298 |
package entity
type FilterSelectOption struct {
Value interface{} `json:"value" bson:"value"`
Label string `json:"label" bson:"label"`
}
| 2302_79757062/crawlab | core/entity/filter_select_option.go | Go | bsd-3-clause | 145 |
package entity
import (
"github.com/crawlab-team/crawlab/core/interfaces"
"os"
"time"
)
type FsFileInfo struct {
Name string `json:"name"` // file name
Path string `json:"path"` // file path
FullPath string `json:"full_path"` // file full p... | 2302_79757062/crawlab | core/entity/fs_file_info.go | Go | bsd-3-clause | 1,491 |
package entity
type GitPayload struct {
Paths []string `json:"paths"`
CommitMessage string `json:"commit_message"`
Branch string `json:"branch"`
Tag string `json:"tag"`
}
type GitConfig struct {
Url string `json:"url" bson:"url"`
}
| 2302_79757062/crawlab | core/entity/git.go | Go | bsd-3-clause | 270 |
package entity
import (
"encoding/json"
"github.com/crawlab-team/crawlab/core/interfaces"
"github.com/crawlab-team/crawlab/trace"
)
type GrpcBaseServiceMessage struct {
ModelId interfaces.ModelId `json:"id"`
Data []byte `json:"d"`
}
func (msg *GrpcBaseServiceMessage) GetModelId() interfaces.Model... | 2302_79757062/crawlab | core/entity/grpc_base_service_message.go | Go | bsd-3-clause | 593 |
package entity
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"
)
type GrpcBaseServiceParams struct {
Query bson.M `json:"q"`
Id primitive.ObjectID `jso... | 2302_79757062/crawlab | core/entity/grpc_base_service_params.go | Go | bsd-3-clause | 666 |
package entity
import (
"encoding/json"
"github.com/crawlab-team/crawlab/core/interfaces"
"github.com/crawlab-team/crawlab/trace"
)
type GrpcDelegateMessage struct {
ModelId interfaces.ModelId `json:"id"`
Method interfaces.ModelDelegateMethod `json:"m"`
Data []byte `json:... | 2302_79757062/crawlab | core/entity/grpc_delegate_message.go | Go | bsd-3-clause | 755 |
package entity
type GrpcEventServiceMessage struct {
Type string `json:"type"`
Events []string `json:"events"`
Key string `json:"key"`
Data []byte `json:"data"`
}
| 2302_79757062/crawlab | core/entity/grpc_event_service_message.go | Go | bsd-3-clause | 181 |
package entity
import (
"github.com/crawlab-team/crawlab/core/interfaces"
)
type GrpcSubscribe struct {
Stream interfaces.GrpcStream
Finished chan bool
}
func (sub *GrpcSubscribe) GetStream() interfaces.GrpcStream {
return sub.Stream
}
func (sub *GrpcSubscribe) GetStreamBidirectional() interfaces.GrpcStreamBi... | 2302_79757062/crawlab | core/entity/grpc_subscribe.go | Go | bsd-3-clause | 516 |
package entity
import "go.mongodb.org/mongo-driver/bson/primitive"
type Response struct {
Status string `json:"status"`
Message string `json:"message"`
Data interface{} `json:"data"`
Error string `json:"error"`
}
type ListResponse struct {
Status string `json:"status"`
Message string... | 2302_79757062/crawlab | core/entity/http.go | Go | bsd-3-clause | 1,211 |
package entity
import "github.com/crawlab-team/crawlab/core/interfaces"
type ModelDelegate struct {
Id interfaces.ModelId `json:"id"`
ColName string `json:"col_name"`
Doc interfaces.Model `json:"doc"`
Artifact interfaces.ModelArtifact `json:"a"`
User interfaces.Use... | 2302_79757062/crawlab | core/entity/model_delegate.go | Go | bsd-3-clause | 344 |
package entity
import "github.com/crawlab-team/crawlab/core/interfaces"
type ModelInfo struct {
Id interfaces.ModelId
ColName string
}
| 2302_79757062/crawlab | core/entity/model_info.go | Go | bsd-3-clause | 144 |
package entity
type NodeInfo struct {
Key string `json:"key"`
IsMaster bool `json:"is_master"`
Name string `json:"name"`
Ip string `json:"ip"`
Mac string `json:"mac"`
Hostname string `json:"hostname"`
Description string `json:"description"`
AuthKey string `json:"auth... | 2302_79757062/crawlab | core/entity/node.go | Go | bsd-3-clause | 423 |
package entity
import "github.com/crawlab-team/crawlab/core/constants"
type Pagination struct {
Page int `form:"page" url:"page"`
Size int `form:"size" url:"size"`
}
func (p *Pagination) IsZero() (ok bool) {
return p.Page == 0 &&
p.Size == 0
}
func (p *Pagination) IsDefault() (ok bool) {
return p.Page == cons... | 2302_79757062/crawlab | core/entity/pagination.go | Go | bsd-3-clause | 397 |
package entity
import (
"encoding/json"
"github.com/crawlab-team/crawlab/core/constants"
"github.com/crawlab-team/crawlab/trace"
"go.mongodb.org/mongo-driver/bson/primitive"
)
type Result map[string]interface{}
func (r Result) Value() map[string]interface{} {
return r
}
func (r Result) SetValue(key string, val... | 2302_79757062/crawlab | core/entity/result.go | Go | bsd-3-clause | 1,801 |
package entity
type RpcMessage struct {
Id string `json:"id"` // 消息ID
Method string `json:"method"` // 消息方法
NodeId string `json:"node_id"` // 节点ID
Params map[string]string `json:"params"` // 参数
Timeout int `json:"timeout"` // 超时
Result string ... | 2302_79757062/crawlab | core/entity/rpc.go | Go | bsd-3-clause | 431 |
package entity
type Sort struct {
Key string `json:"key"`
Direction string `json:"d"`
}
| 2302_79757062/crawlab | core/entity/sort.go | Go | bsd-3-clause | 97 |
package entity
type SpiderType struct {
Type string `json:"type" bson:"_id"`
Count int `json:"count" bson:"count"`
}
type ScrapySettingParam struct {
Key string `json:"key"`
Value interface{} `json:"value"`
Type string `json:"type"`
}
type ScrapyItem struct {
Name string `json:"name"`
Fie... | 2302_79757062/crawlab | core/entity/spider.go | Go | bsd-3-clause | 351 |
package entity
type StatsDailyItem struct {
Date string `json:"date" bson:"_id"`
Tasks int64 `json:"tasks" bson:"tasks"`
Results int64 `json:"results" bson:"results"`
}
type StatsTasksByStatusItem struct {
Status string `json:"status" bson:"_id"`
Tasks int64 `json:"tasks" bson:"tasks"`
}
| 2302_79757062/crawlab | core/entity/stats.go | Go | bsd-3-clause | 305 |
package entity
type SystemInfo struct {
Edition string `json:"edition"` // edition. e.g. community / pro
Version string `json:"version"` // version. e.g. v0.6.0
}
| 2302_79757062/crawlab | core/entity/system_info.go | Go | bsd-3-clause | 166 |
package entity
import (
"encoding/json"
"go.mongodb.org/mongo-driver/bson/primitive"
)
type TaskMessage struct {
Id primitive.ObjectID `json:"id"`
Key string `json:"key"`
Cmd string `json:"cmd"`
Param string `json:"param"`
}
func (m *TaskMessage) ToString() (string, e... | 2302_79757062/crawlab | core/entity/task.go | Go | bsd-3-clause | 624 |
package entity
type Translation struct {
Lang string `json:"lang"`
Key string `json:"key"`
Value string `json:"value"`
}
func (t Translation) GetLang() (l string) {
return t.Lang
}
| 2302_79757062/crawlab | core/entity/translation.go | Go | bsd-3-clause | 190 |
package entity
import (
"sync"
"time"
)
type TTLMap struct {
TTL time.Duration
data sync.Map
}
type expireEntry struct {
ExpiresAt time.Time
Value interface{}
}
func (t *TTLMap) Store(key string, val interface{}) {
t.data.Store(key, expireEntry{
ExpiresAt: time.Now().Add(t.TTL),
Value: val,
})
... | 2302_79757062/crawlab | core/entity/ttl_map.go | Go | bsd-3-clause | 888 |
package entity
type Release struct {
Name string `json:"name"`
Draft bool `json:"draft"`
PreRelease bool `json:"pre_release"`
PublishedAt string `json:"published_at"`
Body string `json:"body"`
}
type ReleaseSlices []Release
func (r ReleaseSlices) Len() int {
return len(r)
}
func (r Re... | 2302_79757062/crawlab | core/entity/version.go | Go | bsd-3-clause | 469 |
package errors
import (
"errors"
"fmt"
)
const (
ErrorPrefixController = "controller"
ErrorPrefixModel = "model"
ErrorPrefixFilter = "filter"
ErrorPrefixHttp = "http"
ErrorPrefixGrpc = "grpc"
ErrorPrefixNode = "node"
ErrorPrefixInject = "inject"
ErrorPrefixSpider = "spider... | 2302_79757062/crawlab | core/errors/base.go | Go | bsd-3-clause | 808 |
package errors
func NewControllerError(msg string) (err error) {
return NewError(ErrorPrefixController, msg)
}
var ErrorControllerInvalidControllerId = NewControllerError("invalid controller id")
var ErrorControllerInvalidType = NewControllerError("invalid type")
var ErrorControllerAddError = NewControllerError("add... | 2302_79757062/crawlab | core/errors/controller.go | Go | bsd-3-clause | 1,084 |
package errors
func NewDataSourceError(msg string) (err error) {
return NewError(ErrorPrefixDataSource, msg)
}
var (
ErrorDataSourceInvalidType = NewDataSourceError("invalid type")
ErrorDataSourceNotExists = NewDataSourceError("not exists")
ErrorDataSourceNotExistsInContext = NewDataSourc... | 2302_79757062/crawlab | core/errors/ds.go | Go | bsd-3-clause | 663 |
package errors
func NewEventError(msg string) (err error) {
return NewError(ErrorPrefixEvent, msg)
}
var ErrorEventNotFound = NewEventError("not found")
var ErrorEventInvalidType = NewEventError("invalid type")
var ErrorEventAlreadyExists = NewEventError("already exists")
var ErrorEventUnknownAction = NewEventError(... | 2302_79757062/crawlab | core/errors/event.go | Go | bsd-3-clause | 338 |
package errors
func NewFilterError(msg string) (err error) {
return NewError(ErrorPrefixFilter, msg)
}
var ErrorFilterInvalidOperation = NewFilterError("invalid operation")
var ErrorFilterUnableToParseQuery = NewFilterError("unable to parse query")
| 2302_79757062/crawlab | core/errors/filter.go | Go | bsd-3-clause | 252 |
package errors
func NewFsError(msg string) (err error) {
return NewError(ErrorPrefixFs, msg)
}
var ErrorFsForbidden = NewFsError("forbidden")
var ErrorFsEmptyWorkspacePath = NewFsError("empty workspace path")
var ErrorFsInvalidType = NewFsError("invalid type")
var ErrorFsAlreadyExists = NewFsError("already exists")
... | 2302_79757062/crawlab | core/errors/fs.go | Go | bsd-3-clause | 378 |
package errors
func NewGitError(msg string) (err error) {
return NewError(ErrorPrefixGit, msg)
}
var (
ErrorGitInvalidAuthType = NewGitError("invalid auth type")
ErrorGitNoMainBranch = NewGitError("no main branch")
)
| 2302_79757062/crawlab | core/errors/git.go | Go | bsd-3-clause | 225 |
package errors
func NewGrpcError(msg string) (err error) {
return NewError(ErrorPrefixGrpc, msg)
}
var (
ErrorGrpcClientFailedToStart = NewGrpcError("client failed to start")
ErrorGrpcServerFailedToListen = NewGrpcError("server failed to listen")
ErrorGrpcServerFailedToServe = NewGrpcError("server failed to ser... | 2302_79757062/crawlab | core/errors/grpc.go | Go | bsd-3-clause | 914 |
package errors
func NewHttpError(msg string) (err error) {
return NewError(ErrorPrefixHttp, msg)
}
var ErrorHttpBadRequest = NewHttpError("bad request")
var ErrorHttpUnauthorized = NewHttpError("unauthorized")
var ErrorHttpNotFound = NewHttpError("not found")
| 2302_79757062/crawlab | core/errors/http.go | Go | bsd-3-clause | 263 |
package errors
import "errors"
func NewModelError(msg string) (err error) {
return NewError(ErrorPrefixModel, msg)
}
var ErrorModelInvalidType = NewModelError("invalid type")
var ErrorModelInvalidModelId = NewModelError("invalid model id")
var ErrorModelNotImplemented = NewModelError("not implemented")
var ErrorMod... | 2302_79757062/crawlab | core/errors/model.go | Go | bsd-3-clause | 782 |
package errors
func NewNodeError(msg string) (err error) {
return NewError(ErrorPrefixNode, msg)
}
var ErrorNodeUnregistered = NewNodeError("unregistered")
var ErrorNodeServiceNotExists = NewNodeError("service not exists")
var ErrorNodeInvalidType = NewNodeError("invalid type")
var ErrorNodeInvalidStatus = NewNodeEr... | 2302_79757062/crawlab | core/errors/node.go | Go | bsd-3-clause | 571 |
package errors
func NewProcessError(msg string) (err error) {
return NewError(ErrorPrefixProcess, msg)
}
var (
ErrorProcessReachedMaxErrors = NewProcessError("reached max errors")
ErrorProcessDaemonProcessExited = NewProcessError("daemon process exited")
)
| 2302_79757062/crawlab | core/errors/process.go | Go | bsd-3-clause | 265 |
package errors
func NewResultError(msg string) (err error) {
return NewError(ErrorPrefixResult, msg)
}
| 2302_79757062/crawlab | core/errors/result.go | Go | bsd-3-clause | 105 |
package errors
func NewScheduleError(msg string) (err error) {
return NewError(ErrorPrefixSchedule, msg)
}
//var ErrorSchedule = NewScheduleError("unregistered")
| 2302_79757062/crawlab | core/errors/schedule.go | Go | bsd-3-clause | 165 |
package errors
func NewSpiderError(msg string) (err error) {
return NewError(ErrorPrefixSpider, msg)
}
var (
ErrorSpiderMissingRequiredOption = NewSpiderError("missing required option")
ErrorSpiderForbidden = NewSpiderError("forbidden")
)
| 2302_79757062/crawlab | core/errors/spider.go | Go | bsd-3-clause | 256 |
package errors
func NewStatsError(msg string) (err error) {
return NewError(ErrorPrefixStats, msg)
}
var ErrorStatsInvalidType = NewStatsError("invalid type")
| 2302_79757062/crawlab | core/errors/stats.go | Go | bsd-3-clause | 162 |
package errors
func NewInjectError(msg string) (err error) {
return NewError(ErrorPrefixInject, msg)
}
var ErrorInjectEmptyValue = NewInjectError("empty value")
var ErrorInjectNotExists = NewInjectError("not exists")
var ErrorInjectInvalidType = NewInjectError("invalid type")
| 2302_79757062/crawlab | core/errors/store.go | Go | bsd-3-clause | 280 |
package errors
func NewTaskError(msg string) (err error) {
return NewError(ErrorPrefixTask, msg)
}
var (
ErrorTaskNotExists = NewTaskError("not exists")
ErrorTaskAlreadyExists = NewTaskError("already exists")
ErrorTaskInvalidType = NewTaskError("invalid type")
ErrorTaskProcessStillE... | 2302_79757062/crawlab | core/errors/task.go | Go | bsd-3-clause | 835 |
package errors
func NewUserError(msg string) (err error) {
return NewError(ErrorPrefixUser, msg)
}
var (
ErrorUserInvalidType = NewUserError("invalid type")
ErrorUserInvalidToken = NewUserError("invalid token")
ErrorUserNotExists = NewUserError("not exists")
ErrorUserNotExistsInCon... | 2302_79757062/crawlab | core/errors/user.go | Go | bsd-3-clause | 730 |
package event
func SendEvent(eventName string, data ...interface{}) {
svc := NewEventService()
svc.SendEvent(eventName, data...)
}
| 2302_79757062/crawlab | core/event/func.go | Go | bsd-3-clause | 134 |
package event
| 2302_79757062/crawlab | core/event/options.go | Go | bsd-3-clause | 14 |
package event
import (
"fmt"
"github.com/apex/log"
"github.com/crawlab-team/crawlab/core/entity"
"github.com/crawlab-team/crawlab/core/interfaces"
"github.com/crawlab-team/crawlab/core/utils"
"github.com/crawlab-team/crawlab/trace"
"github.com/thoas/go-funk"
"regexp"
)
var S interfaces.EventService
type Serv... | 2302_79757062/crawlab | core/event/service.go | Go | bsd-3-clause | 2,075 |
package export
import (
"context"
"encoding/csv"
"errors"
"fmt"
"github.com/ReneKroon/ttlcache"
"github.com/apex/log"
"github.com/crawlab-team/crawlab/core/constants"
"github.com/crawlab-team/crawlab/core/entity"
"github.com/crawlab-team/crawlab/core/interfaces"
"github.com/crawlab-team/crawlab/core/utils"
... | 2302_79757062/crawlab | core/export/csv_service.go | Go | bsd-3-clause | 8,238 |
package export
import (
"context"
"encoding/json"
"errors"
"github.com/ReneKroon/ttlcache"
"github.com/apex/log"
"github.com/crawlab-team/crawlab/core/constants"
"github.com/crawlab-team/crawlab/core/entity"
"github.com/crawlab-team/crawlab/core/interfaces"
"github.com/crawlab-team/crawlab/core/utils"
"githu... | 2302_79757062/crawlab | core/export/json_service.go | Go | bsd-3-clause | 5,395 |
package fs
import (
"github.com/apex/log"
"github.com/mitchellh/go-homedir"
"github.com/spf13/viper"
"path/filepath"
)
func init() {
rootDir, err := homedir.Dir()
if err != nil {
log.Warnf("cannot find home directory: %v", err)
return
}
DefaultWorkspacePath = filepath.Join(rootDir, "crawlab_workspace")
... | 2302_79757062/crawlab | core/fs/default.go | Go | bsd-3-clause | 477 |
package fs
import (
"github.com/crawlab-team/crawlab/core/entity"
"github.com/crawlab-team/crawlab/core/interfaces"
"github.com/crawlab-team/crawlab/core/utils"
"io"
"os"
"path/filepath"
)
type ServiceV2 struct {
// settings
rootPath string
skipNames []string
}
func (svc *ServiceV2) List(path string) (file... | 2302_79757062/crawlab | core/fs/service_v2.go | Go | bsd-3-clause | 3,893 |
package client
import (
"context"
"encoding/json"
"github.com/apex/log"
"github.com/cenkalti/backoff/v4"
"github.com/crawlab-team/crawlab/core/constants"
"github.com/crawlab-team/crawlab/core/container"
"github.com/crawlab-team/crawlab/core/entity"
"github.com/crawlab-team/crawlab/core/errors"
"github.com/cra... | 2302_79757062/crawlab | core/grpc/client/client.go | Go | bsd-3-clause | 9,823 |
package client
import (
"context"
"encoding/json"
"github.com/apex/log"
"github.com/cenkalti/backoff/v4"
"github.com/crawlab-team/crawlab/core/constants"
"github.com/crawlab-team/crawlab/core/entity"
"github.com/crawlab-team/crawlab/core/errors"
"github.com/crawlab-team/crawlab/core/grpc/middlewares"
"github.... | 2302_79757062/crawlab | core/grpc/client/client_v2.go | Go | bsd-3-clause | 7,008 |
package client
import (
"github.com/crawlab-team/crawlab/core/interfaces"
"time"
)
type Option func(client interfaces.GrpcClient)
func WithConfigPath(path string) Option {
return func(c interfaces.GrpcClient) {
c.SetConfigPath(path)
}
}
func WithAddress(address interfaces.Address) Option {
return func(c inte... | 2302_79757062/crawlab | core/grpc/client/options.go | Go | bsd-3-clause | 1,019 |
package client
import (
"github.com/crawlab-team/crawlab/core/errors"
"github.com/crawlab-team/crawlab/core/interfaces"
"github.com/crawlab-team/crawlab/trace"
"github.com/emirpasic/gods/lists/arraylist"
"math/rand"
)
type Pool struct {
// settings
size int
cfgPath string
// internals
clients *arraylist... | 2302_79757062/crawlab | core/grpc/client/pool.go | Go | bsd-3-clause | 1,559 |
package client
import grpc2 "github.com/crawlab-team/crawlab/grpc"
var EmptyRequest = &grpc2.Request{}
| 2302_79757062/crawlab | core/grpc/client/utils_proto.go | Go | bsd-3-clause | 105 |
package middlewares
import (
"context"
"github.com/crawlab-team/crawlab/core/constants"
"github.com/crawlab-team/crawlab/core/errors"
"github.com/crawlab-team/crawlab/core/interfaces"
"github.com/grpc-ecosystem/go-grpc-middleware/auth"
"google.golang.org/grpc"
"google.golang.org/grpc/metadata"
)
func GetAuthTo... | 2302_79757062/crawlab | core/grpc/middlewares/auth_token.go | Go | bsd-3-clause | 2,352 |
package payload
import (
"github.com/crawlab-team/crawlab/db/mongo"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
)
type ModelServiceV2Payload struct {
Type string `json:"type,omitempty"`
Id primitive.ObjectID `json:"_id,omitempty"`
Query bson.... | 2302_79757062/crawlab | core/grpc/payload/model_service_v2_payload.go | Go | bsd-3-clause | 598 |
package server
import (
"context"
grpc "github.com/crawlab-team/crawlab/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)
type DependenciesServerV2 struct {
grpc.UnimplementedDependencyServiceV2Server
}
func (svr DependenciesServerV2) Connect(stream grpc.DependencyServiceV2_ConnectServer) (... | 2302_79757062/crawlab | core/grpc/server/dependencies_server_v2.go | Go | bsd-3-clause | 1,133 |
package server
import (
"github.com/apex/log"
"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/crawlab/core/models/service"
grpc "github.com/craw... | 2302_79757062/crawlab | core/grpc/server/message_server.go | Go | bsd-3-clause | 2,506 |
package server
import (
"encoding/json"
"github.com/crawlab-team/crawlab/core/entity"
"github.com/crawlab-team/crawlab/core/interfaces"
"github.com/crawlab-team/crawlab/grpc"
"github.com/crawlab-team/crawlab/trace"
)
func NewModelBaseServiceBinder(req *grpc.Request) (b *ModelBaseServiceBinder) {
return &ModelBa... | 2302_79757062/crawlab | core/grpc/server/model_base_service_binder.go | Go | bsd-3-clause | 1,578 |
package server
import (
"context"
"encoding/json"
"github.com/crawlab-team/crawlab/core/container"
"github.com/crawlab-team/crawlab/core/entity"
"github.com/crawlab-team/crawlab/core/interfaces"
"github.com/crawlab-team/crawlab/core/models/service"
"github.com/crawlab-team/crawlab/core/utils"
grpc "github.com/... | 2302_79757062/crawlab | core/grpc/server/model_base_service_server.go | Go | bsd-3-clause | 5,642 |
package server
import (
"context"
"encoding/json"
"github.com/crawlab-team/crawlab/core/models/models"
"github.com/crawlab-team/crawlab/core/models/service"
"github.com/crawlab-team/crawlab/db/mongo"
grpc "github.com/crawlab-team/crawlab/grpc"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bso... | 2302_79757062/crawlab | core/grpc/server/model_base_service_v2_server.go | Go | bsd-3-clause | 9,290 |
package server
import (
"encoding/json"
"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/crawlab/core/models/models"
"github.com/crawlab-team/crawlab/grpc"
)
func NewModelDelegateBinder(req *grp... | 2302_79757062/crawlab | core/grpc/server/model_delegate_binder.go | Go | bsd-3-clause | 3,530 |
package server
import (
"context"
"github.com/crawlab-team/crawlab/core/errors"
"github.com/crawlab-team/crawlab/core/interfaces"
"github.com/crawlab-team/crawlab/core/models/delegate"
grpc "github.com/crawlab-team/crawlab/grpc"
)
type ModelDelegateServer struct {
grpc.UnimplementedModelDelegateServer
}
// Do ... | 2302_79757062/crawlab | core/grpc/server/model_delegate_server.go | Go | bsd-3-clause | 1,550 |
package server
import (
"context"
"encoding/json"
"github.com/apex/log"
"github.com/crawlab-team/crawlab/core/constants"
"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/crawlab/core/models/del... | 2302_79757062/crawlab | core/grpc/server/node_server.go | Go | bsd-3-clause | 5,493 |
package server
import (
"context"
"encoding/json"
"github.com/apex/log"
"github.com/crawlab-team/crawlab/core/constants"
"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/crawlab/core/models/mod... | 2302_79757062/crawlab | core/grpc/server/node_server_v2.go | Go | bsd-3-clause | 5,288 |
package server
import (
"github.com/crawlab-team/crawlab/core/interfaces"
)
type Option func(svr interfaces.GrpcServer)
func WithConfigPath(path string) Option {
return func(svr interfaces.GrpcServer) {
svr.SetConfigPath(path)
}
}
func WithAddress(address interfaces.Address) Option {
return func(svr interface... | 2302_79757062/crawlab | core/grpc/server/options.go | Go | bsd-3-clause | 943 |
package server
import (
"encoding/json"
"fmt"
"github.com/apex/log"
config2 "github.com/crawlab-team/crawlab/core/config"
"github.com/crawlab-team/crawlab/core/constants"
"github.com/crawlab-team/crawlab/core/container"
"github.com/crawlab-team/crawlab/core/entity"
"github.com/crawlab-team/crawlab/core/errors"... | 2302_79757062/crawlab | core/grpc/server/server.go | Go | bsd-3-clause | 6,351 |
package server
import (
"encoding/json"
"fmt"
"github.com/apex/log"
"github.com/crawlab-team/crawlab/core/constants"
"github.com/crawlab-team/crawlab/core/entity"
"github.com/crawlab-team/crawlab/core/errors"
"github.com/crawlab-team/crawlab/core/grpc/middlewares"
"github.com/crawlab-team/crawlab/core/interfac... | 2302_79757062/crawlab | core/grpc/server/server_v2.go | Go | bsd-3-clause | 5,898 |
package server
import (
"context"
"encoding/json"
"github.com/apex/log"
"github.com/crawlab-team/crawlab/core/constants"
"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"... | 2302_79757062/crawlab | core/grpc/server/task_server.go | Go | bsd-3-clause | 6,460 |
package server
import (
"context"
"encoding/json"
"errors"
"github.com/apex/log"
"github.com/crawlab-team/crawlab/core/constants"
"github.com/crawlab-team/crawlab/core/entity"
"github.com/crawlab-team/crawlab/core/interfaces"
"github.com/crawlab-team/crawlab/core/models/models"
"github.com/crawlab-team/crawla... | 2302_79757062/crawlab | core/grpc/server/task_server_v2.go | Go | bsd-3-clause | 6,504 |
package server
import (
"encoding/json"
"github.com/crawlab-team/crawlab/grpc"
"github.com/crawlab-team/crawlab/trace"
)
func HandleError(err error) (res *grpc.Response, err2 error) {
trace.PrintError(err)
return &grpc.Response{
Code: grpc.ResponseCode_ERROR,
Error: err.Error(),
}, err
}
func HandleSucces... | 2302_79757062/crawlab | core/grpc/server/utils_handle.go | Go | bsd-3-clause | 1,115 |
package test
import (
"github.com/crawlab-team/crawlab/core/entity"
"github.com/crawlab-team/crawlab/core/grpc/client"
"github.com/crawlab-team/crawlab/core/grpc/server"
"github.com/crawlab-team/crawlab/core/interfaces"
"github.com/crawlab-team/crawlab/core/node/test"
"testing"
"time"
)
type Test struct {
Ser... | 2302_79757062/crawlab | core/grpc/test/base.go | Go | bsd-3-clause | 1,475 |
package i18n
import "github.com/crawlab-team/crawlab/core/interfaces"
var translations []interfaces.Translation
var _svc interfaces.I18nService
type Service struct {
}
func (svc *Service) AddTranslations(t []interfaces.Translation) {
translations = append(translations, t...)
}
func (svc *Service) GetTranslations... | 2302_79757062/crawlab | core/i18n/service.go | Go | bsd-3-clause | 880 |
package interfaces
type Address interface {
Entity
String() string
IsEmpty() bool
}
| 2302_79757062/crawlab | core/interfaces/address.go | Go | bsd-3-clause | 88 |
package interfaces
type Color interface {
Entity
GetHex() string
GetName() string
}
| 2302_79757062/crawlab | core/interfaces/color.go | Go | bsd-3-clause | 88 |