schools

package
v0.0.0-...-8dc1090 Latest Latest
Warning

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

Go to latest
Published: May 10, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupportedOperation = errors.New("schools: unsupported operation")

ErrUnsupportedOperation is returned when an operation is performed on a school that isn't supported.

View Source
var MainRegistry = &Registry{
	[]data.School{},
}

MainRegistry is the main registry of schools

Functions

This section is empty.

Types

type ImportStatus

type ImportStatus int

An ImportStatus describes the status of a user's imported data

const (
	ImportStatusNone   ImportStatus = 0
	ImportStatusOK     ImportStatus = 1
	ImportStatusUpdate ImportStatus = 2
)

The types of ImportStatus.

type Provider

type Provider struct {
	School data.School
}

A Provider is a generic type that implements all methods of a calendar.Provider except for GetView()

func (*Provider) ID

func (p *Provider) ID() string

func (*Provider) Name

func (p *Provider) Name() string

type Registry

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

Registry is a struct that tracks available schools

func (*Registry) GetAllSchools

func (r *Registry) GetAllSchools() []data.School

GetAllSchools returns a list of all schools in the registry. It should not be directly modified.

func (*Registry) GetSchoolByEmailDomain

func (r *Registry) GetSchoolByEmailDomain(domain string) (data.School, error)

GetSchoolByEmailDomain returns the school associated with the given email domain, or nil if it doesn't exist.

func (*Registry) GetSchoolByID

func (r *Registry) GetSchoolByID(id string) (data.School, error)

GetSchoolByID returns the school associated with the given ID, or nil if it doesn't exist.

func (*Registry) Register

func (r *Registry) Register(school data.School)

Register registers the given school

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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