internal

package
v0.0.0-...-4caa08a Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Cfg             *config.App
	ExternalClients *externalClients
	// contains filtered or unexported fields
}

App service

func NewApp

func NewApp(port string, overrides ...OverrideExternalClient) *App

NewApp creates a new App with all dependencies

func (*App) ApplyOverridesExternalClientConn

func (app *App) ApplyOverridesExternalClientConn(overrides ...OverrideExternalClient) *App

ApplyOverridesExternalClientConn overrides to be able to test the application in isolation from other systems

func (*App) InitClients

func (app *App) InitClients() *App

InitClients initializes external services if they was not overridden for integration tests

func (*App) InitControllers

func (app *App) InitControllers() *App

InitControllers initializes REST handlers

func (*App) InitExternalClientsConnIfNotSet

func (app *App) InitExternalClientsConnIfNotSet() *App

InitExternalClientsConnIfNotSet initializes external services if they was not overridden for integration tests

func (*App) InitGracefulShutdown

func (app *App) InitGracefulShutdown(signals ...os.Signal) *App

InitGracefulShutdown initializes the graceful shutdown for the application

func (*App) InitPgxConnection

func (app *App) InitPgxConnection() *App

InitPgxConnection initializes the pgx driver to connect to postgres

func (*App) InitServer

func (app *App) InitServer(port string) *App

InitServer initializes the web server to provide access via REST

func (*App) Run

func (app *App) Run()

Run starts server

type OverrideExternalClient

type OverrideExternalClient func(app *App) *App

OverrideExternalClient functions to replace an external clients with mocks for integration tests

func WithTelegramAPI

func WithTelegramAPI(ctor func(token string) types.TelegramBotAPI) OverrideExternalClient

WithTelegramAPI creates service with specific telegram API client

Directories

Path Synopsis
api
clients
pkg
graceful/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
multi_closer/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
types/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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