Documentation
¶
Index ¶
- func CreateFakeFileFromOSPipe(t *testing.T, errOnRead bool, errOnWrite bool) (*FakeFile, *FakeFile, error)
- func CreateFakeFileFromOSPipeExtended(t *testing.T, rErrOnRead bool, rErrOnWrite bool, wErrOnRead bool, ...) (*FakeFile, *FakeFile, error)
- func NewFakeCommand(name string, shouldFailToRun bool, args ...string) *bbUtilApiWrappers.Command
- type FakeCommandRunner
- type FakeFile
- func (f *FakeFile) Chdir() error
- func (f *FakeFile) Chmod(mode fs.FileMode) error
- func (f *FakeFile) Chown(uid int, gid int) error
- func (f *FakeFile) Close() error
- func (f *FakeFile) Fd() uintptr
- func (f *FakeFile) Name() string
- func (f *FakeFile) Read(b []byte) (int, error)
- func (f *FakeFile) ReadAt(b []byte, off int64) (int, error)
- func (f *FakeFile) ReadDir(n int) ([]fs.DirEntry, error)
- func (f *FakeFile) ReadFrom(r io.Reader) (int64, error)
- func (f *FakeFile) Readdir(n int) ([]fs.FileInfo, error)
- func (f *FakeFile) Readdirnames(n int) ([]string, error)
- func (f *FakeFile) Seek(offset int64, whence int) (int64, error)
- func (f *FakeFile) SetDeadline(t time.Time) error
- func (f *FakeFile) SetReadDeadline(t time.Time) error
- func (f *FakeFile) SetWriteDeadline(t time.Time) error
- func (f *FakeFile) Stat() (fs.FileInfo, error)
- func (f *FakeFile) Sync() error
- func (f *FakeFile) SyscallConn() (syscall.RawConn, error)
- func (f *FakeFile) Truncate(size int64) error
- func (f *FakeFile) Write(b []byte) (int, error)
- func (f *FakeFile) WriteAt(b []byte, off int64) (int, error)
- func (f *FakeFile) WriteString(s string) (int, error)
- func (f *FakeFile) WriteTo(w io.Writer) (int64, error)
- type FakeFileError
- type FakeIstioClientSet
- type FakeNetworkingV1beta1
- func (f *FakeNetworkingV1beta1) DestinationRules(_ string) typedV1Beta1.DestinationRuleInterface
- func (f *FakeNetworkingV1beta1) Gateways(_ string) typedV1Beta1.GatewayInterface
- func (f *FakeNetworkingV1beta1) ProxyConfigs(_ string) typedV1Beta1.ProxyConfigInterface
- func (f *FakeNetworkingV1beta1) RESTClient() rest.Interface
- func (f *FakeNetworkingV1beta1) ServiceEntries(_ string) typedV1Beta1.ServiceEntryInterface
- func (f *FakeNetworkingV1beta1) Sidecars(_ string) typedV1Beta1.SidecarInterface
- func (f *FakeNetworkingV1beta1) VirtualServices(_ string) typedV1Beta1.VirtualServiceInterface
- func (f *FakeNetworkingV1beta1) WorkloadEntries(_ string) typedV1Beta1.WorkloadEntryInterface
- func (f *FakeNetworkingV1beta1) WorkloadGroups(_ string) typedV1Beta1.WorkloadGroupInterface
- type FakeReaderWriter
- type FakeVirtualService
- func (f *FakeVirtualService) Apply(_ context.Context, _ *networkingV1Beta1.VirtualServiceApplyConfiguration, ...) (*apisV1Beta1.VirtualService, error)
- func (f *FakeVirtualService) ApplyStatus(_ context.Context, _ *networkingV1Beta1.VirtualServiceApplyConfiguration, ...) (*apisV1Beta1.VirtualService, error)
- func (f *FakeVirtualService) Create(_ context.Context, _ *apisV1Beta1.VirtualService, _ v1.CreateOptions) (*apisV1Beta1.VirtualService, error)
- func (f *FakeVirtualService) Delete(_ context.Context, _ string, _ v1.DeleteOptions) error
- func (f *FakeVirtualService) DeleteCollection(_ context.Context, _ v1.DeleteOptions, _ v1.ListOptions) error
- func (f *FakeVirtualService) Get(_ context.Context, _ string, _ v1.GetOptions) (*apisV1Beta1.VirtualService, error)
- func (f *FakeVirtualService) List(_ context.Context, _ v1.ListOptions) (*apisV1Beta1.VirtualServiceList, error)
- func (f *FakeVirtualService) Patch(_ context.Context, _ string, _ types.PatchType, _ []byte, _ v1.PatchOptions, ...) (*apisV1Beta1.VirtualService, error)
- func (f *FakeVirtualService) Update(_ context.Context, _ *apisV1Beta1.VirtualService, _ v1.UpdateOptions) (*apisV1Beta1.VirtualService, error)
- func (f *FakeVirtualService) UpdateStatus(_ context.Context, _ *apisV1Beta1.VirtualService, _ v1.UpdateOptions) (*apisV1Beta1.VirtualService, error)
- func (f *FakeVirtualService) Watch(_ context.Context, _ v1.ListOptions) (watch.Interface, error)
- type FakeWriterError
- type ReaderWriter
- type SetFail
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateFakeFileFromOSPipe ¶
func CreateFakeFileFromOSPipe(t *testing.T, errOnRead bool, errOnWrite bool) (*FakeFile, *FakeFile, error)
CreateFakeFileFromOSPipe creates a new FakeFile instance from a call to os.Pipe() the failOnRead and failOnWrite parameters determine if the file should error on read or write r will only error on read, w will only error on write (even if you set both to fail)
If you need to test both see CreateFakeFileFromOSPipeExtended
func CreateFakeFileFromOSPipeExtended ¶
func CreateFakeFileFromOSPipeExtended(t *testing.T, rErrOnRead bool, rErrOnWrite bool, wErrOnRead bool, wErrOnWrite bool) (*FakeFile, *FakeFile, error)
CreateFakeFileFromOSPipeExtended creates a new FakeFile instance from a call to os.Pipe() the failOnRead and failOnWrite parameters determine if the file should error on read or write
Types ¶
type FakeCommandRunner ¶
type FakeCommandRunner struct {
// contains filtered or unexported fields
}
FakeCommandRunner - a fake command runner
func (*FakeCommandRunner) Run ¶
func (c *FakeCommandRunner) Run() error
func (*FakeCommandRunner) SetStderr ¶
func (c *FakeCommandRunner) SetStderr(writer io.Writer)
SetStderr - set the stderr for the command and the underlying runner, if applicable
func (*FakeCommandRunner) SetStdin ¶
func (c *FakeCommandRunner) SetStdin(reader io.Reader)
SetStdin - set the stdin for the command and the underlying runner, if applicable
func (*FakeCommandRunner) SetStdout ¶
func (c *FakeCommandRunner) SetStdout(writer io.Writer)
SetStdout - set the stdout for the command and the underlying runner, if applicable
type FakeFile ¶
type FakeFile struct { File commonInterfaces.FileLike SetFail struct { Chdir bool Chmod bool Chown bool Close bool Fd bool Name bool Read bool ReadAt bool ReadDir bool ReadFrom bool Readdir bool Readdirnames bool Seek bool SetDeadline bool SetReadDeadline bool SetWriteDeadline bool Stat bool Sync bool SyscallConn bool Truncate bool Write bool WriteAt bool WriteString bool WriteTo bool } // contains filtered or unexported fields }
FakeFile is a fake implementation of os.File that can be used for testing purposes
func CreateFakeFileFromFileLike ¶
func CreateFakeFileFromFileLike(t *testing.T, shouldErrorOnRead bool, shouldErrorOnWrite bool, actualFile commonInterfaces.FileLike) (*FakeFile, error)
CreateFakeFileFromFileLike creates a new FakeFile instance from an existing FileLike (e.g. os.File)
func (*FakeFile) Chdir ¶
Write writes the given byte slice to the file
func (*FakeFile) Chmod ¶
Chmod changes the mode of the file
func (*FakeFile) Chown ¶
Chown changes the owner and group of the file
func (*FakeFile) Read ¶
Read reads the given byte slice from the file
func (*FakeFile) ReadAt ¶
ReadAt reads the given byte slice from the file at the given offset
func (*FakeFile) ReadDir ¶
ReadDir reads the directory
func (*FakeFile) ReadFrom ¶
ReadFrom reads from the given reader
func (*FakeFile) Readdir ¶
Readdir reads the directory
func (*FakeFile) Readdirnames ¶
Readdirnames reads the directory names
func (*FakeFile) Seek ¶
Seek seeks to the given offset
func (*FakeFile) SetDeadline ¶
SetDeadline sets the deadline
func (*FakeFile) SetReadDeadline ¶
SetReadDeadline sets the read deadline
func (*FakeFile) SetWriteDeadline ¶
SetWriteDeadline sets the write deadline
func (*FakeFile) SyscallConn ¶
SyscallConn returns the raw connection
func (*FakeFile) Truncate ¶
Truncate truncates the file
func (*FakeFile) Write ¶
Write writes the given byte slice to the file
func (*FakeFile) WriteAt ¶
WriteAt writes the given byte slice to the file at the given offset
func (*FakeFile) WriteString ¶
WriteString writes the given string to the file
type FakeFileError ¶
type FakeFileError struct {
// contains filtered or unexported fields
}
FakeFileError is an error that is returned when the FakeFile is intentionally errored
func (*FakeFileError) Error ¶
func (f *FakeFileError) Error() string
Error returns the error message string
type FakeIstioClientSet ¶
type FakeIstioClientSet struct { VirtualServicesList *apisV1Beta1.VirtualServiceList // contains filtered or unexported fields }
FakeIstioClientSet
func NewFakeIstioClientSet ¶
func NewFakeIstioClientSet(vsList *apisV1Beta1.VirtualServiceList, sf SetFail) *FakeIstioClientSet
NewFakeIstioClientSet intializes and returns a new FakeIstioClientSet
func (*FakeIstioClientSet) NetworkingV1beta1 ¶
func (f *FakeIstioClientSet) NetworkingV1beta1() typedV1Beta1.NetworkingV1beta1Interface
NetworkingV1beta1 intializes and returns a new FakeNetworkingV1beta1 object containing the configured list of virtual services
type FakeNetworkingV1beta1 ¶
type FakeNetworkingV1beta1 struct { DestinationRulesGetter typedV1Beta1.DestinationRulesGetter GatewaysGetter typedV1Beta1.GatewaysGetter ProxyConfigsGetter typedV1Beta1.ProxyConfigsGetter ServiceEntriesGetter typedV1Beta1.ServiceEntriesGetter SidecarsGetter typedV1Beta1.SidecarsGetter VirtualServicesGetter typedV1Beta1.VirtualServicesGetter WorkloadEntriesGetter typedV1Beta1.WorkloadEntriesGetter WorkloadGroupsGetter typedV1Beta1.WorkloadGroupsGetter VirtualServicesList *apisV1Beta1.VirtualServiceList // contains filtered or unexported fields }
FakeNetworkingV1beta1
func (*FakeNetworkingV1beta1) DestinationRules ¶
func (f *FakeNetworkingV1beta1) DestinationRules(_ string) typedV1Beta1.DestinationRuleInterface
DestinationRules returns nil
func (*FakeNetworkingV1beta1) Gateways ¶
func (f *FakeNetworkingV1beta1) Gateways(_ string) typedV1Beta1.GatewayInterface
Gateways returns nil
func (*FakeNetworkingV1beta1) ProxyConfigs ¶
func (f *FakeNetworkingV1beta1) ProxyConfigs(_ string) typedV1Beta1.ProxyConfigInterface
ProxyConfigs returns nil
func (*FakeNetworkingV1beta1) RESTClient ¶
func (f *FakeNetworkingV1beta1) RESTClient() rest.Interface
RESTClient returns nil
func (*FakeNetworkingV1beta1) ServiceEntries ¶
func (f *FakeNetworkingV1beta1) ServiceEntries(_ string) typedV1Beta1.ServiceEntryInterface
ServiceEntries returns nil
func (*FakeNetworkingV1beta1) Sidecars ¶
func (f *FakeNetworkingV1beta1) Sidecars(_ string) typedV1Beta1.SidecarInterface
Sidecars returns nil
func (*FakeNetworkingV1beta1) VirtualServices ¶
func (f *FakeNetworkingV1beta1) VirtualServices(_ string) typedV1Beta1.VirtualServiceInterface
VirtualServices returns nil
func (*FakeNetworkingV1beta1) WorkloadEntries ¶
func (f *FakeNetworkingV1beta1) WorkloadEntries(_ string) typedV1Beta1.WorkloadEntryInterface
WorkloadEntries returns nil
func (*FakeNetworkingV1beta1) WorkloadGroups ¶
func (f *FakeNetworkingV1beta1) WorkloadGroups(_ string) typedV1Beta1.WorkloadGroupInterface
WorkloadGroups returns nil
type FakeReaderWriter ¶
type FakeReaderWriter struct { ActualBuffer ReaderWriter // contains filtered or unexported fields }
FakeReaderWriter is a fake implementation of io.Writer that can be used for testing purposes
func CreateFakeReaderWriter ¶
func CreateFakeReaderWriter(t *testing.T, shouldErrorOnRead bool, shouldErrorOnWrite bool) *FakeReaderWriter
CreateFakeReaderWriter creates a new FakeReaderWriter instance with a backing &bytes.Buffer
func CreateFakeWriterFromReaderWriter ¶
func CreateFakeWriterFromReaderWriter(t *testing.T, shouldErrorOnRead bool, shouldErrorOnWrite bool, actualBuffer ReaderWriter) *FakeReaderWriter
CreateFakeWriterFromReaderWriter creates a new FakeReaderWriter instance from an existing ReaderWriter
func (*FakeReaderWriter) Read ¶
func (f *FakeReaderWriter) Read(p []byte) (int, error)
Read reads the given byte slice from the buffer
func (*FakeReaderWriter) Write ¶
func (f *FakeReaderWriter) Write(p []byte) (int, error)
Write writes the given byte slice to the buffer
type FakeVirtualService ¶
type FakeVirtualService struct { typedV1Beta1.VirtualServiceExpansion VirtualServicesList *apisV1Beta1.VirtualServiceList // contains filtered or unexported fields }
FakeVirtualService
func (*FakeVirtualService) Apply ¶
func (f *FakeVirtualService) Apply(_ context.Context, _ *networkingV1Beta1.VirtualServiceApplyConfiguration, _ v1.ApplyOptions) (*apisV1Beta1.VirtualService, error)
Apply returns nil, nil
func (*FakeVirtualService) ApplyStatus ¶
func (f *FakeVirtualService) ApplyStatus(_ context.Context, _ *networkingV1Beta1.VirtualServiceApplyConfiguration, _ v1.ApplyOptions) (*apisV1Beta1.VirtualService, error)
ApplyStatus returns nil, nil
func (*FakeVirtualService) Create ¶
func (f *FakeVirtualService) Create(_ context.Context, _ *apisV1Beta1.VirtualService, _ v1.CreateOptions) (*apisV1Beta1.VirtualService, error)
Create returns nil, nil
func (*FakeVirtualService) Delete ¶
func (f *FakeVirtualService) Delete(_ context.Context, _ string, _ v1.DeleteOptions) error
Delete returns nil
func (*FakeVirtualService) DeleteCollection ¶
func (f *FakeVirtualService) DeleteCollection(_ context.Context, _ v1.DeleteOptions, _ v1.ListOptions) error
DeleteCollection returns nil
func (*FakeVirtualService) Get ¶
func (f *FakeVirtualService) Get(_ context.Context, _ string, _ v1.GetOptions) (*apisV1Beta1.VirtualService, error)
Get returns nil, nil
func (*FakeVirtualService) List ¶
func (f *FakeVirtualService) List(_ context.Context, _ v1.ListOptions) (*apisV1Beta1.VirtualServiceList, error)
List returns a list of virtual service resources
func (*FakeVirtualService) Patch ¶
func (f *FakeVirtualService) Patch(_ context.Context, _ string, _ types.PatchType, _ []byte, _ v1.PatchOptions, _ ...string) (*apisV1Beta1.VirtualService, error)
Patch returns nil, nil
func (*FakeVirtualService) Update ¶
func (f *FakeVirtualService) Update(_ context.Context, _ *apisV1Beta1.VirtualService, _ v1.UpdateOptions) (*apisV1Beta1.VirtualService, error)
Update returns nil, nil
func (*FakeVirtualService) UpdateStatus ¶
func (f *FakeVirtualService) UpdateStatus(_ context.Context, _ *apisV1Beta1.VirtualService, _ v1.UpdateOptions) (*apisV1Beta1.VirtualService, error)
UpdateStatus returns nil, nil
func (*FakeVirtualService) Watch ¶
func (f *FakeVirtualService) Watch(_ context.Context, _ v1.ListOptions) (watch.Interface, error)
Watch returns nil, nil
type FakeWriterError ¶
type FakeWriterError struct {
// contains filtered or unexported fields
}
FakeWriterError is an error that is returned when the FakeWriter is intentionally errored
func (*FakeWriterError) Error ¶
func (f *FakeWriterError) Error() string
Error returns the error message string
type ReaderWriter ¶
ReaderWriter is an interface that combines the io.Reader and io.Writer interfaces