app

package
v0.0.0-...-70faa52 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunServer

func RunServer(d ServerDependencies) error

RunServer starts the actual API server

Types

type Interactors

type Interactors struct {
	Contest usecases.ContestInteractor
	Ranking usecases.RankingInteractor
}

Interactors is a collection of all repositories

func NewInteractors

func NewInteractors(
	r *Repositories,
) *Interactors

NewInteractors initializes all repositories

type Repositories

type Repositories struct {
	User       usecases.UserRepository
	Contest    usecases.ContestRepository
	ContestLog usecases.ContestLogRepository
	Ranking    usecases.RankingRepository
}

Repositories is a collection of all repositories

func NewRepositories

func NewRepositories(sh rdb.SQLHandler) *Repositories

NewRepositories initializes all repositories

type ServerDependencies

type ServerDependencies interface {
	AutoConfigure() error

	Init()
	Router() services.Router
	ErrorReporter() usecases.ErrorReporter

	RDB() *infra.RDB
	SQLHandler() rdb.SQLHandler

	Repositories() *Repositories
	Interactors() *Interactors
	Services() *Services
}

ServerDependencies is a dependency container for the api

func NewServerDependencies

func NewServerDependencies() ServerDependencies

NewServerDependencies instantiates all the dependencies for the api server

type Services

type Services struct {
	Health     services.HealthService
	Contest    services.ContestService
	Ranking    services.RankingService
	ContestLog services.ContestLogService
}

Services is a collection of all services

func NewServices

func NewServices(i *Interactors) *Services

NewServices initializes all interactors

Jump to

Keyboard shortcuts

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