Documentation ¶
Index ¶
- type Config
- type Device
- type Discover
- func NewCreateSymlinksHook(logger *logrus.Logger, csvFiles []string, cfg *Config) (Discover, error)
- func NewFromCSVFile(logger *logrus.Logger, locators map[csv.MountSpecType]lookup.Locator, ...) (Discover, error)
- func NewFromCSVFiles(logger *logrus.Logger, files []string, root string) (Discover, error)
- func NewLDCacheUpdateHook(logger *logrus.Logger, mounts Discover, cfg *Config) (Discover, error)
- func NewLegacyDiscoverer(logger *logrus.Logger, cfg *Config) (Discover, error)
- func NewList(d ...Discover) Discover
- type DiscoverMock
- func (mock *DiscoverMock) Devices() ([]Device, error)
- func (mock *DiscoverMock) DevicesCalls() []struct{}
- func (mock *DiscoverMock) Hooks() ([]Hook, error)
- func (mock *DiscoverMock) HooksCalls() []struct{}
- func (mock *DiscoverMock) Mounts() ([]Mount, error)
- func (mock *DiscoverMock) MountsCalls() []struct{}
- type Hook
- type Mount
- type None
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Discover ¶
type Discover interface { Devices() ([]Device, error) Mounts() ([]Mount, error) Hooks() ([]Hook, error) }
Discover defines an interface for discovering the devices, mounts, and hooks available on a system
func NewCreateSymlinksHook ¶
NewCreateSymlinksHook creates a discoverer for a hook that creates required symlinks in the container
func NewFromCSVFile ¶
func NewFromCSVFile(logger *logrus.Logger, locators map[csv.MountSpecType]lookup.Locator, filename string) (Discover, error)
NewFromCSVFile creates a discoverer for the specified CSV file. A logger is also supplied. The constructed discoverer is comprised of a list, with each element in the list being associated with a particular MountSpecType.
func NewFromCSVFiles ¶
NewFromCSVFiles creates a discoverer for the specified CSV files. A logger is also supplied. The constructed discoverer is comprised of a list, with each element in the list being associated with a single CSV files.
func NewLDCacheUpdateHook ¶
NewLDCacheUpdateHook creates a discoverer that updates the ldcache for the specified mounts. A logger can also be specified
func NewLegacyDiscoverer ¶
NewLegacyDiscoverer creates a discoverer for the experimental runtime
type DiscoverMock ¶
type DiscoverMock struct { // DevicesFunc mocks the Devices method. DevicesFunc func() ([]Device, error) // HooksFunc mocks the Hooks method. HooksFunc func() ([]Hook, error) // MountsFunc mocks the Mounts method. MountsFunc func() ([]Mount, error) // contains filtered or unexported fields }
DiscoverMock is a mock implementation of Discover.
func TestSomethingThatUsesDiscover(t *testing.T) { // make and configure a mocked Discover mockedDiscover := &DiscoverMock{ DevicesFunc: func() ([]Device, error) { panic("mock out the Devices method") }, HooksFunc: func() ([]Hook, error) { panic("mock out the Hooks method") }, MountsFunc: func() ([]Mount, error) { panic("mock out the Mounts method") }, } // use mockedDiscover in code that requires Discover // and then make assertions. }
func (*DiscoverMock) Devices ¶
func (mock *DiscoverMock) Devices() ([]Device, error)
Devices calls DevicesFunc.
func (*DiscoverMock) DevicesCalls ¶
func (mock *DiscoverMock) DevicesCalls() []struct { }
DevicesCalls gets all the calls that were made to Devices. Check the length with:
len(mockedDiscover.DevicesCalls())
func (*DiscoverMock) Hooks ¶
func (mock *DiscoverMock) Hooks() ([]Hook, error)
Hooks calls HooksFunc.
func (*DiscoverMock) HooksCalls ¶
func (mock *DiscoverMock) HooksCalls() []struct { }
HooksCalls gets all the calls that were made to Hooks. Check the length with:
len(mockedDiscover.HooksCalls())
func (*DiscoverMock) Mounts ¶
func (mock *DiscoverMock) Mounts() ([]Mount, error)
Mounts calls MountsFunc.
func (*DiscoverMock) MountsCalls ¶
func (mock *DiscoverMock) MountsCalls() []struct { }
MountsCalls gets all the calls that were made to Mounts. Check the length with:
len(mockedDiscover.MountsCalls())