interfaces

package
v0.0.0-...-47094b8 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address interface {
	Entity
	String() string
	IsEmpty() bool
}

type DependencyInstallerService

type DependencyInstallerService interface {
	IsAutoInstallEnabled() (enabled bool)
	GetInstallDependencyRequirementsCmdBySpiderId(id primitive.ObjectID) (cmd *exec.Cmd, err error)
}

type Entity

type Entity interface {
	Value() interface{}
}

type Export

type Export interface {
	GetId() string
	GetType() string
	GetTarget() string
	GetFilter() Filter
	GetStatus() string
	GetStartTs() time.Time
	GetEndTs() time.Time
	GetDownloadPath() string
}

type ExportService

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)
}

type Filter

type Filter interface {
	GetIsOr() (isOr bool)
	SetIsOr(isOr bool)
	GetConditions() (conditions []FilterCondition)
	SetConditions(conditions []FilterCondition)
	IsNil() (ok bool)
}

type FilterCondition

type FilterCondition interface {
	GetKey() (key string)
	SetKey(key string)
	GetOp() (op string)
	SetOp(op string)
	GetValue() (value interface{})
	SetValue(value interface{})
}

type FsFileInfo

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
}

type FsService

type FsService 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 error)
	Delete(path string) (err error)
	Copy(path, newPath string) (err error)
	Export() (resultPath string, err error)
}

type Logger

type Logger interface {
	// Debug logs a debugging message.
	Debug(message string)

	// Info logs an informational message.
	Info(message string)

	// Warn logs a warning message.
	Warn(message string)

	// Error logs an error message.
	Error(message string)

	// Fatal logs a fatal message.
	Fatal(message string)

	// Debugf logs a formatted debugging message.
	Debugf(format string, args ...interface{})

	// Infof logs a formatted informational message.
	Infof(format string, args ...interface{})

	// Warnf logs a formatted warning message.
	Warnf(format string, args ...interface{})

	// Errorf logs a formatted error message.
	Errorf(format string, args ...interface{})

	// Fatalf logs a formatted fatal message.
	Fatalf(format string, args ...interface{})
}

Logger interface for reporting informational and warning messages.

type Model

type Model interface {
	GetId() (id primitive.ObjectID)
	SetId(id primitive.ObjectID)
	SetCreated(by primitive.ObjectID)
	SetUpdated(by primitive.ObjectID)
}

type Module

type Module interface {
	Start()
	Wait()
	Stop()
}

type ModuleId

type ModuleId int

type NodeConfigService

type NodeConfigService interface {
	Init() error
	Reload() error
	GetBasicNodeInfo() Entity
	GetNodeKey() string
	GetNodeName() string
	IsMaster() bool
	GetAuthKey() string
	GetMaxRunners() int
}

type NodeService

type NodeService interface {
	Module
}

type SpiderCloneOptions

type SpiderCloneOptions struct {
	Name string
}

type SpiderRunOptions

type SpiderRunOptions struct {
	Mode       string               `json:"mode"`
	NodeIds    []primitive.ObjectID `json:"node_ids"`
	Cmd        string               `json:"cmd"`
	Param      string               `json:"param"`
	ScheduleId primitive.ObjectID   `json:"schedule_id"`
	Priority   int                  `json:"priority"`
	UserId     primitive.ObjectID   `json:"-"`
}

type StatsService

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)
}

type TaskRunner

type TaskRunner interface {
	Init() (err error)
	Run() (err error)
	Cancel(force bool) (err error)
	SetSubscribeTimeout(timeout time.Duration)
	GetTaskId() (id primitive.ObjectID)
}

type WithConfigPath

type WithConfigPath interface {
	GetConfigPath() (path string)
	SetConfigPath(path string)
}

Jump to

Keyboard shortcuts

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