constants

package
v0.6.0-9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 9, 2022 License: BSD-3-Clause Imports: 1 Imported by: 2

Documentation

Index

Constants

View Source
const (
	ActionTypeVisit          = "visit"
	ActionTypeInstallDep     = "install_dep"
	ActionTypeInstallLang    = "install_lang"
	ActionTypeViewDisclaimer = "view_disclaimer"
)
View Source
const (
	AnchorStartStage = "START_STAGE"
	AnchorStartUrl   = "START_URL"
	AnchorItems      = "ITEMS"
	AnchorParsers    = "PARSERS"
)
View Source
const (
	OwnerTypeAll    = "all"
	OwnerTypeMe     = "me"
	OwnerTypePublic = "public"
)
View Source
const (
	CacheColName             = "cache"
	CacheColKey              = "k"
	CacheColValue            = "v"
	CacheColTime             = "t"
	CacheKeyPublicPlugins    = "public_plugins"
	CacheKeyPublicPluginInfo = "public_plugin_info"
)
View Source
const (
	ChannelAllNode = "nodes:public"

	ChannelWorkerNode = "nodes:"

	ChannelMasterNode = "nodes:master"
)
View Source
const (
	ASCENDING  = "asc"
	DESCENDING = "dsc"
)
View Source
const (
	EngineScrapy = "scrapy"
	EngineColly  = "colly"
)
View Source
const (
	DataSourceStatusOnline  = "on"
	DataSourceStatusOffline = "off"
)
View Source
const (
	GrpcEventServiceTypeRegister = "register"
	GrpcEventServiceTypeSend     = "send"
)
View Source
const (
	FilterQueryFieldConditions = "conditions"
	FilterQueryFieldAll        = "all"
)
View Source
const (
	FilterObjectTypeString  = "string"
	FilterObjectTypeNumber  = "number"
	FilterObjectTypeBoolean = "boolean"
)
View Source
const (
	FilterOpNotSet           = "ns"
	FilterOpContains         = "c"
	FilterOpNotContains      = "nc"
	FilterOpRegex            = "r"
	FilterOpEqual            = "eq"
	FilterOpNotEqual         = "ne"
	FilterOpIn               = "in"
	FilterOpNotIn            = "nin"
	FilterOpGreaterThan      = "gt"
	FilterOpLessThan         = "lt"
	FilterOpGreaterThanEqual = "gte"
	FilterOpLessThanEqual    = "lte"
	FilterOpSearch           = "s"
)
View Source
const (
	GitAuthTypeHttp = "http"
	GitAuthTypeSsh  = "ssh"
)
View Source
const (
	GitRemoteNameUpstream = "upstream"
	GitRemoteNameOrigin   = "origin"
)
View Source
const (
	DefaultGrpcServerHost       = ""
	DefaultGrpcServerPort       = "9666"
	DefaultGrpcClientRemoteHost = "localhost"
	DefaultGrpcClientRemotePort = DefaultGrpcServerPort
	DefaultGrpcAuthKey          = "Crawlab2021!"
)
View Source
const (
	GrpcSubscribeTypeNode   = "node"
	GrpcSubscribeTypePlugin = "plugin"
)
View Source
const (
	HttpResponseStatusOk       = "ok"
	HttpResponseMessageSuccess = "success"
	HttpResponseMessageError   = "error"
)
View Source
const (
	MsgTypeGetLog        = "get-log"
	MsgTypeGetSystemInfo = "get-sys-info"
	MsgTypeCancelTask    = "cancel-task"
	MsgTypeRemoveLog     = "remove-log"
	MsgTypeRemoveSpider  = "remove-spider"
)
View Source
const (
	NodeStatusUnregistered = "u"
	NodeStatusRegistered   = "r"
	NodeStatusOnline       = "on"
	NodeStatusOffline      = "off"
)
View Source
const (
	NotificationTriggerOnTaskEnd   = "notification_trigger_on_task_end"
	NotificationTriggerOnTaskError = "notification_trigger_on_task_error"
	NotificationTriggerNever       = "notification_trigger_never"
)
View Source
const (
	NotificationTypeMail     = "notification_type_mail"
	NotificationTypeDingTalk = "notification_type_ding_talk"
	NotificationTypeWechat   = "notification_type_wechat"
)
View Source
const (
	PluginTypeApi  = "api"
	PluginTypeWeb  = "web"
	PluginTypeTask = "task"
)
View Source
const (
	PluginProtoGrpc = "grpc"
	PluginProtoHttp = "http"
)
View Source
const (
	PluginUIComponentTypeView = "view"
	PluginUIComponentTypeTab  = "tab"
)
View Source
const (
	PluginDeployModeMaster = "master"
	PluginDeployModeAll    = "all"
)
View Source
const (
	PluginInstallTypePublic = "public"
	PluginInstallTypeGit    = "git"
	PluginInstallTypeLocal  = "local"
)
View Source
const (
	PluginStatusInstalling   = "installing"
	PluginStatusInstallError = "install_error"
	PluginStatusStopped      = "stopped"
	PluginStatusRunning      = "running"
	PluginStatusError        = "error"
)
View Source
const (
	RegisterTypeMac        = "mac"
	RegisterTypeIp         = "ip"
	RegisterTypeHostname   = "hostname"
	RegisterTypeCustomName = "customName"
)
View Source
const (
	RpcInstallLang          = "install_lang"
	RpcInstallDep           = "install_dep"
	RpcUninstallDep         = "uninstall_dep"
	RpcGetInstalledDepList  = "get_installed_dep_list"
	RpcGetLang              = "get_lang"
	RpcCancelTask           = "cancel_task"
	RpcGetSystemInfoService = "get_system_info"
	RpcRemoveSpider         = "remove_spider"
)
View Source
const (
	ScheduleStatusStop    = "stopped"
	ScheduleStatusRunning = "running"
	ScheduleStatusError   = "error"

	ScheduleStatusErrorNotFoundNode   = "Not Found Node"
	ScheduleStatusErrorNotFoundSpider = "Not Found Spider"
)
View Source
const (
	SettingPlugin                = "plugin"
	SettingPluginBaseUrl         = "plugin_base_url"
	SettingPluginGithubPublicOrg = "github_public_org"
	SettingPluginRepoPrefix      = "repo_prefix"
)
View Source
const (
	DefaultSettingPluginBaseUrl         = "https://plugins.crawlab.cn"
	DefaultSettingPluginBaseUrlDocker   = "/app/plugins"
	DefaultSettingPluginBaseUrlGitHub   = "https://github.com"
	DefaultSettingPluginGithubPublicOrg = "crawlab-team"
	DefaultSettingPluginRepoPrefix      = "plugin-"
)
View Source
const (
	Customized   = "customized"
	Configurable = "configurable"
	Plugin       = "plugin"
)
View Source
const (
	Windows = "windows"
	Linux   = "linux"
	Darwin  = "darwin"
)
View Source
const (
	Python = "python"
	Nodejs = "node"
	Java   = "java"
)
View Source
const (
	InstallStatusNotInstalled    = "not-installed"
	InstallStatusInstalling      = "installing"
	InstallStatusInstallingOther = "installing-other"
	InstallStatusInstalled       = "installed"
)
View Source
const (
	LangTypeLang      = "lang"
	LangTypeWebDriver = "webdriver"
)
View Source
const (
	TaskStatusPending   = "pending"
	TaskStatusRunning   = "running"
	TaskStatusFinished  = "finished"
	TaskStatusError     = "error"
	TaskStatusCancelled = "cancelled"
	TaskStatusAbnormal  = "abnormal"
)
View Source
const (
	RunTypeAllNodes      = "all-nodes"
	RunTypeRandom        = "random"
	RunTypeSelectedNodes = "selected-nodes"
)
View Source
const (
	TaskTypeSpider = "spider"
	TaskTypeSystem = "system"
)
View Source
const (
	TaskListQueuePrefixPublic = "tasks:public"
	TaskListQueuePrefixNodes  = "tasks:nodes"
)
View Source
const (
	RoleAdmin  = "admin"
	RoleNormal = "normal"
)
View Source
const (
	DefaultAdminUsername = "admin"
	DefaultAdminPassword = "admin"
)
View Source
const (
	String  = "string"
	Number  = "number"
	Boolean = "boolean"
	Array   = "array"
	Object  = "object"
)
View Source
const (
	ColJob = "jobs"
)
View Source
const (
	ContextUser = "currentUser"
)
View Source
const (
	DataCollectionKey = "_col"
)
View Source
const (
	DefaultEncryptServerKey = "0123456789abcdef"
)
View Source
const (
	DefaultFilerAuthKey = "Crawlab2021!"
)
View Source
const EmptyFileData = " "
View Source
const (
	ErrorRegexPattern = "(?:[ :,.]|^)((?:error|exception|traceback)s?)(?:[ :,.]|$)"
)
View Source
const FsKeepFileName = ".gitkeep"
View Source
const (
	GrpcHeaderAuthorization = "authorization"
)
View Source
const (
	HttpContentTypeApplicationJson = "application/json"
)
View Source
const ScrapyProtectedFieldNames = "_id,task_id,ts"
View Source
const ScrapyProtectedStageNames = ""
View Source
const (
	SignalQuit = iota
)
View Source
const (
	SortQueryField = "sort"
)
View Source
const (
	TaskKey = "_tid"
)
View Source
const (
	UserContextKey = "user"
)

Variables

View Source
var (
	//ErrorMongoError                = e.NewSystemOPError(1001, "system error:[mongo]%s", http.StatusInternalServerError)
	//ErrorUserNotFound              = e.NewBusinessError(10001, "user not found.", http.StatusUnauthorized)
	//ErrorUsernameOrPasswordInvalid = e.NewBusinessError(11001, "username or password invalid", http.StatusUnauthorized)
	ErrAlreadyExists    = errors.New("already exists")
	ErrNotExists        = errors.New("not exists")
	ErrForbidden        = errors.New("forbidden")
	ErrInvalidOperation = errors.New("invalid operation")
	ErrInvalidOptions   = errors.New("invalid options")
	ErrNoTasksAvailable = errors.New("no tasks available")
	ErrInvalidType      = errors.New("invalid type")
	ErrInvalidSignal    = errors.New("invalid signal")
	ErrEmptyValue       = errors.New("empty value")
	ErrTaskError        = errors.New("task error")
	ErrTaskLost         = errors.New("task lost")
	ErrTaskCancelled    = errors.New("task cancelled")
	ErrUnableToCancel   = errors.New("unable to cancel")
	ErrUnableToDispose  = errors.New("unable to dispose")
	ErrAlreadyDisposed  = errors.New("already disposed")
	ErrStopped          = errors.New("stopped")
	ErrMissingCol       = errors.New("missing col")
	ErrInvalidValue     = errors.New("invalid value")
	ErrInvalidCronSpec  = errors.New("invalid cron spec")
)
View Source
var PaginationDefaultPage = 1
View Source
var PaginationDefaultSize = 10

Functions

This section is empty.

Types

type TaskSignal added in v0.6.0

type TaskSignal int
const (
	TaskSignalFinish TaskSignal = iota
	TaskSignalCancel
	TaskSignalError
	TaskSignalLost
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL