fleet/server/kolide/scheduled_queries.go
Victor Vrantchan 71def50756 add missing logs to kolide service (#843)
Add logging middleware for more of the kolide Service interfaces. 
This PR was created through code generation, however it's not likely that the logging middleware can all be continuously regenerated - we're likely to want to add method specific key/values to individual methods. Moving forward, logging middleware should be maintained when changes are made to a service interface method.
2017-01-09 23:40:21 -05:00

38 lines
1.4 KiB
Go

package kolide
import (
"golang.org/x/net/context"
)
type ScheduledQueryStore interface {
NewScheduledQuery(sq *ScheduledQuery) (*ScheduledQuery, error)
SaveScheduledQuery(sq *ScheduledQuery) (*ScheduledQuery, error)
DeleteScheduledQuery(id uint) error
ScheduledQuery(id uint) (*ScheduledQuery, error)
ListScheduledQueriesInPack(id uint, opts ListOptions) ([]*ScheduledQuery, error)
}
type ScheduledQueryService interface {
GetScheduledQuery(ctx context.Context, id uint) (query *ScheduledQuery, err error)
GetScheduledQueriesInPack(ctx context.Context, id uint, opts ListOptions) (queries []*ScheduledQuery, err error)
ScheduleQuery(ctx context.Context, sq *ScheduledQuery) (query *ScheduledQuery, err error)
DeleteScheduledQuery(ctx context.Context, id uint) (err error)
ModifyScheduledQuery(ctx context.Context, sq *ScheduledQuery) (query *ScheduledQuery, err error)
}
type ScheduledQuery struct {
UpdateCreateTimestamps
DeleteFields
ID uint `json:"id"`
PackID uint `json:"pack_id" db:"pack_id"`
QueryID uint `json:"query_id" db:"query_id"`
Query string `json:"query"` // populated via a join on queries
Name string `json:"name"` // populated via a join on queries
Interval uint `json:"interval"`
Snapshot *bool `json:"snapshot"`
Removed *bool `json:"removed"`
Platform *string `json:"platform"`
Version *string `json:"version"`
Shard *uint `json:"shard"`
}