fleet/server/mock/datastore_installers.go
Roberto Dip edc0324ac0
update mockimpl version to allow concurrent mock calls (#9989)
this uses the associated new version in our fork

ecbb3041ea

to allow for concurrent access to mocks
2023-02-21 16:36:06 -03:00

54 lines
1.2 KiB
Go

// Automatically generated by mockimpl. DO NOT EDIT!
package mock
import (
"context"
"io"
"sync"
"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
mu sync.Mutex
}
func (s *InstallerStore) Get(ctx context.Context, installer fleet.Installer) (io.ReadCloser, int64, error) {
s.mu.Lock()
s.GetFuncInvoked = true
s.mu.Unlock()
return s.GetFunc(ctx, installer)
}
func (s *InstallerStore) Put(ctx context.Context, installer fleet.Installer) (string, error) {
s.mu.Lock()
s.PutFuncInvoked = true
s.mu.Unlock()
return s.PutFunc(ctx, installer)
}
func (s *InstallerStore) Exists(ctx context.Context, installer fleet.Installer) (bool, error) {
s.mu.Lock()
s.ExistsFuncInvoked = true
s.mu.Unlock()
return s.ExistsFunc(ctx, installer)
}