model

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Companies

type Companies []*Company

func LoadCompanies

func LoadCompanies(filename string) (Companies, error)

func (Companies) Find

func (c Companies) Find(companyName string) *Company

func (Companies) Random

func (c Companies) Random() *Company

type Company

type Company struct {
	Name         string
	NumberHiring int
	Students     []string
}

func NewCompany

func NewCompany(name string, numberHiring int, students []string) *Company

func (Company) Equals

func (c Company) Equals(c2 Company) bool

type Match

type Match struct {
	Company *Company
	Student *Student
}

func NewMatch

func NewMatch(c *Company, s *Student) *Match

func (Match) Equals

func (m Match) Equals(m2 Match) bool

type Matches

type Matches []*Match

func (Matches) Add

func (m Matches) Add(student *Student, company *Company) Matches

func (Matches) CompanyCanSupportMatch

func (m Matches) CompanyCanSupportMatch(company *Company) bool

CompanyCanSupportMatch returns true if a company has room to match

func (Matches) Equals

func (m Matches) Equals(m2 Matches) bool

Equals returns true of two sets of matches are exactly equal to one-another.

func (Matches) FindByStudent

func (m Matches) FindByStudent(student *Student) *Match

FindByStudent finds the student's match in the list of matches, or nil if they haven't been matched yet

func (Matches) StudentHasMatch

func (m Matches) StudentHasMatch(student *Student) bool

StudentHasMatch returns true if the given student has a match already assigned

func (Matches) WriteByCompany

func (m Matches) WriteByCompany()

func (Matches) WriteByStudent

func (m Matches) WriteByStudent()

func (Matches) WriteCSVByCompany

func (m Matches) WriteCSVByCompany()

func (Matches) WriteCSVByStudent

func (m Matches) WriteCSVByStudent()

type Student

type Student struct {
	Name      string
	Companies []string
}

func NewStudent

func NewStudent(name string, companies []string) *Student

func (Student) Equals

func (s Student) Equals(s2 Student) bool

type Students

type Students []*Student

func LoadStudents

func LoadStudents(filename string) (Students, error)

func (Students) Find

func (s Students) Find(name string) *Student

func (Students) Validate

func (s Students) Validate() error

Jump to

Keyboard shortcuts

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