mirror of
https://github.com/empayre/fleet.git
synced 2024-11-07 01:15:22 +00:00
32 lines
725 B
Go
32 lines
725 B
Go
package kolide
|
|
|
|
import (
|
|
"golang.org/x/net/context"
|
|
)
|
|
|
|
type TargetSearchResults struct {
|
|
Hosts []Host
|
|
Labels []Label
|
|
}
|
|
|
|
type TargetService interface {
|
|
// SearchTargets will accept a search query, a slice of IDs of hosts to omit,
|
|
// and a slice of IDs of labels to omit, and it will return a set of targets
|
|
// (hosts and label) which match the supplied search query.
|
|
SearchTargets(ctx context.Context, query string, selectedHostIDs []uint, selectedLabelIDs []uint) (*TargetSearchResults, error)
|
|
|
|
CountHostsInTargets(ctx context.Context, hosts []uint, labels []uint) (uint, error)
|
|
}
|
|
|
|
type TargetType int
|
|
|
|
const (
|
|
TargetLabel TargetType = iota
|
|
TargetHost
|
|
)
|
|
|
|
type Target struct {
|
|
Type TargetType
|
|
TargetID uint
|
|
}
|