entity

package
v0.0.0-...-33f46c2 Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: Apache-2.0 Imports: 14 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 struct {
	Host string
	Port string
}

func NewAddress

func NewAddress(opts *AddressOptions) (res *Address)

func NewAddressFromString

func NewAddressFromString(address string) (res *Address, err error)

func (*Address) IsEmpty

func (a *Address) IsEmpty() (res bool)

func (*Address) String

func (a *Address) String() (res string)

func (*Address) Value

func (a *Address) Value() (res interface{})

type AddressOptions

type AddressOptions struct {
	Host string
	Port string
}

type BatchRequestPayload

type BatchRequestPayload struct {
	Ids []primitive.ObjectID `form:"ids" json:"ids"`
}

type BatchRequestPayloadWithStringData

type BatchRequestPayloadWithStringData struct {
	Ids    []primitive.ObjectID `form:"ids" json:"ids"`
	Data   string               `form:"data" json:"data"`
	Fields []string             `form:"fields" json:"fields"`
}

type Color

type Color struct {
	Name string `json:"name"`
	Hex  string `json:"hex"`
}

func (*Color) GetHex

func (c *Color) GetHex() string

func (*Color) GetName

func (c *Color) GetName() string

func (*Color) Value

func (c *Color) Value() interface{}

type Condition

type Condition struct {
	Key   string      `json:"key"`
	Op    string      `json:"op"`
	Value interface{} `json:"value"`
}

func (*Condition) GetKey

func (c *Condition) GetKey() (key string)

func (*Condition) GetOp

func (c *Condition) GetOp() (op string)

func (*Condition) GetValue

func (c *Condition) GetValue() (value interface{})

func (*Condition) SetKey

func (c *Condition) SetKey(key string)

func (*Condition) SetOp

func (c *Condition) SetOp(op string)

func (*Condition) SetValue

func (c *Condition) SetValue(value interface{})

type ConfigSpiderData

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     string            `yaml:"engine" json:"engine"`
	StartUrl   string            `yaml:"start_url" json:"start_url"`
	StartStage string            `yaml:"start_stage" json:"start_stage"`
	Stages     []Stage           `yaml:"stages" json:"stages"`
	Settings   map[string]string `yaml:"settings" json:"settings"`

	// 自定义爬虫
	Cmd string `yaml:"cmd" json:"cmd"`
}

type DataField

type DataField struct {
	Key  string `json:"key" bson:"key"`
	Type string `json:"type" bson:"type"`
}

type DocItem

type DocItem struct {
	Title    string    `json:"title"`
	Url      string    `json:"url"`
	Path     string    `json:"path"`
	Children []DocItem `json:"children"`
}

type ElasticsearchResponseData

type ElasticsearchResponseData struct {
	Took    int64 `json:"took"`
	Timeout bool  `json:"timeout"`
	Hits    struct {
		Total struct {
			Value    int64  `json:"value"`
			Relation string `json:"relation"`
		} `json:"total"`
		MaxScore float64 `json:"max_score"`
		Hits     []struct {
			Index  string      `json:"_index"`
			Id     string      `json:"_id"`
			Score  float64     `json:"_score"`
			Source interface{} `json:"_source"`
		} `json:"hits"`
	} `json:"hits"`
}

type EventData

type EventData struct {
	Event string
	Data  interface{}
}

func (*EventData) GetData

func (d *EventData) GetData() interface{}

func (*EventData) GetEvent

func (d *EventData) GetEvent() string

type Export

type Export struct {
	Id           string            `json:"id"`
	Type         string            `json:"type"`
	Target       string            `json:"target"`
	Filter       interfaces.Filter `json:"filter"`
	Status       string            `json:"status"`
	StartTs      time.Time         `json:"start_ts"`
	EndTs        time.Time         `json:"end_ts"`
	FileName     string            `json:"file_name"`
	DownloadPath string            `json:"-"`
	Limit        int               `json:"-"`
}

func (*Export) GetDownloadPath

func (e *Export) GetDownloadPath() string

func (*Export) GetEndTs

func (e *Export) GetEndTs() time.Time

func (*Export) GetFilter

func (e *Export) GetFilter() interfaces.Filter

func (*Export) GetId

func (e *Export) GetId() string

func (*Export) GetStartTs

func (e *Export) GetStartTs() time.Time

func (*Export) GetStatus

func (e *Export) GetStatus() string

func (*Export) GetTarget

func (e *Export) GetTarget() string

func (*Export) GetType

func (e *Export) GetType() string

type Field

type Field struct {
	Name      string `yaml:"name" json:"name"`
	Css       string `yaml:"css" json:"css"`
	Xpath     string `yaml:"xpath" json:"xpath"`
	Attr      string `yaml:"attr" json:"attr"`
	NextStage string `yaml:"next_stage" json:"next_stage"`
	Remark    string `yaml:"remark" json:"remark"`
}

type FileRequestPayload

type FileRequestPayload struct {
	Path    string `json:"path" form:"path"`
	NewPath string `json:"new_path" form:"new_path"`
	Data    string `json:"data" form:"data"`
}

type Filter

type Filter struct {
	IsOr       bool         `form:"is_or" url:"is_or"`
	Conditions []*Condition `json:"conditions"`
}

func (*Filter) GetConditions

func (f *Filter) GetConditions() (conditions []interfaces.FilterCondition)

func (*Filter) GetIsOr

func (f *Filter) GetIsOr() (isOr bool)

func (*Filter) IsNil

func (f *Filter) IsNil() (ok bool)

func (*Filter) SetConditions

func (f *Filter) SetConditions(conditions []interfaces.FilterCondition)

func (*Filter) SetIsOr

func (f *Filter) SetIsOr(isOr bool)

type FilterSelectOption

type FilterSelectOption struct {
	Value interface{} `json:"value" bson:"value"`
	Label string      `json:"label" bson:"label"`
}

type FsFileInfo

type FsFileInfo struct {
	Name      string                  `json:"name"`      // file name
	Path      string                  `json:"path"`      // file path
	FullPath  string                  `json:"full_path"` // file full path
	Extension string                  `json:"extension"` // file extension
	Md5       string                  `json:"md5"`       // MD5 hash
	IsDir     bool                    `json:"is_dir"`    // whether it is directory
	FileSize  int64                   `json:"file_size"` // file size (bytes)
	Children  []interfaces.FsFileInfo `json:"children"`  // children for sub-directory
}

func (*FsFileInfo) GetChildren

func (f *FsFileInfo) GetChildren() []interfaces.FsFileInfo

func (*FsFileInfo) GetExtension

func (f *FsFileInfo) GetExtension() string

func (*FsFileInfo) GetFileSize

func (f *FsFileInfo) GetFileSize() int64

func (*FsFileInfo) GetFullPath

func (f *FsFileInfo) GetFullPath() string

func (*FsFileInfo) GetIsDir

func (f *FsFileInfo) GetIsDir() bool

func (*FsFileInfo) GetMd5

func (f *FsFileInfo) GetMd5() string

func (*FsFileInfo) GetName

func (f *FsFileInfo) GetName() string

func (*FsFileInfo) GetPath

func (f *FsFileInfo) GetPath() string

type GitConfig

type GitConfig struct {
	Url string `json:"url" bson:"url"`
}

type GitPayload

type GitPayload struct {
	Paths         []string `json:"paths"`
	CommitMessage string   `json:"commit_message"`
	Branch        string   `json:"branch"`
	Tag           string   `json:"tag"`
}

type GrpcBaseServiceMessage

type GrpcBaseServiceMessage struct {
	ModelId interfaces.ModelId `json:"id"`
	Data    []byte             `json:"d"`
}

func (*GrpcBaseServiceMessage) GetData

func (msg *GrpcBaseServiceMessage) GetData() []byte

func (*GrpcBaseServiceMessage) GetModelId

func (msg *GrpcBaseServiceMessage) GetModelId() interfaces.ModelId

func (*GrpcBaseServiceMessage) ToBytes

func (msg *GrpcBaseServiceMessage) ToBytes() (data []byte)

type GrpcBaseServiceParams

type GrpcBaseServiceParams struct {
	Query       bson.M             `json:"q"`
	Id          primitive.ObjectID `json:"id"`
	Update      bson.M             `json:"u"`
	Doc         interfaces.Model   `json:"d"`
	Fields      []string           `json:"f"`
	FindOptions *mongo.FindOptions `json:"o"`
	Docs        []interface{}      `json:"dl"`
	User        interfaces.User    `json:"U"`
}

func (*GrpcBaseServiceParams) Value

func (params *GrpcBaseServiceParams) Value() interface{}

type GrpcDelegateMessage

type GrpcDelegateMessage struct {
	ModelId interfaces.ModelId             `json:"id"`
	Method  interfaces.ModelDelegateMethod `json:"m"`
	Data    []byte                         `json:"d"`
}

func (*GrpcDelegateMessage) GetData

func (msg *GrpcDelegateMessage) GetData() []byte

func (*GrpcDelegateMessage) GetMethod

func (*GrpcDelegateMessage) GetModelId

func (msg *GrpcDelegateMessage) GetModelId() interfaces.ModelId

func (*GrpcDelegateMessage) ToBytes

func (msg *GrpcDelegateMessage) ToBytes() (data []byte)

type GrpcEventServiceMessage

type GrpcEventServiceMessage struct {
	Type   string   `json:"type"`
	Events []string `json:"events"`
	Key    string   `json:"key"`
	Data   []byte   `json:"data"`
}

type GrpcSubscribe

type GrpcSubscribe struct {
	Stream   interfaces.GrpcStream
	Finished chan bool
}

func (*GrpcSubscribe) GetFinished

func (sub *GrpcSubscribe) GetFinished() chan bool

func (*GrpcSubscribe) GetStream

func (sub *GrpcSubscribe) GetStream() interfaces.GrpcStream

func (*GrpcSubscribe) GetStreamBidirectional

func (sub *GrpcSubscribe) GetStreamBidirectional() interfaces.GrpcStreamBidirectional

type ListRequestData

type ListRequestData struct {
	PageNum  int    `form:"page_num" json:"page_num"`
	PageSize int    `form:"page_size" json:"page_size"`
	SortKey  string `form:"sort_key" json:"sort_key"`
	Status   string `form:"status" json:"status"`
	Keyword  string `form:"keyword" json:"keyword"`
}

type ListResponse

type ListResponse struct {
	Status  string      `json:"status"`
	Message string      `json:"message"`
	Total   int         `json:"total"`
	Data    interface{} `json:"data"`
	Error   string      `json:"error"`
}

type ModelDelegate

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.User          `json:"u"`
}

type ModelInfo

type ModelInfo struct {
	Id      interfaces.ModelId
	ColName string
}

type NodeInfo

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_key"`
	MaxRunners  int    `json:"max_runners"`
}

func (NodeInfo) Value

func (n NodeInfo) Value() interface{}

type Page

type Page struct {
	Skip     int
	Limit    int
	PageNum  int
	PageSize int
}

func (*Page) GetPage

func (p *Page) GetPage(pageNum string, pageSize string)

type Pagination

type Pagination struct {
	Page int `form:"page" url:"page"`
	Size int `form:"size" url:"size"`
}

func (*Pagination) IsDefault

func (p *Pagination) IsDefault() (ok bool)

func (*Pagination) IsZero

func (p *Pagination) IsZero() (ok bool)

type PluginEventKey

type PluginEventKey struct {
	Include string `json:"include" bson:"include"`
	Exclude string `json:"exclude" bson:"exclude"`
}

type PluginSetting

type PluginSetting struct {
	PluginBaseUrl   string `json:"plugin_base_url"`
	GithubPublicOrg string `json:"github_public_org"`
	RepoPrefix      string `json:"repo_prefix"`
	GoProxy         string `json:"go_proxy"`
}

func NewPluginSetting

func NewPluginSetting(value bson.M) (ps PluginSetting)

func (*PluginSetting) Value

func (ps *PluginSetting) Value() (value bson.M)

type PluginSubStatus

type PluginSubStatus struct {
	NodeId primitive.ObjectID `json:"node_id" bson:"node_id"`
	Status string             `json:"status" bson:"status"`
	Pid    int                `json:"pid" bson:"pid"`
	Error  string             `json:"error" bson:"error"`
}

type PluginUIAsset

type PluginUIAsset struct {
	Path string `json:"path" bson:"path"`
	Type string `json:"type" bson:"type"`
}

type PluginUIComponent

type PluginUIComponent struct {
	Name        string   `json:"name" bson:"name"`
	Title       string   `json:"title" bson:"title"`
	Src         string   `json:"src" bson:"src"`
	Type        string   `json:"type" bson:"type"`
	Path        string   `json:"path" bson:"path"`
	ParentPaths []string `json:"parent_paths" bson:"parent_paths"`
}

type PluginUINav

type PluginUINav struct {
	Path     string        `json:"path" bson:"path"`
	Title    string        `json:"title" bson:"title"`
	Icon     []string      `json:"icon" bson:"icon"`
	Children []PluginUINav `json:"children,omitempty" bson:"children,omitempty"`
}

type PublicPlugin

type PublicPlugin struct {
	Id          int    `json:"id"`
	Name        string `json:"name"`
	FullName    string `json:"full_name"`
	Description string `json:"description"`
	HtmlUrl     string `json:"html_url"`
	PushedAt    string `json:"pushed_at"`
	CreatedAt   string `json:"created_at"`
	UpdatedAt   string `json:"updated_at"`
}

type Release

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

type ReleaseSlices []Release

func (ReleaseSlices) Len

func (r ReleaseSlices) Len() int

func (ReleaseSlices) Less

func (r ReleaseSlices) Less(i, j int) bool

func (ReleaseSlices) Swap

func (r ReleaseSlices) Swap(i, j int)

type Response

type Response struct {
	Status  string      `json:"status"`
	Message string      `json:"message"`
	Data    interface{} `json:"data"`
	Error   string      `json:"error"`
}

type Result

type Result map[string]interface{}

func (Result) Bytes

func (r Result) Bytes() (bytes []byte)

func (Result) DenormalizeObjectId

func (r Result) DenormalizeObjectId() (res Result)

func (Result) Flatten

func (r Result) Flatten() (res Result)

func (Result) GetTaskId

func (r Result) GetTaskId() (id primitive.ObjectID)

func (Result) GetValue

func (r Result) GetValue(key string) (value interface{})

func (Result) SetTaskId

func (r Result) SetTaskId(id primitive.ObjectID)

func (Result) SetValue

func (r Result) SetValue(key string, value interface{})

func (Result) String

func (r Result) String() (s string)

func (Result) ToJSON

func (r Result) ToJSON() (res Result)

func (Result) Value

func (r Result) Value() map[string]interface{}

type RpcMessage

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            `json:"result"`  // 结果
	Error   string            `json:"error"`   // 错误
}

type ScrapyItem

type ScrapyItem struct {
	Name   string   `json:"name"`
	Fields []string `json:"fields"`
}

type ScrapySettingParam

type ScrapySettingParam struct {
	Key   string      `json:"key"`
	Value interface{} `json:"value"`
	Type  string      `json:"type"`
}

type Sort

type Sort struct {
	Key       string `json:"key"`
	Direction string `json:"d"`
}

type SpiderType

type SpiderType struct {
	Type  string `json:"type" bson:"_id"`
	Count int    `json:"count" bson:"count"`
}

type Stage

type Stage struct {
	Name      string  `yaml:"name" json:"name"`
	IsList    bool    `yaml:"is_list" json:"is_list"`
	ListCss   string  `yaml:"list_css" json:"list_css"`
	ListXpath string  `yaml:"list_xpath" json:"list_xpath"`
	PageCss   string  `yaml:"page_css" json:"page_css"`
	PageXpath string  `yaml:"page_xpath" json:"page_xpath"`
	PageAttr  string  `yaml:"page_attr" json:"page_attr"`
	Fields    []Field `yaml:"fields" json:"fields"`
}

type StatsDailyItem

type StatsDailyItem struct {
	Date    string `json:"date" bson:"_id"`
	Tasks   int64  `json:"tasks" bson:"tasks"`
	Results int64  `json:"results" bson:"results"`
}

type StatsTasksByStatusItem

type StatsTasksByStatusItem struct {
	Status string `json:"status" bson:"_id"`
	Tasks  int64  `json:"tasks" bson:"tasks"`
}

type StreamMessageTaskData

type StreamMessageTaskData struct {
	TaskId  primitive.ObjectID `json:"task_id"`
	Records []Result           `json:"data"`
	Logs    []string           `json:"logs"`
}

type SystemInfo

type SystemInfo struct {
	Edition string `json:"edition"` // edition. e.g. community / pro
	Version string `json:"version"` // version. e.g. v0.6.0
}

type TTLMap

type TTLMap struct {
	TTL time.Duration
	// contains filtered or unexported fields
}

func NewTTLMap

func NewTTLMap(ttl time.Duration) (m *TTLMap)

func (*TTLMap) Load

func (t *TTLMap) Load(key string) (val interface{})

func (*TTLMap) Store

func (t *TTLMap) Store(key string, val interface{})

type TaskMessage

type TaskMessage struct {
	Id    primitive.ObjectID `json:"id"`
	Key   string             `json:"key"`
	Cmd   string             `json:"cmd"`
	Param string             `json:"param"`
}

func (*TaskMessage) ToString

func (m *TaskMessage) ToString() (string, error)

type TaskRunOptions

type TaskRunOptions struct {
}

type Translation

type Translation struct {
	Lang  string `json:"lang"`
	Key   string `json:"key"`
	Value string `json:"value"`
}

func (Translation) GetLang

func (t Translation) GetLang() (l string)

Jump to

Keyboard shortcuts

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