generated from Yandex-Practicum/go-musthave-metrics-tpl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
123 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,28 @@ | ||
package main | ||
|
||
import ( | ||
"time" | ||
|
||
"github.com/ex0rcist/metflix/internal/agent" | ||
"github.com/ex0rcist/metflix/internal/logging" | ||
"github.com/rs/zerolog/log" | ||
) | ||
|
||
func main() { | ||
logging.Setup() | ||
|
||
log.Info().Msg("starting agent...") | ||
logging.LogInfo("starting agent...") | ||
|
||
agnt, err := agent.New() | ||
if err != nil { | ||
log.Error().Err(err).Msg("") | ||
return | ||
logging.LogFatal(err) | ||
} | ||
|
||
err = agnt.ParseFlags() | ||
if err != nil { | ||
log.Error().Err(err).Msg("") | ||
return | ||
logging.LogFatal(err) | ||
} | ||
|
||
log.Info().Msg(agnt.Config.String()) | ||
logging.LogInfo(agnt.Config.String()) | ||
|
||
err = agnt.Run() | ||
if err != nil { | ||
log.Error().Err(err).Msg("") | ||
return | ||
} | ||
agnt.Run() | ||
|
||
log.Info().Msg("agent ready") | ||
|
||
for { // fixme: tmp hack for goroutine | ||
time.Sleep(time.Second * 1) | ||
} | ||
logging.LogInfo("agent ready") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package entities | ||
|
||
import "errors" | ||
|
||
var ( | ||
ErrBadAddressFormat = errors.New("bad net address format") | ||
|
||
ErrMetricNotFound = errors.New("metric not found") | ||
ErrMetricUnknown = errors.New("unknown metric type") | ||
ErrMetricReport = errors.New("metric report error") | ||
ErrMetricMissingName = errors.New("metric name is missing") | ||
ErrMetricInvalidName = errors.New("metric name contains invalid characters") | ||
ErrMetricLongName = errors.New("metric name is too long") | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.