app

package
v0.0.0-...-1649e63 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2024 License: MIT Imports: 22 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 {
	// contains filtered or unexported fields
}

App is a thin abstraction used to initialize all the dependencies, db connections, and GRPC server/clients. Could return an error if any of described above steps failed.

func New

func New(cfg cfg.Config, log *slog.Logger) *App

New constructs new App with provided arguments. NOTE: than neither cfg or log can't be nil or App will panic.

func (*App) GracefulStop

func (a *App) GracefulStop()

GracefulStop method gracefully stop the server. It listens to the OS sigals. After it receives signal it terminates all currently active servers, client, connections (if any) and gracefully exits.

func (*App) MustRun

func (a *App) MustRun()

MustRun is a wrapper around App.Run() function which could be handly when it's called from the main goroutine and we don't need to handler an error.

func (*App) Run

func (a *App) Run() error

Run method creates new GRPC server then initializes MySQL DB connection, after that initializes all necessary domain related services and finally starts listening on the provided ports. Could return an error if any of described above steps failed

Jump to

Keyboard shortcuts

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