curriculum

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2020 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRouter

func NewRouter(server rest.Server, store Store) *chi.Mux

Types

type Store

type Store interface {
	GetArea(areaId string) (*postgres.Area, error)
	GetAreaSubjects(areaId string) ([]postgres.Subject, error)
	GetSubjectMaterials(subjectId string) ([]postgres.Material, error)
	GetMaterial(materialId string) (*postgres.Material, error)
	NewArea(name string, curriculumId string) (string, error)
	NewSubject(name string, areaId string, materials []postgres.Material) (*postgres.Subject, error)
	NewMaterial(name string, subjectId string) (*postgres.Material, error)
	GetSubject(id string) (*postgres.Subject, error)
	UpdateMaterial(material *postgres.Material, order *int) error
	DeleteArea(id string) error
	DeleteSubject(id string) error
	ReplaceSubject(subject postgres.Subject) error
	UpdateArea(areaId string, name string) error
	CheckSubjectPermissions(subjectId string, userId string) (bool, error)
	CheckAreaPermissions(subjectId string, userId string) (bool, error)
	CheckCurriculumPermission(curriculumId string, userId string) (bool, error)
	CheckMaterialPermission(materialId string, userId string) (bool, error)
}

Jump to

Keyboard shortcuts

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