yp-metrics

module
v0.0.0-...-33ac5cc Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2025 License: MIT

README

go-musthave-metrics-tpl

Шаблон репозитория для трека «Сервер сбора метрик и алертинга».

Начало работы

  1. Склонируйте репозиторий в любую подходящую директорию на вашем компьютере.
  2. В корне репозитория выполните команду go mod init <name> (где <name> — адрес вашего репозитория на GitHub без префикса https://) для создания модуля.

Обновление шаблона

Чтобы иметь возможность получать обновления автотестов и других частей шаблона, выполните команду:

git remote add -m main template https://github.com/Yandex-Practicum/go-musthave-metrics-tpl.git

Для обновления кода автотестов выполните команду:

git fetch template && git checkout template/main .github

Затем добавьте полученные изменения в свой репозиторий.

Запуск автотестов

Для успешного запуска автотестов называйте ветки iter<number>, где <number> — порядковый номер инкремента. Например, в ветке с названием iter4 запустятся автотесты для инкрементов с первого по четвёртый.

При мёрже ветки с инкрементом в основную ветку main будут запускаться все автотесты.

Подробнее про локальный и автоматический запуск читайте в README автотестов.

Directories

Path Synopsis
cmd
agent
Agent app executable
Agent app executable
server
Server app executable
Server app executable
staticlint
Staticlint app executable
Staticlint app executable
internal
agent
Package agent collects cpu and memory stat on local machine then send it to Server app by HTTP
Package agent collects cpu and memory stat on local machine then send it to Server app by HTTP
agent/config
Package config implements getting params from env/flags/config file
Package config implements getting params from env/flags/config file
compress
Package compress includes http server middleware for compressing data
Package compress includes http server middleware for compressing data
encrypt
Package encrypt includes middleware for decrypting request body if privateKey is set with parameters
Package encrypt includes middleware for decrypting request body if privateKey is set with parameters
handlers
Package handlers includes http router configuration and http handlers for Server app
Package handlers includes http router configuration and http handlers for Server app
logger
Package logger includes singleton and http middleware for logging requests
Package logger includes singleton and http middleware for logging requests
pg
Package pg singleton includes Connect and Close functions for pgx driver of postgress
Package pg singleton includes Connect and Close functions for pgx driver of postgress
pprofserv
Package pprofserv run pprof server on independent address
Package pprofserv run pprof server on independent address
retry
Package retry includes helping functions for retring capabilities
Package retry includes helping functions for retring capabilities
server
Package server process incomming requests from Agent
Package server process incomming requests from Agent
server/config
Package config implements getting params from env/flags/config file
Package config implements getting params from env/flags/config file
signing
Package signing includes http server middleware for request signature validation
Package signing includes http server middleware for request signature validation
staticlint/customcheck
Package customcheck inludes static analyser for os.exit in main func of main package
Package customcheck inludes static analyser for os.exit in main func of main package
staticlint/publiccheck
Package publiccheck contains errcheck and nilaway analyzers
Package publiccheck contains errcheck and nilaway analyzers
staticlint/standartcheck
Package standartcheck contains all standart analysers from golang.org/x/tools/go/analysis/passes
Package standartcheck contains all standart analysers from golang.org/x/tools/go/analysis/passes
staticlint/staticcheck
Package staticcheck contains all analysers from package staticcheck with code prefix SA plus S1003
Package staticcheck contains all analysers from package staticcheck with code prefix SA plus S1003
storage
Package storage includes repository implementations: MemStorage, HybridStorage, DbStorage, DTO objects and entities
Package storage includes repository implementations: MemStorage, HybridStorage, DbStorage, DTO objects and entities

Jump to

Keyboard shortcuts

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