Documentation ¶
Index ¶
- func RunAllTests(t *testing.T, dsf DataStoreFunc, rp ResourceProvider)
- func RunAppsTest(t *testing.T, dsf DataStoreFunc, rp ResourceProvider)
- func RunFnsTest(t *testing.T, dsf DataStoreFunc, rp ResourceProvider)
- func RunTriggerBySourceTests(t *testing.T, dsf DataStoreFunc, rp ResourceProvider)
- func RunTriggersTest(t *testing.T, dsf DataStoreFunc, rp ResourceProvider)
- type AppByName
- type BasicResourceProvider
- func (brp *BasicResourceProvider) DefaultCtx() context.Context
- func (brp *BasicResourceProvider) NextID() uint32
- func (brp *BasicResourceProvider) ValidApp() *models.App
- func (brp *BasicResourceProvider) ValidFn(appId string) *models.Fn
- func (brp *BasicResourceProvider) ValidTrigger(appId, funcId string) *models.Trigger
- type DataStoreFunc
- type FnByName
- type Harness
- type ResourceProvider
- type TriggerByName
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunAllTests ¶
func RunAllTests(t *testing.T, dsf DataStoreFunc, rp ResourceProvider)
func RunAppsTest ¶
func RunAppsTest(t *testing.T, dsf DataStoreFunc, rp ResourceProvider)
func RunFnsTest ¶
func RunFnsTest(t *testing.T, dsf DataStoreFunc, rp ResourceProvider)
func RunTriggerBySourceTests ¶
func RunTriggerBySourceTests(t *testing.T, dsf DataStoreFunc, rp ResourceProvider)
func RunTriggersTest ¶
func RunTriggersTest(t *testing.T, dsf DataStoreFunc, rp ResourceProvider)
Types ¶
type BasicResourceProvider ¶
type BasicResourceProvider struct {
// contains filtered or unexported fields
}
BasicResourceProvider supplies simple objects and can be used as a base for custom resource providers
func (*BasicResourceProvider) DefaultCtx ¶
func (brp *BasicResourceProvider) DefaultCtx() context.Context
func (*BasicResourceProvider) NextID ¶
func (brp *BasicResourceProvider) NextID() uint32
func (*BasicResourceProvider) ValidApp ¶
func (brp *BasicResourceProvider) ValidApp() *models.App
Creates a valid app which always has a sequential named
func (*BasicResourceProvider) ValidFn ¶
func (brp *BasicResourceProvider) ValidFn(appId string) *models.Fn
func (*BasicResourceProvider) ValidTrigger ¶
func (brp *BasicResourceProvider) ValidTrigger(appId, funcId string) *models.Trigger
type DataStoreFunc ¶
DataStoreFunc provides an instance of a data store
type Harness ¶
type Harness struct {
// contains filtered or unexported fields
}
func (*Harness) AppForDeletion ¶
type ResourceProvider ¶
type ResourceProvider interface { // ValidApp returns a valid app to use for inserts ValidApp() *models.App // ValidFn returns a valid fn to use for inserts ValidFn(appId string) *models.Fn // ValidTrigger returns a valid trigger to use for inserts ValidTrigger(appId string, fnId string) *models.Trigger // DefaultCtx returns a context object (which may have custom attributes set) // this may be used (e.g.) to pass on tenancy and user details that would originate from a middleware to your data store DefaultCtx() context.Context }
ResourceProvider provides an abstraction for supplying data store tests with appropriate initial testing objects for running tests Use the resource calls to supply objects with (e.g.) middleware enforced annotations set on them Use DefaultCtx to override custom middleware-supplied context variables
func NewBasicResourceProvider ¶
func NewBasicResourceProvider() ResourceProvider
NewBasicResourceProvider creates a dumb resource provider that generates resources that have valid, random names (and other unique attributes)
type TriggerByName ¶
func (TriggerByName) Len ¶
func (f TriggerByName) Len() int
func (TriggerByName) Less ¶
func (f TriggerByName) Less(i, j int) bool
func (TriggerByName) Swap ¶
func (f TriggerByName) Swap(i, j int)