Documentation ¶
Index ¶
- func CreateFakeFileFromOSPipe(t *testing.T, errOnRead bool, errOnWrite bool) (r *FakeFile, w *FakeFile, err error)
- func CreateFakeFileFromOSPipeExtended(t *testing.T, rErrOnRead bool, rErrOnWrite bool, wErrOnRead bool, ...) (r *FakeFile, w *FakeFile, err 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) (n int, err error)
- func (f *FakeFile) ReadAt(b []byte, off int64) (n int, err error)
- func (f *FakeFile) ReadDir(n int) ([]fs.DirEntry, error)
- func (f *FakeFile) ReadFrom(r io.Reader) (n int64, err error)
- func (f *FakeFile) Readdir(n int) ([]fs.FileInfo, error)
- func (f *FakeFile) Readdirnames(n int) (names []string, err error)
- func (f *FakeFile) Seek(offset int64, whence int) (ret int64, err 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) (n int, err error)
- func (f *FakeFile) WriteAt(b []byte, off int64) (n int, err error)
- func (f *FakeFile) WriteString(s string) (n int, err error)
- func (f *FakeFile) WriteTo(w io.Writer) (n int64, err error)
- type FakeFileError
- type FakeIstioClientSet
- type FakeNetworkingV1beta1
- func (f *FakeNetworkingV1beta1) DestinationRules(namespace string) typedV1Beta1.DestinationRuleInterface
- func (f *FakeNetworkingV1beta1) Gateways(namespace string) typedV1Beta1.GatewayInterface
- func (f *FakeNetworkingV1beta1) ProxyConfigs(namespace string) typedV1Beta1.ProxyConfigInterface
- func (f *FakeNetworkingV1beta1) RESTClient() rest.Interface
- func (f *FakeNetworkingV1beta1) ServiceEntries(namespace string) typedV1Beta1.ServiceEntryInterface
- func (f *FakeNetworkingV1beta1) Sidecars(namespace string) typedV1Beta1.SidecarInterface
- func (f *FakeNetworkingV1beta1) VirtualServices(namespace string) typedV1Beta1.VirtualServiceInterface
- func (f *FakeNetworkingV1beta1) WorkloadEntries(namespace string) typedV1Beta1.WorkloadEntryInterface
- func (f *FakeNetworkingV1beta1) WorkloadGroups(namespace string) typedV1Beta1.WorkloadGroupInterface
- type FakeReaderWriter
- type FakeVirtualService
- func (f *FakeVirtualService) Apply(ctx context.Context, ...) (result *apisV1Beta1.VirtualService, err error)
- func (f *FakeVirtualService) ApplyStatus(ctx context.Context, ...) (result *apisV1Beta1.VirtualService, err error)
- func (f *FakeVirtualService) Create(ctx context.Context, virtualService *apisV1Beta1.VirtualService, ...) (*apisV1Beta1.VirtualService, error)
- func (f *FakeVirtualService) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
- func (f *FakeVirtualService) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
- func (f *FakeVirtualService) Get(ctx context.Context, name string, opts v1.GetOptions) (*apisV1Beta1.VirtualService, error)
- func (f *FakeVirtualService) List(ctx context.Context, opts v1.ListOptions) (*apisV1Beta1.VirtualServiceList, error)
- func (f *FakeVirtualService) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, ...) (*apisV1Beta1.VirtualService, error)
- func (f *FakeVirtualService) Update(ctx context.Context, virtualService *apisV1Beta1.VirtualService, ...) (*apisV1Beta1.VirtualService, error)
- func (f *FakeVirtualService) UpdateStatus(ctx context.Context, virtualService *apisV1Beta1.VirtualService, ...) (*apisV1Beta1.VirtualService, error)
- func (f *FakeVirtualService) Watch(ctx context.Context, opts 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) (r *FakeFile, w *FakeFile, err 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) (r *FakeFile, w *FakeFile, err 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
func NewFakeCommand ¶
func NewFakeCommand(name string, shouldFailToRun bool, args ...string) *bbUtilApiWrappers.Command
NewFakeCommand - create a new fake command
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) Readdirnames ¶
Readdirnames reads the directory names
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) 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(namespace string) typedV1Beta1.DestinationRuleInterface
DestinationRules returns nil
func (*FakeNetworkingV1beta1) Gateways ¶
func (f *FakeNetworkingV1beta1) Gateways(namespace string) typedV1Beta1.GatewayInterface
Gateways returns nil
func (*FakeNetworkingV1beta1) ProxyConfigs ¶
func (f *FakeNetworkingV1beta1) ProxyConfigs(namespace 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(namespace string) typedV1Beta1.ServiceEntryInterface
ServiceEntries returns nil
func (*FakeNetworkingV1beta1) Sidecars ¶
func (f *FakeNetworkingV1beta1) Sidecars(namespace string) typedV1Beta1.SidecarInterface
Sidecars returns nil
func (*FakeNetworkingV1beta1) VirtualServices ¶
func (f *FakeNetworkingV1beta1) VirtualServices(namespace string) typedV1Beta1.VirtualServiceInterface
VirtualServices returns nil
func (*FakeNetworkingV1beta1) WorkloadEntries ¶
func (f *FakeNetworkingV1beta1) WorkloadEntries(namespace string) typedV1Beta1.WorkloadEntryInterface
WorkloadEntries returns nil
func (*FakeNetworkingV1beta1) WorkloadGroups ¶
func (f *FakeNetworkingV1beta1) WorkloadGroups(namespace 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
type FakeVirtualService ¶
type FakeVirtualService struct { typedV1Beta1.VirtualServiceExpansion VirtualServicesList *apisV1Beta1.VirtualServiceList // contains filtered or unexported fields }
FakeVirtualService
func (*FakeVirtualService) Apply ¶
func (f *FakeVirtualService) Apply(ctx context.Context, virtualService *networkingV1Beta1.VirtualServiceApplyConfiguration, opts v1.ApplyOptions) (result *apisV1Beta1.VirtualService, err error)
Apply returns nil, nil
func (*FakeVirtualService) ApplyStatus ¶
func (f *FakeVirtualService) ApplyStatus(ctx context.Context, virtualService *networkingV1Beta1.VirtualServiceApplyConfiguration, opts v1.ApplyOptions) (result *apisV1Beta1.VirtualService, err error)
ApplyStatus returns nil, nil
func (*FakeVirtualService) Create ¶
func (f *FakeVirtualService) Create(ctx context.Context, virtualService *apisV1Beta1.VirtualService, opts v1.CreateOptions) (*apisV1Beta1.VirtualService, error)
Create returns nil, nil
func (*FakeVirtualService) Delete ¶
func (f *FakeVirtualService) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
Delete returns nil
func (*FakeVirtualService) DeleteCollection ¶
func (f *FakeVirtualService) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
DeleteCollection returns nil
func (*FakeVirtualService) Get ¶
func (f *FakeVirtualService) Get(ctx context.Context, name string, opts v1.GetOptions) (*apisV1Beta1.VirtualService, error)
Get returns nil, nil
func (*FakeVirtualService) List ¶
func (f *FakeVirtualService) List(ctx context.Context, opts v1.ListOptions) (*apisV1Beta1.VirtualServiceList, error)
List returns a list of virtual service resources
func (*FakeVirtualService) Patch ¶
func (f *FakeVirtualService) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, args ...string) (*apisV1Beta1.VirtualService, error)
Patch returns nil, nil
func (*FakeVirtualService) Update ¶
func (f *FakeVirtualService) Update(ctx context.Context, virtualService *apisV1Beta1.VirtualService, opts v1.UpdateOptions) (*apisV1Beta1.VirtualService, error)
Update returns nil, nil
func (*FakeVirtualService) UpdateStatus ¶
func (f *FakeVirtualService) UpdateStatus(ctx context.Context, virtualService *apisV1Beta1.VirtualService, opts v1.UpdateOptions) (*apisV1Beta1.VirtualService, error)
UpdateStatus returns nil, nil
func (*FakeVirtualService) Watch ¶
func (f *FakeVirtualService) Watch(ctx context.Context, opts 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