fake

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 24, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FactoryFunc

func FactoryFunc(sp *SimpleProvider) provider.FactoryFunc

FactoryFunc is used to register the factory in a given test so we can use it to test provider calls.

Types

type SimpleProvider

type SimpleProvider struct {
	CreateFunc  func(v1alpha1.MonitorTemplateSpec) (string, error)
	CreateCount int

	DeleteFunc  func(string) error
	DeleteCount int

	UpdateFunc  func(string, v1alpha1.MonitorTemplateSpec) (string, error)
	UpdateCount int
}

SimpleProvider represents a provider which is useful for testing purposes.

func (*SimpleProvider) Create

Create calls the specified CreateFunc in the SimpleProvider.

func (*SimpleProvider) Delete

func (fp *SimpleProvider) Delete(id string) error

Delete calls the specified DeleteFunc in the SimpleProvider.

func (*SimpleProvider) Update

Update calls the specified UpdateFunc in the SimpleProvider.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL