app

package
v0.0.0-...-525db63 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2024 License: MIT Imports: 24 Imported by: 0

Documentation

Overview

Package app initializes the application locator.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GracefulDBShutdown

func GracefulDBShutdown(ctx context.Context, l *Locator)

GracefulDBShutdown close all db opened connection.

Types

type Locator

type Locator struct {
	Config *config.Config

	DBx     *sqlx.DB
	Storage *sqluct.Storage

	ctxd.LoggerProvider

	clockSrv.ClockProvider

	VioService        *service.VioService
	VioRESTService    *service.VioRESTService
	VioMetricsService *servers.Metrics
	// contains filtered or unexported fields
}

Locator defines application resources.

func NewServiceLocator

func NewServiceLocator(cfg *config.Config, opts ...Option) (*Locator, error)

NewServiceLocator creates application locator.

func (*Locator) GeoStorage

func (l *Locator) GeoStorage() usecase.GeolocationDataStorage

GeoStorage returns geolocation data storage.

type Option

type Option func(l *Locator)

Option sets up service locator.

func WithGRPCOptions

func WithGRPCOptions(opts ...servers.Option) Option

WithGRPCOptions sets up gRPC server options.

func WithGRPCRestOptions

func WithGRPCRestOptions(opts ...servers.Option) Option

WithGRPCRestOptions sets up gRPC REST server options.

func WithMetrics

func WithMetrics(opts ...servers.Option) Option

WithMetrics sets up metrics server.

func WithNoService

func WithNoService() Option

WithNoService disables service.

Jump to

Keyboard shortcuts

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