fleet/server/mock/datastore_carves.go
2021-06-25 21:46:51 -07:00

103 lines
2.8 KiB
Go

// Automatically generated by mockimpl. DO NOT EDIT!
package mock
import (
"time"
"github.com/fleetdm/fleet/v4/server/fleet"
)
var _ fleet.CarveStore = (*CarveStore)(nil)
type NewCarveFunc func(c *fleet.CarveMetadata) (*fleet.CarveMetadata, error)
type UpdateCarveFunc func(c *fleet.CarveMetadata) error
type CarveFunc func(carveId int64) (*fleet.CarveMetadata, error)
type ListCarvesFunc func(opt fleet.CarveListOptions) ([]*fleet.CarveMetadata, error)
type CarveBySessionIdFunc func(sessionId string) (*fleet.CarveMetadata, error)
type CarveByNameFunc func(name string) (*fleet.CarveMetadata, error)
type NewBlockFunc func(metadata *fleet.CarveMetadata, blockId int64, data []byte) error
type GetBlockFunc func(metadata *fleet.CarveMetadata, blockId int64) ([]byte, error)
type CleanupCarvesFunc func(now time.Time) (expired int, err error)
type CarveStore struct {
NewCarveFunc NewCarveFunc
NewCarveFuncInvoked bool
UpdateCarveFunc UpdateCarveFunc
UpdateCarveFuncInvoked bool
CarveFunc CarveFunc
CarveFuncInvoked bool
ListCarvesFunc ListCarvesFunc
ListCarvesFuncInvoked bool
CarveBySessionIdFunc CarveBySessionIdFunc
CarveBySessionIdFuncInvoked bool
CarveByNameFunc CarveByNameFunc
CarveByNameFuncInvoked bool
NewBlockFunc NewBlockFunc
NewBlockFuncInvoked bool
GetBlockFunc GetBlockFunc
GetBlockFuncInvoked bool
CleanupCarvesFunc CleanupCarvesFunc
CleanupCarvesFuncInvoked bool
}
func (s *CarveStore) NewCarve(c *fleet.CarveMetadata) (*fleet.CarveMetadata, error) {
s.NewCarveFuncInvoked = true
return s.NewCarveFunc(c)
}
func (s *CarveStore) UpdateCarve(c *fleet.CarveMetadata) error {
s.UpdateCarveFuncInvoked = true
return s.UpdateCarveFunc(c)
}
func (s *CarveStore) Carve(carveId int64) (*fleet.CarveMetadata, error) {
s.CarveFuncInvoked = true
return s.CarveFunc(carveId)
}
func (s *CarveStore) ListCarves(opt fleet.CarveListOptions) ([]*fleet.CarveMetadata, error) {
s.ListCarvesFuncInvoked = true
return s.ListCarvesFunc(opt)
}
func (s *CarveStore) CarveBySessionId(sessionId string) (*fleet.CarveMetadata, error) {
s.CarveBySessionIdFuncInvoked = true
return s.CarveBySessionIdFunc(sessionId)
}
func (s *CarveStore) CarveByName(name string) (*fleet.CarveMetadata, error) {
s.CarveByNameFuncInvoked = true
return s.CarveByNameFunc(name)
}
func (s *CarveStore) NewBlock(metadata *fleet.CarveMetadata, blockId int64, data []byte) error {
s.NewBlockFuncInvoked = true
return s.NewBlockFunc(metadata, blockId, data)
}
func (s *CarveStore) GetBlock(metadata *fleet.CarveMetadata, blockId int64) ([]byte, error) {
s.GetBlockFuncInvoked = true
return s.GetBlockFunc(metadata, blockId)
}
func (s *CarveStore) CleanupCarves(now time.Time) (expired int, err error) {
s.CleanupCarvesFuncInvoked = true
return s.CleanupCarvesFunc(now)
}