aur.go 340 B

123456789101112131415161718192021
  1. package mock
  2. import (
  3. "context"
  4. "github.com/Jguer/aur"
  5. )
  6. type GetFunc func(ctx context.Context, query *aur.Query) ([]aur.Pkg, error)
  7. type MockAUR struct {
  8. GetFn GetFunc
  9. }
  10. func (m *MockAUR) Get(ctx context.Context, query *aur.Query) ([]aur.Pkg, error) {
  11. if m.GetFn != nil {
  12. return m.GetFn(ctx, query)
  13. }
  14. panic("implement me")
  15. }