partner

package
v0.0.0-...-c476a70 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2022 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplySchema

func ApplySchema(db *sql.DB) error

func FillLocation

func FillLocation(lat, lng string, l *Location) error

Types

type Location

type Location struct {
	Latitude  float64 `json:"latitude"`
	Longitude float64 `json:"longitude"`
}

type Partner

type Partner struct {
	ID              int64    `json:"id"`
	Rating          int      `json:"rating"`
	OperatingRadius int      `json:"operatingRadius"`
	Distance        int      `json:"distance"`
	Experiences     []string `json:"experiences"`
	Location        `json:"location"`
}

type PartnerRepo

type PartnerRepo struct {
	DB *sql.DB
}

func (PartnerRepo) BulkImport

func (ps PartnerRepo) BulkImport(partners []Partner) error

func (PartnerRepo) FindBestMatch

func (ps PartnerRepo) FindBestMatch(ctx context.Context, l Location, experience string) ([]Partner, error)

func (PartnerRepo) GetPartner

func (ps PartnerRepo) GetPartner(ctx context.Context, id int64) (*Partner, error)

type Repository

type Repository interface {
	BulkImport([]Partner) error
	FindBestMatch(ctx context.Context, loc Location, experience string) ([]Partner, error)
	GetPartner(context.Context, int64) (*Partner, error)
}

func NewPartnerRepo

func NewPartnerRepo() (Repository, error)

Jump to

Keyboard shortcuts

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