Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FetchResources ¶
func FetchStats ¶ added in v0.0.27
Types ¶
type FakeProvider ¶
type FakeProvider struct {
// ID is used for prefixes on resource types and identifiers
ID string
Foo FakeProviderResourceConfig
Bar FakeProviderResourceConfig
}
FakeProvider provides mechanisms to test systems that require providers Has facilities for variable resource counts, returning errors, and artificial delay
func (*FakeProvider) FetchFunctions ¶
func (p *FakeProvider) FetchFunctions() map[string]types.FetchFunc
func (*FakeProvider) Id ¶ added in v0.0.26
func (p *FakeProvider) Id() string
func (*FakeProvider) String ¶
func (p *FakeProvider) String() string
func (*FakeProvider) TotalRuns ¶
func (p *FakeProvider) TotalRuns() int
type FakeProviderResourceConfig ¶
type FakeProviderResourceConfig struct {
// Count is the number of resource returned by the fetch function
Count int
// ErrorAfterCount sets the error that the fetch function returns after sending the `Count` resources
ErrorAfterCount error
// DelayBefore sets a sleep duration before writing to the output channel
DelayBefore time.Duration
// contains filtered or unexported fields
}
FakeProviderResourceConfig stores configuration on a specific type for this fake provider
func (*FakeProviderResourceConfig) RunCount ¶
func (c *FakeProviderResourceConfig) RunCount() int
RunCount returns the number of completed runs the fetch function has made, even if it errors out. This is useful for determining when the fetch function has returned