mock

package
v0.0.0-...-c5d597e Latest Latest
Warning

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

Go to latest
Published: May 9, 2020 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const JWT_SECRET = "abc"

Variables

View Source
var EmptyProfile = workerprofile.Profile{Attributes: filter.GroupedFilters{}}
View Source
var FakeFilter = filter.Filter{1, "Gender", "male"}
View Source
var FakeFilters = filter.Filters{FakeFilter}
View Source
var FakeProfile = workerprofile.Profile{
	ID:         58,
	WorkerID:   8,
	Birthdate:  "1982-08-05T00:00:00Z",
	City:       "Lake Verlashire",
	Locality:   "District of Columbia",
	Country:    "Netherlands",
	Attributes: FakeFilters.GroupByType(),
}

Functions

func GenerateJWT

func GenerateJWT(userID int) (string, error)

func Mysql

func Mysql() (*sql.DB, *sqlx.DB, sqlmock.Sqlmock)

Types

type FakeDB

type FakeDB struct{}

func (*FakeDB) Select

func (db *FakeDB) Select(dest interface{}, query string, args ...interface{}) error

type FakeStore

type FakeStore struct{}

func (*FakeStore) CreateFilter

func (s *FakeStore) CreateFilter(filter.Filter) (filter.Filter, error)

func (*FakeStore) CreateWorkerProfile

func (s *FakeStore) CreateWorkerProfile(wp workerprofile.NewProfile) (workerprofile.Profile, error)

func (*FakeStore) GetAllFilters

func (s *FakeStore) GetAllFilters(ids []int) (filter.Filters, error)

func (*FakeStore) GetWorkerEligibility

func (s *FakeStore) GetWorkerEligibility(workerID string) (filter.FilterWorker, []filter.FilterJob, error)

func (*FakeStore) GetWorkerProfile

func (s *FakeStore) GetWorkerProfile(workerID string) (workerprofile.Profile, error)

type MockContext

type MockContext struct{}

func (MockContext) Deadline

func (ctx MockContext) Deadline() (deadline time.Time, ok bool)

func (MockContext) Done

func (ctx MockContext) Done() <-chan struct{}

func (MockContext) Err

func (ctx MockContext) Err() error

func (MockContext) Value

func (ctx MockContext) Value(key interface{}) interface{}

Jump to

Keyboard shortcuts

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