fleet/server/mock/datastore_installers.go
Roberto Dip 8acf14ab43
adjust installers endpoint to avoid AJAX downloads (#7226)
Related to #7206, this delegates the handling of the download to the browser
2022-08-16 12:54:41 -03:00

45 lines
1.1 KiB
Go

// Automatically generated by mockimpl. DO NOT EDIT!
package mock
import (
"context"
"io"
"github.com/fleetdm/fleet/v4/server/fleet"
)
var _ fleet.InstallerStore = (*InstallerStore)(nil)
type GetFunc func(ctx context.Context, installer fleet.Installer) (io.ReadCloser, int64, error)
type PutFunc func(ctx context.Context, installer fleet.Installer) (string, error)
type ExistsFunc func(ctx context.Context, installer fleet.Installer) (bool, error)
type InstallerStore struct {
GetFunc GetFunc
GetFuncInvoked bool
PutFunc PutFunc
PutFuncInvoked bool
ExistsFunc ExistsFunc
ExistsFuncInvoked bool
}
func (s *InstallerStore) Get(ctx context.Context, installer fleet.Installer) (io.ReadCloser, int64, error) {
s.GetFuncInvoked = true
return s.GetFunc(ctx, installer)
}
func (s *InstallerStore) Put(ctx context.Context, installer fleet.Installer) (string, error) {
s.PutFuncInvoked = true
return s.PutFunc(ctx, installer)
}
func (s *InstallerStore) Exists(ctx context.Context, installer fleet.Installer) (bool, error) {
s.ExistsFuncInvoked = true
return s.ExistsFunc(ctx, installer)
}