employee

package
v0.0.0-...-bfd7f69 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeHttpHandler

func MakeHttpHandler(s Service) http.Handler

Types

type Employee

type Employee struct {
	ID            int    `json:"id"`
	LastName      string `json:"lastName"`
	FirstName     string `json:"firstName"`
	Company       string `json:"company"`
	EmailAddress  string `json:"emailAddress"`
	JobTitle      string `json:"jobTitle"`
	BusinessPhone string `json:"businessPhone"`
	HomePhone     string `json:"homePhone"`
	MobilePhone   string `json:"mobilePhone"`
	FaxNumber     string `json:"faxNumber"`
	Address       string `json:"address"`
}

type EmployeeList

type EmployeeList struct {
	Data         []*Employee `json:"data"`
	TotalRecords int64       `json:"totalRecords"`
}

type Repository

type Repository interface {
	GetEmployees(params *getEmployeesRequest) ([]*Employee, error)
	GetTotalEmployees() (int64, error)
}

func NewRepository

func NewRepository(db *sql.DB) Repository

type Service

type Service interface {
	GetEmployees(params *getEmployeesRequest) (*EmployeeList, error)
}

func NewService

func NewService(repo Repository) Service

Jump to

Keyboard shortcuts

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