service

package
v0.0.0-...-f0bbf45 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

Service initializes our database instance

func NewService

func NewService(ds db.DataStore) *Service

NewService creates a connection to our database

func (*Service) AddStudent

func (s *Service) AddStudent(student *models.Student) (string, error)

AddStudent adds student into database

func (*Service) AddTeacher

func (s *Service) AddTeacher(teacher *models.Teacher) (string, error)

AddTeacher adds teacher into database

func (*Service) DeleteStudent

func (s *Service) DeleteStudent(id string) error

DeleteStudent deletes student from database

func (*Service) DeleteTeacher

func (s *Service) DeleteTeacher(id string) error

DeleteTeacher deletes teacher from database

func (*Service) RetrieveStudent

func (s *Service) RetrieveStudent(id string) (*models.Student, error)

RetrieveStudent gets student from database

func (*Service) RetrieveTeacher

func (s *Service) RetrieveTeacher(id string) (*models.Teacher, error)

RetrieveTeacher gets teacher from database

func (*Service) UpdateStudent

func (s *Service) UpdateStudent(student *models.Student) error

UpdateStudent updates student record in database

func (*Service) UpdateTeacher

func (s *Service) UpdateTeacher(teacher *models.Teacher) error

UpdateTeacher updates teacher record in database

Jump to

Keyboard shortcuts

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