doctor

package
v0.0.0-...-db2c1db Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package doctor provides functionality to manage doctors.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Doctors

type Doctors struct {
	// contains filtered or unexported fields
}

Doctors contains and manages a set of doctors.

func LoadDoctors

func LoadDoctors(ctx context.Context, filename string) (*Doctors, error)

LoadDoctors loads the doctors from the given file. Returns an error if any entry is invalid.

func (*Doctors) Add

func (d *Doctors) Add(doctor *ir.Doctor) error

Add adds a doctor to the set of available doctors. Returns an error if the doctor with the same ID already exists.

func (*Doctors) GetByID

func (d *Doctors) GetByID(id string) *ir.Doctor

GetByID returns a doctor by ID or nil if no doctor is mapped to a given ID.

func (*Doctors) GetByName

func (d *Doctors) GetByName(firstName string, surname string) *ir.Doctor

GetByName returns a doctor by firstName and surname. Returns nil if no matching doctor found.

func (*Doctors) GetRandomDoctor

func (d *Doctors) GetRandomDoctor() *ir.Doctor

GetRandomDoctor returns a random doctor. Returns nil if no doctors are specified.

Jump to

Keyboard shortcuts

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