Documentation ¶
Index ¶
- Variables
- func CheckElasticConn() bool
- func GetAggregateLongResult(aggr types.Aggregate) (result map[string]int)
- func GetAggregateStringResult(aggr types.Aggregate) (result map[string]int)
- func GetElasticConfig() elasticsearch.Config
- func GetTypedClient() *elasticsearch.TypedClient
- func ImportAssetsFromFile(indexName string, filename string) bool
- func ImportDomainAssets(workspaceResult map[int]string)
- func ImportIpAssets(workspaceResult map[int]string)
- func ParseQuery(expr string) (query types.Query, err error)
- func SID(plainText string) string
- func SyncDomainAssets(workspaceId int, domains []db.Domain) bool
- func SyncIpAssets(workspaceId int, ips []db.Ip) bool
- type Assets
- func (a *Assets) Aggregation(query types.Query) (result map[string]map[string]int, err error)
- func (a *Assets) BulkIndexDoc(docs []Document) bool
- func (a *Assets) CheckDoc(docId string) bool
- func (a *Assets) CreateIndex() bool
- func (a *Assets) CreateIndexWithJsonMapping() bool
- func (a *Assets) DeleteDoc(docId string) (status bool)
- func (a *Assets) DeleteIndex() bool
- func (a *Assets) GetDoc(docId string) (doc Document, status bool)
- func (a *Assets) GetIndexMapping() *types.TypeMapping
- func (a *Assets) GetIndexMappingWithJson() string
- func (a *Assets) IndexDoc(doc Document) bool
- func (a *Assets) ListAllIndices() (indexInfo map[string]string)
- func (a *Assets) Search(query types.Query, page, rowsPerPage int) (res *search.Response, err error)
- type Document
Constants ¶
This section is empty.
Variables ¶
View Source
var ShowBulkIndexStatistic bool
Functions ¶
func GetAggregateLongResult ¶
GetAggregateLongResult 获取key为long(比如端口号)的聚合结果
func GetAggregateStringResult ¶
GetAggregateStringResult 获取key为string的聚合结果
func ImportAssetsFromFile ¶
ImportAssetsFromFile 导入JSON格式的资产数据
func ImportDomainAssets ¶
ImportDomainAssets 从mysql中导入指定workspace的Domain资产
func ImportIpAssets ¶
ImportIpAssets 从mysql中导入指定workspace的IP资产
func ParseQuery ¶
ParseQuery 将查询语法解析为elasticsearch的dsl语法
func SyncDomainAssets ¶
SyncDomainAssets 同步Domain资产到es
Types ¶
type Assets ¶
func (*Assets) Aggregation ¶
Aggregation 根据指定条件获取聚合数据
func (*Assets) BulkIndexDoc ¶
BulkIndexDoc 批量索文档
func (*Assets) CreateIndexWithJsonMapping ¶
func (*Assets) GetIndexMapping ¶
func (a *Assets) GetIndexMapping() *types.TypeMapping
GetIndexMapping 定义索引的mapping
func (*Assets) GetIndexMappingWithJson ¶
func (*Assets) ListAllIndices ¶
ListAllIndices 获取所有的可用索引
type Document ¶
type Document struct { Id string `json:"id"` Host string `json:"host"` Ip []string `json:"ip"` Port int `json:"port"` Domain string `json:"domain"` Location []string `json:"location"` Status int `json:"status"` Service string `json:"service"` Banner string `json:"banner"` Server string `json:"server"` Title string `json:"title"` Header string `json:"header"` Body string `json:"body"` Cert string `json:"cert"` IconHash int64 `json:"icon_hash"` Org string `json:"org"` Source []string `json:"source"` Comment string `json:"comment"` CreateTime time.Time `json:"create_time"` UpdateTime time.Time `json:"update_time"` }
Click to show internal directories.
Click to hide internal directories.