constants

package
v0.6.0-beta.20210715 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2021 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 (
	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 (
	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 (
	DefaultGrpcServerHost       = "0.0.0.0"
	DefaultGrpcServerPort       = "9666"
	DefaultGrpcClientRemoteHost = "localhost"
	DefaultGrpcClientRemotePort = DefaultGrpcServerPort
	DefaultGrpcAuthKey          = "Crawlab2021!"
)
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 (
	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 (
	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"
)
View Source
const (
	TaskFinish = "finish"
	TaskCancel = "cancel"
)
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 (
	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 ScrapyProtectedFieldNames = "_id,task_id,ts"
View Source
const ScrapyProtectedStageNames = ""
View Source
const (
	SignalQuit = iota
)
View Source
const (
	SortQueryField = "sort"
)
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