mirror of https://github.com/knative/func.git
24 lines
386 B
Go
24 lines
386 B
Go
package mock
|
|
|
|
import (
|
|
"context"
|
|
|
|
fn "knative.dev/kn-plugin-func"
|
|
)
|
|
|
|
type Lister struct {
|
|
ListInvoked bool
|
|
ListFn func() ([]fn.ListItem, error)
|
|
}
|
|
|
|
func NewLister() *Lister {
|
|
return &Lister{
|
|
ListFn: func() ([]fn.ListItem, error) { return []fn.ListItem{}, nil },
|
|
}
|
|
}
|
|
|
|
func (l *Lister) List(context.Context) ([]fn.ListItem, error) {
|
|
l.ListInvoked = true
|
|
return l.ListFn()
|
|
}
|