domain

package
v0.0.0-...-0ba4303 Latest Latest
Warning

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

Go to latest
Published: May 23, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const BaseTimestamp = -1

Used when the timestamp doesn't exist

Variables

This section is empty.

Functions

func RunApplication

func RunApplication(container *DependencyContainer)

Types

type DependencyContainer

type DependencyContainer struct {
	Repository              Repository
	Sender                  Sender
	TestTakerService        TestTakerService
	ErrorHandler            ErrorHandler
	FromEmailAddress        EmailAddress
	ThanksEmail             Email
	FetchTestTakersInterval time.Duration
}

type Email

type Email struct {
	Subject string
	Body    string
}

type EmailAddress

type EmailAddress struct {
	Name    string
	Address string
}

type ErrorHandler

type ErrorHandler interface {
	HandleCriticalError(err error)
	HandleError(err error)
}

type Repository

type Repository interface {
	StoreLastFinishedAt(timestamp int) (err error)
	FetchLastFinishedAt() (timestamp int, err error)
	StoreFailedTestTakerEmail(email TestTakerEmail) (err error)
	StoreTestTakerEmail(email TestTakerEmail) (err error)
	FetchEmailForTestTaker(testTaker TestTaker) (testTakerEmail *TestTakerEmail, err error)
}

type Sender

type Sender interface {
	Send(to, from EmailAddress, email Email) error
}

type TestTaker

type TestTaker struct {
	ID         int
	Name       string
	Email      string
	IsDemo     bool
	Percent    int
	FinishedAt int
}

type TestTakerEmail

type TestTakerEmail struct {
	TestTakerId int
	Email       string
}

type TestTakerService

type TestTakerService interface {
	GetNewTestTakers(repository Repository, errorHandler ErrorHandler) (testTakers []TestTaker, err error)
}

type Validator

type Validator interface {
	EmailIsValid(email string) bool
}

Jump to

Keyboard shortcuts

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