From b53ecd68e4cbd0e6a1eaebb5448e364def7a81d7 Mon Sep 17 00:00:00 2001 From: Igson <91243660+IGSON2@users.noreply.github.com> Date: Thu, 16 May 2024 00:27:05 +0900 Subject: [PATCH] update advanced-chart api, websocket --- backend/api/advanced.go | 178 ++++++++++++++++++++++++ backend/api/another_interval_maker.go | 7 +- backend/api/candles_Interface.go | 81 +++++++++++ backend/api/chartMaker.go | 32 +++-- backend/api/intermediate_chart_maker.go | 2 + backend/api/middleware.go | 11 ++ backend/api/resultMaker.go | 2 +- backend/api/server.go | 10 +- backend/api/user_test.go | 2 +- backend/api/websocket.go | 24 ++++ backend/utilities/encrypt.go | 10 ++ go.mod | 26 ++-- go.sum | 61 ++++---- 13 files changed, 381 insertions(+), 65 deletions(-) create mode 100644 backend/api/advanced.go create mode 100644 backend/api/websocket.go diff --git a/backend/api/advanced.go b/backend/api/advanced.go new file mode 100644 index 0000000..46736c8 --- /dev/null +++ b/backend/api/advanced.go @@ -0,0 +1,178 @@ +package api + +import ( + db "bitmoi/backend/db/sqlc" + "bitmoi/backend/utilities" + "context" + "errors" + "fmt" + + "github.com/gofiber/fiber/v2" +) + +type AdvancedPracticeQuery struct { + From int64 `json:"from" query:"from"` + To int64 `json:"to" query:"to"` + Identifier string `json:"identifier" query:"identifier"` +} + +func (s *Server) GetAdvancedPractice(c *fiber.Ctx) error { + payload := new(AdvancedPracticeQuery) + err := c.QueryParser(payload) + if err != nil { + s.logger.Err(err).Msg("cannot get advanced practice chart due to parsing query failed") + return c.SendStatus(fiber.StatusBadRequest) + } + + if payload.Identifier == "" { + nextPair := utilities.FindDiffPair(s.pairs, []string{}) + aOc, err := s.makeAdvancedChartToRef(db.FifM, nextPair, c.Context()) + if err != nil { + s.logger.Err(err).Msg("cannot get advanced practice chart") + return c.SendStatus(fiber.StatusInternalServerError) + } + return c.Status(fiber.StatusOK).JSON(aOc) + } + + info, err := utilities.DecodeIdentificationData(payload.Identifier) + if err != nil { + s.logger.Err(err).Msg("cannot unmarshal chart identifier.") + return c.Status(fiber.StatusBadRequest).SendString("cannot unmarshal chart identifier.") + } + + pvData, err := s.selectAdvancedInterChart(info, db.FifM, payload.From, payload.To, c.Context()) + if err != nil { + s.logger.Err(err).Msg("cannot select intermediate chart to reference timestamp.") + return c.Status(fiber.StatusInternalServerError).SendString("cannot select intermediate chart to reference timestamp.") + } + + return c.Status(fiber.StatusOK).JSON(fiber.Map{"pvdata": pvData}) +} + +type AdvancedOnePairChart struct { + Name string `json:"name"` + PvDatas []PriceVolumeData `json:"pvdata"` + Identifier string `json:"identifier"` +} + +func (s *Server) makeAdvancedChartToRef(interval, name string, ctx context.Context) (*AdvancedOnePairChart, error) { + + min, max, err := s.store.SelectMinMaxTime(interval, name, ctx) + if err != nil { + return nil, fmt.Errorf("cannot count all rows. name : %s, interval : %s, err : %w", name, interval, err) + } + + refTimestamp := max - calculateRefTimestamp(max-min) + if refTimestamp == max { + return nil, ErrShortRange + } + pvDatas, err := s.selectAdvancedChart(name, interval, refTimestamp, ctx) + if err != nil { + return nil, fmt.Errorf("cannot make chart to reference timestamp. name : %s, interval : %s, err : %w", name, interval, err) + } + + identifier := utilities.EncrtpByASE(utilities.IdentificationData{ + Name: name, + Interval: interval, + RefTimestamp: refTimestamp, + }) + var aOc = &AdvancedOnePairChart{ + Name: name, + PvDatas: pvDatas, + Identifier: identifier, + } + return aOc, nil +} + +const oneTimeAdvancedLoad = 10000 + +func (s *Server) selectAdvancedChart(name, interval string, refTimestamp int64, ctx context.Context) ([]PriceVolumeData, error) { + var pvDatas []PriceVolumeData + + switch interval { + case db.OneD: + candles, err := s.store.Get1dCandles(ctx, db.Get1dCandlesParams{Name: name, Time: refTimestamp, Limit: oneTimeAdvancedLoad}) + if err != nil { + return nil, err + } + cs := Candles1dSlice(candles) + pvDatas = (cs).InitAdvancedCandleData() + case db.FourH: + candles, err := s.store.Get4hCandles(ctx, db.Get4hCandlesParams{Name: name, Time: refTimestamp, Limit: oneTimeAdvancedLoad}) + if err != nil { + return nil, err + } + cs := Candles4hSlice(candles) + pvDatas = (cs).InitAdvancedCandleData() + case db.OneH: + candles, err := s.store.Get1hCandles(ctx, db.Get1hCandlesParams{Name: name, Time: refTimestamp, Limit: oneTimeAdvancedLoad}) + if err != nil { + return nil, err + } + cs := Candles1hSlice(candles) + pvDatas = (cs).InitAdvancedCandleData() + case db.FifM: + candles, err := s.store.Get15mCandles(ctx, db.Get15mCandlesParams{Name: name, Time: refTimestamp, Limit: oneTimeAdvancedLoad}) + if err != nil { + return nil, err + } + cs := Candles15mSlice(candles) + pvDatas = (cs).InitAdvancedCandleData() + case db.FiveM: + candles, err := s.store.Get5mCandles(ctx, db.Get5mCandlesParams{Name: name, Time: refTimestamp, Limit: oneTimeStageLoad}) + if err != nil { + return nil, err + } + cs := Candles5mSlice(candles) + pvDatas = (cs).InitAdvancedCandleData() + } + if len(pvDatas) == 0 { + return nil, ErrGetStageChart + } + return pvDatas, nil +} + +func (s *Server) selectAdvancedInterChart(info *utilities.IdentificationData, interval string, minTime, maxTime int64, ctx context.Context) ([]PriceVolumeData, error) { + var pvDatas []PriceVolumeData + + switch interval { + case db.OneD: + candles, err := s.store.Get1dCandlesRnage(ctx, db.Get1dCandlesRnageParams{Name: info.Name, Time: minTime, Time_2: maxTime}) + if err != nil { + s.logger.Error().Err(err).Str("name", info.Name).Int64("min", minTime).Int64("max", maxTime).Msg("cannot get 1d intermediate chart.") + return nil, err + } + cs := Candles1dSlice(candles) + pvDatas = cs.InitAdvancedCandleData() + case db.FourH: + candles, err := s.store.Get4hCandlesRnage(ctx, db.Get4hCandlesRnageParams{Name: info.Name, Time: minTime, Time_2: maxTime}) + if err != nil { + s.logger.Error().Err(err).Str("name", info.Name).Int64("min", minTime).Int64("max", maxTime).Msg("cannot get 4h intermediate chart.") + return nil, err + } + cs := Candles4hSlice(candles) + pvDatas = cs.InitAdvancedCandleData() + case db.OneH: + candles, err := s.store.Get1hCandlesRnage(ctx, db.Get1hCandlesRnageParams{Name: info.Name, Time: minTime, Time_2: maxTime}) + if err != nil { + s.logger.Error().Err(err).Str("name", info.Name).Int64("min", minTime).Int64("max", maxTime).Msg("cannot get 1h intermediate chart.") + return nil, err + } + cs := Candles1hSlice(candles) + pvDatas = cs.InitAdvancedCandleData() + case db.FifM: + candles, err := s.store.Get15mCandlesRnage(ctx, db.Get15mCandlesRnageParams{Name: info.Name, Time: minTime, Time_2: maxTime}) + if err != nil { + s.logger.Error().Err(err).Str("name", info.Name).Int64("min", minTime).Int64("max", maxTime).Msg("cannot get 15m intermediate chart.") + return nil, err + } + cs := Candles15mSlice(candles) + pvDatas = cs.InitAdvancedCandleData() + } + if len(pvDatas) == 0 { + s.logger.Debug().Str("name", info.Name).Str("interval", interval).Int64("min", minTime).Int64("max", maxTime).Msg("No intermediate chart data.") + return nil, errors.New("no chart data") + } + + return pvDatas, nil +} diff --git a/backend/api/another_interval_maker.go b/backend/api/another_interval_maker.go index ae98794..2e7032c 100644 --- a/backend/api/another_interval_maker.go +++ b/backend/api/another_interval_maker.go @@ -3,21 +3,18 @@ package api import ( db "bitmoi/backend/db/sqlc" "bitmoi/backend/utilities" - "encoding/json" "fmt" "github.com/gofiber/fiber/v2" ) func (s *Server) sendAnotherInterval(a *AnotherIntervalRequest, c *fiber.Ctx) (*OnePairChart, error) { - originInfo := new(utilities.IdentificationData) - infoByte := utilities.DecryptByASE(a.Identifier) - err := json.Unmarshal(infoByte, originInfo) + originInfo, err := utilities.DecodeIdentificationData(a.Identifier) if err != nil { return nil, fmt.Errorf("cannot unmarshal chart identifier. err : %w", err) } - cdd, err := s.selectStageChart(originInfo.Name, a.ReqInterval, originInfo.RefTimestamp+db.GetIntervalStep(db.OneH)-1, c) + cdd, err := s.selectStageChart(originInfo.Name, a.ReqInterval, originInfo.RefTimestamp+db.GetIntervalStep(db.OneH)-1, c.Context()) if err != nil { return nil, fmt.Errorf("cannot make chart to reference timestamp. name : %s, interval : %s, err : %w", originInfo.Name, a.ReqInterval, err) } diff --git a/backend/api/candles_Interface.go b/backend/api/candles_Interface.go index 3df065a..393d122 100644 --- a/backend/api/candles_Interface.go +++ b/backend/api/candles_Interface.go @@ -11,6 +11,7 @@ type CandlesInterface interface { Name() string EntryTime() string InitCandleData() *CandleData + InitAdvancedCandleData() []PriceVolumeData } type Candles1dSlice []db.Candles1d @@ -49,6 +50,22 @@ func (c *Candles1dSlice) InitCandleData() *CandleData { return &CandleData{pDataSlice, vDataSlice} } +func (c *Candles1dSlice) InitAdvancedCandleData() []PriceVolumeData { + var pvDataSlice []PriceVolumeData + for _, row := range *c { + newPvData := PriceVolumeData{ + Open: row.Open, + Close: row.Close, + High: row.High, + Low: row.Low, + Volume: row.Volume, + Time: row.Time * 1000, + } + pvDataSlice = append([]PriceVolumeData{newPvData}, pvDataSlice...) + } + return pvDataSlice +} + type Candles4hSlice []db.Candles4h func (c *Candles4hSlice) EntryTime() string { @@ -86,6 +103,22 @@ func (c *Candles4hSlice) InitCandleData() *CandleData { return &CandleData{pDataSlice, vDataSlice} } +func (c *Candles4hSlice) InitAdvancedCandleData() []PriceVolumeData { + var pvDataSlice []PriceVolumeData + for _, row := range *c { + newPvData := PriceVolumeData{ + Open: row.Open, + Close: row.Close, + High: row.High, + Low: row.Low, + Volume: row.Volume, + Time: row.Time * 1000, + } + pvDataSlice = append([]PriceVolumeData{newPvData}, pvDataSlice...) + } + return pvDataSlice +} + type Candles1hSlice []db.Candles1h func (c *Candles1hSlice) EntryTime() string { @@ -123,6 +156,22 @@ func (c *Candles1hSlice) InitCandleData() *CandleData { return &CandleData{pDataSlice, vDataSlice} } +func (c *Candles1hSlice) InitAdvancedCandleData() []PriceVolumeData { + var pvDataSlice []PriceVolumeData + for _, row := range *c { + newPvData := PriceVolumeData{ + Open: row.Open, + Close: row.Close, + High: row.High, + Low: row.Low, + Volume: row.Volume, + Time: row.Time * 1000, + } + pvDataSlice = append([]PriceVolumeData{newPvData}, pvDataSlice...) + } + return pvDataSlice +} + type Candles15mSlice []db.Candles15m func (c *Candles15mSlice) EntryTime() string { @@ -160,6 +209,22 @@ func (c *Candles15mSlice) InitCandleData() *CandleData { return &CandleData{pDataSlice, vDataSlice} } +func (c *Candles15mSlice) InitAdvancedCandleData() []PriceVolumeData { + var pvDataSlice []PriceVolumeData + for _, row := range *c { + newPvData := PriceVolumeData{ + Open: row.Open, + Close: row.Close, + High: row.High, + Low: row.Low, + Volume: row.Volume, + Time: row.Time * 1000, + } + pvDataSlice = append([]PriceVolumeData{newPvData}, pvDataSlice...) + } + return pvDataSlice +} + type Candles5mSlice []db.Candles5m func (c *Candles5mSlice) EntryTime() string { @@ -196,3 +261,19 @@ func (c *Candles5mSlice) InitCandleData() *CandleData { } return &CandleData{pDataSlice, vDataSlice} } + +func (c *Candles5mSlice) InitAdvancedCandleData() []PriceVolumeData { + var pvDataSlice []PriceVolumeData + for _, row := range *c { + newPvData := PriceVolumeData{ + Open: row.Open, + Close: row.Close, + High: row.High, + Low: row.Low, + Volume: row.Volume, + Time: row.Time * 1000, + } + pvDataSlice = append([]PriceVolumeData{newPvData}, pvDataSlice...) + } + return pvDataSlice +} diff --git a/backend/api/chartMaker.go b/backend/api/chartMaker.go index 962e59b..997e9fd 100644 --- a/backend/api/chartMaker.go +++ b/backend/api/chartMaker.go @@ -4,6 +4,7 @@ import ( db "bitmoi/backend/db/sqlc" "bitmoi/backend/utilities" "bitmoi/backend/utilities/common" + "context" "errors" "fmt" "math" @@ -57,8 +58,13 @@ type OnePairChart struct { timeFactor int64 } -type Charts struct { - Charts OnePairChart `json:"charts"` +type PriceVolumeData struct { + Open float64 `json:"open"` + Close float64 `json:"close"` + High float64 `json:"high"` + Low float64 `json:"low"` + Volume float64 `json:"volume"` + Time int64 `json:"time"` } func (s *Server) calcBtcRatio(interval, name string, refTimestamp int64, c *fiber.Ctx) (float64, error) { @@ -102,40 +108,40 @@ func (s *Server) calcBtcRatio(interval, name string, refTimestamp int64, c *fibe return -1, fmt.Errorf("invalid interval %s", interval) } -func (s *Server) selectStageChart(name, interval string, refTimestamp int64, c *fiber.Ctx) (*CandleData, error) { +func (s *Server) selectStageChart(name, interval string, refTimestamp int64, ctx context.Context) (*CandleData, error) { cdd := new(CandleData) switch interval { case db.OneD: - candles, err := s.store.Get1dCandles(c.Context(), db.Get1dCandlesParams{Name: name, Time: refTimestamp, Limit: oneTimeStageLoad}) + candles, err := s.store.Get1dCandles(ctx, db.Get1dCandlesParams{Name: name, Time: refTimestamp, Limit: oneTimeStageLoad}) if err != nil { return nil, err } cs := Candles1dSlice(candles) cdd = (cs).InitCandleData() case db.FourH: - candles, err := s.store.Get4hCandles(c.Context(), db.Get4hCandlesParams{Name: name, Time: refTimestamp, Limit: oneTimeStageLoad}) + candles, err := s.store.Get4hCandles(ctx, db.Get4hCandlesParams{Name: name, Time: refTimestamp, Limit: oneTimeStageLoad}) if err != nil { return nil, err } cs := Candles4hSlice(candles) cdd = (cs).InitCandleData() case db.OneH: - candles, err := s.store.Get1hCandles(c.Context(), db.Get1hCandlesParams{Name: name, Time: refTimestamp, Limit: oneTimeStageLoad}) + candles, err := s.store.Get1hCandles(ctx, db.Get1hCandlesParams{Name: name, Time: refTimestamp, Limit: oneTimeStageLoad}) if err != nil { return nil, err } cs := Candles1hSlice(candles) cdd = (cs).InitCandleData() case db.FifM: - candles, err := s.store.Get15mCandles(c.Context(), db.Get15mCandlesParams{Name: name, Time: refTimestamp, Limit: oneTimeStageLoad}) + candles, err := s.store.Get15mCandles(ctx, db.Get15mCandlesParams{Name: name, Time: refTimestamp, Limit: oneTimeStageLoad}) if err != nil { return nil, err } cs := Candles15mSlice(candles) cdd = (cs).InitCandleData() case db.FiveM: - candles, err := s.store.Get5mCandles(c.Context(), db.Get5mCandlesParams{Name: name, Time: refTimestamp, Limit: oneTimeStageLoad}) + candles, err := s.store.Get5mCandles(ctx, db.Get5mCandlesParams{Name: name, Time: refTimestamp, Limit: oneTimeStageLoad}) if err != nil { return nil, err } @@ -148,23 +154,23 @@ func (s *Server) selectStageChart(name, interval string, refTimestamp int64, c * return cdd, nil } -func calculateRefTimestamp(section int64, name, interval string) int64 { +func calculateRefTimestamp(section int64) int64 { oneMonth, waitingTime := 30*24*time.Hour.Seconds(), 30*24*time.Hour.Seconds() return int64(utilities.MakeRanInt(int(waitingTime), int(section-int64(oneMonth)))) } -func (s *Server) makeChartToRef(interval, name string, mode string, prevStage int, c *fiber.Ctx) (*OnePairChart, error) { +func (s *Server) makeChartToRef(interval, name string, mode string, ctx context.Context) (*OnePairChart, error) { - min, max, err := s.store.SelectMinMaxTime(interval, name, c.Context()) + min, max, err := s.store.SelectMinMaxTime(interval, name, ctx) if err != nil { return nil, fmt.Errorf("cannot count all rows. name : %s, interval : %s, err : %w", name, interval, err) } - refTimestamp := max - calculateRefTimestamp(max-min, name, interval) + refTimestamp := max - calculateRefTimestamp(max-min) if refTimestamp == max { return nil, ErrShortRange } - cdd, err := s.selectStageChart(name, interval, refTimestamp, c) + cdd, err := s.selectStageChart(name, interval, refTimestamp, ctx) if err != nil { return nil, fmt.Errorf("cannot make chart to reference timestamp. name : %s, interval : %s, err : %w", name, interval, err) } diff --git a/backend/api/intermediate_chart_maker.go b/backend/api/intermediate_chart_maker.go index b574811..34e7010 100644 --- a/backend/api/intermediate_chart_maker.go +++ b/backend/api/intermediate_chart_maker.go @@ -4,6 +4,7 @@ import ( db "bitmoi/backend/db/sqlc" "bitmoi/backend/utilities" "context" + "errors" ) func (s *Server) selectInterChart(info *utilities.IdentificationData, interval string, minTime, maxTime int64, ctx context.Context) (*CandleData, error) { @@ -45,6 +46,7 @@ func (s *Server) selectInterChart(info *utilities.IdentificationData, interval s } if cdd.PData == nil || cdd.VData == nil { s.logger.Debug().Str("name", info.Name).Str("interval", interval).Int64("min", minTime).Int64("max", maxTime).Msg("No intermediate chart data.") + return nil, errors.New("no chart data") } return cdd, nil diff --git a/backend/api/middleware.go b/backend/api/middleware.go index d953019..e5d4f88 100644 --- a/backend/api/middleware.go +++ b/backend/api/middleware.go @@ -6,6 +6,7 @@ import ( "strings" "time" + "github.com/gofiber/contrib/websocket" "github.com/gofiber/fiber/v2" "github.com/gofiber/fiber/v2/middleware/cors" "github.com/gofiber/fiber/v2/middleware/limiter" @@ -123,3 +124,13 @@ func createNewLimitMiddleware(cnt int, logger *zerolog.Logger) fiber.Handler { }, }) } + +func createWebsocketMiddleware() fiber.Handler { + return func(c *fiber.Ctx) error { + if websocket.IsWebSocketUpgrade(c) { + c.Locals("allowed", true) + return c.Next() + } + return c.SendStatus(fiber.StatusUpgradeRequired) + } +} diff --git a/backend/api/resultMaker.go b/backend/api/resultMaker.go index fec338f..7f7c1c6 100644 --- a/backend/api/resultMaker.go +++ b/backend/api/resultMaker.go @@ -66,7 +66,7 @@ func (s *Server) createCompResult(compOrder *ScoreRequest, c *fiber.Ctx) (*Score result.ResultChart = &CandleData{PData: resultchart.PData, VData: resultchart.VData} - originchart, err := s.selectStageChart(compInfo.Name, compInfo.Interval, compInfo.RefTimestamp, c) + originchart, err := s.selectStageChart(compInfo.Name, compInfo.Interval, compInfo.RefTimestamp, c.Context()) if err != nil { return nil, fmt.Errorf("cannot select origin competition chart. err : %w", err) } diff --git a/backend/api/server.go b/backend/api/server.go index 64f9ee6..3e9a98b 100644 --- a/backend/api/server.go +++ b/backend/api/server.go @@ -152,6 +152,12 @@ func NewServer(c *utilities.Config, s db.Store, taskDistributor worker.TaskDistr adminGroup.Get("/token", server.GetTokenInfo) adminGroup.Get("/referral", server.GetReferralInfo) + advancedGroup := router.Group("/advanced", createNewLimitMiddleware(500, server.logger)) + advancedGroup.Get("/practice", server.GetAdvancedPractice) + + // websocketGroup := router.Group("/ws", createWebsocketMiddleware()) + // websocketGroup.Get("/", websocket.New(server.websocketTest)) + server.router = router go server.BiddingLoop() @@ -198,7 +204,7 @@ func (s *Server) getPracticeChart(c *fiber.Ctx) error { } for i := 1; ; i++ { nextPair := utilities.FindDiffPair(s.pairs, history) - oc, err = s.makeChartToRef(db.OneH, nextPair, practice, len(history), c) + oc, err = s.makeChartToRef(db.OneH, nextPair, practice, c.Context()) if err != nil || oc == nil { if err == ErrShortRange { s.logger.Warn().Str("parname", nextPair).Msgf("%s, Cnt: %d", err.Error(), i) @@ -273,7 +279,7 @@ func (s *Server) getCompetitionChart(c *fiber.Ctx) error { } for i := 1; ; i++ { nextPair := utilities.FindDiffPair(s.pairs, history) - oc, err = s.makeChartToRef(db.OneH, nextPair, competition, len(history), c) + oc, err = s.makeChartToRef(db.OneH, nextPair, competition, c.Context()) if err != nil || oc == nil { if err == ErrShortRange { s.logger.Warn().Str("parname", nextPair).Msgf("%s, Cnt: %d", err.Error(), i) diff --git a/backend/api/user_test.go b/backend/api/user_test.go index 675c5fa..78fbc97 100644 --- a/backend/api/user_test.go +++ b/backend/api/user_test.go @@ -171,7 +171,7 @@ func TestCheckAttendacne(t *testing.T) { require.NoError(t, err) require.False(t, user.LastAccessedAt.Valid) - _, err = s.checkAttendance(context.Background(), userID) + _, err = checkAutoAttendance(s.store, context.Background(), userID) require.NoError(t, err) user, err = s.store.GetUser(context.Background(), userID) diff --git a/backend/api/websocket.go b/backend/api/websocket.go new file mode 100644 index 0000000..d192d4f --- /dev/null +++ b/backend/api/websocket.go @@ -0,0 +1,24 @@ +package api + +import ( + "log" + + "github.com/gofiber/contrib/websocket" +) + +func (s *Server) websocketTest(c *websocket.Conn) { + defer c.Close() + for { + mt, msg, err := c.ReadMessage() + if err != nil { + log.Println("read:", err) + break + } + log.Printf("recv: %s", msg) + err = c.WriteMessage(mt, msg) + if err != nil { + log.Println("write:", err) + break + } + } +} diff --git a/backend/utilities/encrypt.go b/backend/utilities/encrypt.go index 3c5b917..5ada5ff 100644 --- a/backend/utilities/encrypt.go +++ b/backend/utilities/encrypt.go @@ -25,6 +25,16 @@ func (i *IdentificationData) IsPracticeMode() bool { return i.PriceFactor == 0 || i.TimeFactor == 0 || i.VolumeFactor == 0 } +func DecodeIdentificationData(data string) (*IdentificationData, error) { + info := new(IdentificationData) + infoByte := DecryptByASE(data) + err := json.Unmarshal(infoByte, info) + if err != nil { + return nil, fmt.Errorf("cannot unmarshal chart identifier. err : %w", err) + } + return info, nil +} + func Base64Encode(b []byte) string { return base64.StdEncoding.EncodeToString(b) } diff --git a/go.mod b/go.mod index fe31ad6..f7af2b3 100644 --- a/go.mod +++ b/go.mod @@ -11,10 +11,11 @@ require ( github.com/ethereum/go-ethereum v1.13.9 github.com/go-playground/validator/v10 v10.16.0 github.com/go-sql-driver/mysql v1.7.1 - github.com/gofiber/fiber/v2 v2.52.0 + github.com/gofiber/contrib/websocket v1.3.1 + github.com/gofiber/fiber/v2 v2.52.4 github.com/gofiber/swagger v0.1.12 github.com/golang/mock v1.6.0 - github.com/google/uuid v1.5.0 + github.com/google/uuid v1.6.0 github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.2 github.com/h2non/filetype v1.1.3 github.com/hibiken/asynq v0.24.1 @@ -24,10 +25,10 @@ require ( github.com/redis/go-redis/v9 v9.0.5 github.com/rs/zerolog v1.29.1 github.com/spf13/viper v1.16.0 - github.com/stretchr/testify v1.8.4 + github.com/stretchr/testify v1.9.0 github.com/swaggo/swag v1.16.2 github.com/urfave/cli/v2 v2.27.1 - golang.org/x/crypto v0.18.0 + golang.org/x/crypto v0.23.0 golang.org/x/oauth2 v0.13.0 google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0 google.golang.org/grpc v1.60.1 @@ -43,7 +44,7 @@ require ( github.com/StackExchange/wmi v1.2.1 // indirect github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da // indirect github.com/aead/poly1305 v0.0.0-20180717145839-3fee0db0b635 // indirect - github.com/andybalholm/brotli v1.0.6 // indirect + github.com/andybalholm/brotli v1.1.0 // indirect github.com/bitly/go-simplejson v0.5.0 // indirect github.com/bits-and-blooms/bitset v1.13.0 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect @@ -57,6 +58,7 @@ require ( github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/ethereum/c-kzg-4844 v0.4.0 // indirect + github.com/fasthttp/websocket v1.5.8 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/gabriel-vasile/mimetype v1.4.3 // indirect github.com/go-ole/go-ole v1.2.5 // indirect @@ -75,7 +77,7 @@ require ( github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.17.4 // indirect + github.com/klauspost/compress v1.17.8 // indirect github.com/leodido/go-urn v1.2.4 // indirect github.com/lyft/protoc-gen-star/v2 v2.0.3 // indirect github.com/magiconair/properties v1.8.7 // indirect @@ -91,9 +93,10 @@ require ( github.com/philhofer/fwd v1.1.2 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/rivo/uniseg v0.4.4 // indirect + github.com/rivo/uniseg v0.4.7 // indirect github.com/robfig/cron/v3 v3.0.1 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect + github.com/savsgio/gotils v0.0.0-20240303185622-093b76447511 // indirect github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect github.com/spf13/afero v1.10.0 // indirect github.com/spf13/cast v1.5.1 // indirect @@ -106,16 +109,15 @@ require ( github.com/tklauser/go-sysconf v0.3.12 // indirect github.com/tklauser/numcpus v0.6.1 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect - github.com/valyala/fasthttp v1.51.0 // indirect + github.com/valyala/fasthttp v1.52.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect github.com/xrash/smetrics v0.0.0-20231213231151-1d8dd44e695e // indirect golang.org/x/exp v0.0.0-20240110193028-0dcbfd608b1e // indirect - golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect golang.org/x/mod v0.14.0 // indirect - golang.org/x/net v0.20.0 // indirect + golang.org/x/net v0.25.0 // indirect golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.16.0 // indirect - golang.org/x/text v0.14.0 // indirect + golang.org/x/sys v0.20.0 // indirect + golang.org/x/text v0.15.0 // indirect golang.org/x/time v0.3.0 // indirect golang.org/x/tools v0.16.1 // indirect google.golang.org/appengine v1.6.8 // indirect diff --git a/go.sum b/go.sum index 6fed089..18936b9 100644 --- a/go.sum +++ b/go.sum @@ -66,8 +66,8 @@ github.com/aead/chacha20poly1305 v0.0.0-20201124145622-1a5aba2a8b29/go.mod h1:Uz github.com/aead/poly1305 v0.0.0-20180717145839-3fee0db0b635 h1:52m0LGchQBBVqJRyYYufQuIbVqRawmubW3OFGqK1ekw= github.com/aead/poly1305 v0.0.0-20180717145839-3fee0db0b635/go.mod h1:lmLxL+FV291OopO93Bwf9fQLQeLyt33VJRUg5VJ30us= github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= -github.com/andybalholm/brotli v1.0.6 h1:Yf9fFpf49Zrxb9NlQaluyE92/+X7UVHlhMNJN2sxfOI= -github.com/andybalholm/brotli v1.0.6/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= +github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M= +github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY= github.com/aws/aws-sdk-go v1.44.323 h1:97/dn93DWrN1VfhAWQ2tV+xuE6oO/LO9rSsEsuC4PLU= github.com/aws/aws-sdk-go v1.44.323/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -140,14 +140,14 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/envoyproxy/protoc-gen-validate v1.0.2 h1:QkIBuU5k+x7/QXPvPPnWXWlCdaBFApVqftFV6k087DA= -github.com/envoyproxy/protoc-gen-validate v1.0.2/go.mod h1:GpiZQP3dDbg4JouG/NNS7QWXpgx6x8QiMKdmN72jogE= github.com/envoyproxy/protoc-gen-validate v1.0.4 h1:gVPz/FMfvh57HdSJQyvBtF00j8JU4zdyUgIUNhlgg0A= github.com/envoyproxy/protoc-gen-validate v1.0.4/go.mod h1:qys6tmnRsYrQqIhm2bvKZH4Blx/1gTIZ2UKVY1M+Yew= github.com/ethereum/c-kzg-4844 v0.4.0 h1:3MS1s4JtA868KpJxroZoepdV0ZKBp3u/O5HcZ7R3nlY= github.com/ethereum/c-kzg-4844 v0.4.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= github.com/ethereum/go-ethereum v1.13.9 h1:ed4e4c7NWPrO2VX2wsMhWs5+6Lf2D591DmdE8RgmtcU= github.com/ethereum/go-ethereum v1.13.9/go.mod h1:sc48XYQxCzH3fG9BcrXCOOgQk2JfZzNAmIKnceogzsA= +github.com/fasthttp/websocket v1.5.8 h1:k5DpirKkftIF/w1R8ZzjSgARJrs54Je9YJK37DL/Ah8= +github.com/fasthttp/websocket v1.5.8/go.mod h1:d08g8WaT6nnyvg9uMm8K9zMYyDjfKyj3170AtPRuVU0= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= @@ -190,9 +190,11 @@ github.com/go-playground/validator/v10 v10.16.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QX github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI= github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/gofiber/contrib/websocket v1.3.1 h1:iINEnUIT7Wi1ttGWW5fY1fnKQlIEa5KTDXmMoedKinE= +github.com/gofiber/contrib/websocket v1.3.1/go.mod h1:oDLA6uM7x4hFq1zjy3US3HuvmrlWJKO5nrsw2ZKNSfY= github.com/gofiber/fiber/v2 v2.46.0/go.mod h1:DNl0/c37WLe0g92U6lx1VMQuxGUQY5V7EIaVoEsUffc= -github.com/gofiber/fiber/v2 v2.52.0 h1:S+qXi7y+/Pgvqq4DrSmREGiFwtB7Bu6+QFLuIHYw/UE= -github.com/gofiber/fiber/v2 v2.52.0/go.mod h1:KEOE+cXMhXG0zHc9d8+E38hoX+ZN7bhOtgeF2oT6jrQ= +github.com/gofiber/fiber/v2 v2.52.4 h1:P+T+4iK7VaqUsq2PALYEfBBo6bJZ4q3FP8cZ84EggTM= +github.com/gofiber/fiber/v2 v2.52.4/go.mod h1:KEOE+cXMhXG0zHc9d8+E38hoX+ZN7bhOtgeF2oT6jrQ= github.com/gofiber/swagger v0.1.12 h1:1Son/Nc1teiIftsVu6UHqXnJ3uf31pUzZO6XQDx3QYs= github.com/gofiber/swagger v0.1.12/go.mod h1:iOCNEt1gNTtlvCEKoxYX4agnZNtxlAjhujMKG6pmG74= github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= @@ -272,8 +274,8 @@ github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3 github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU= -github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= @@ -299,8 +301,6 @@ github.com/holiman/uint256 v1.2.4 h1:jUc4Nk8fm9jZabQuqr2JzednajVmBpC+oiTiXZJEApU github.com/holiman/uint256 v1.2.4/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E= github.com/huin/goupnp v1.3.0 h1:UvLUlWDNpoUdYzb2TCn+MuTWtcjXKSza2n6CBdQ0xXc= github.com/huin/goupnp v1.3.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFckNX8= -github.com/iancoleman/strcase v0.2.0 h1:05I4QRnGpI0m37iZQRuskXh+w77mr6Z41lwQzuHLwW0= -github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= @@ -321,8 +321,8 @@ github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1 github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.16.3/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= -github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= -github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.8 h1:YcnTYrq7MikUT7k0Yb5eceMmALQPYBW/Xltxn0NAMnU= +github.com/klauspost/compress v1.17.8/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= @@ -402,8 +402,8 @@ github.com/redis/go-redis/v9 v9.0.3/go.mod h1:WqMKv5vnQbRuZstUwxQI195wHy+t4PuXDO github.com/redis/go-redis/v9 v9.0.5 h1:CuQcn5HIEeK7BgElubPP8CGtE0KakrnbBSTLjathl5o= github.com/redis/go-redis/v9 v9.0.5/go.mod h1:WqMKv5vnQbRuZstUwxQI195wHy+t4PuXDOjzMvcuQHk= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= -github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= -github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= +github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= +github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -420,11 +420,11 @@ github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD github.com/savsgio/dictpool v0.0.0-20221023140959-7bf2e61cea94/go.mod h1:90zrgN3D/WJsDd1iXHT96alCoN2KJo6/4x1DZC3wZs8= github.com/savsgio/gotils v0.0.0-20220530130905-52f3993e8d6d/go.mod h1:Gy+0tqhJvgGlqnTF8CVGP0AaGRjwBtXs/a5PA0Y3+A4= github.com/savsgio/gotils v0.0.0-20230208104028-c358bd845dee/go.mod h1:qwtSXrKuJh/zsFQ12yEE89xfCrGKK63Rr7ctU/uCo4g= +github.com/savsgio/gotils v0.0.0-20240303185622-093b76447511 h1:KanIMPX0QdEdB4R3CiimCAbxFrhB3j7h0/OvpYGVQa8= +github.com/savsgio/gotils v0.0.0-20240303185622-093b76447511/go.mod h1:sM7Mt7uEoCeFSCBM+qBrqvEo+/9vdmj19wzp3yzUhmg= github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible h1:Bn1aCHHRnjv4Bl16T8rcaFjYSrGrIZvpiGO6P3Q4GpU= github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= -github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= github.com/spf13/afero v1.10.0 h1:EaGW2JJh15aKOejeuJ+wpFSHnbd7GE6Wvp3TsNhb6LY= github.com/spf13/afero v1.10.0/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= @@ -440,8 +440,9 @@ github.com/status-im/keycard-go v0.2.0 h1:QDLFswOQu1r5jsycloeQh3bVU8n/NatHHaZobt github.com/status-im/keycard-go v0.2.0/go.mod h1:wlp8ZLbsmrF6g6WjugPAx+IzoLrkdf9+mHxBEeo3Hbg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -452,8 +453,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= github.com/supranational/blst v0.3.11 h1:LyU6FolezeWAhvQk0k6O/d49jqgO52MSDDfYgbeoEm4= @@ -480,8 +481,8 @@ github.com/urfave/cli/v2 v2.27.1/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6S github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasthttp v1.47.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA= -github.com/valyala/fasthttp v1.51.0 h1:8b30A5JlZ6C7AS81RsWjYMQmrZG6feChmgAolCl1SqA= -github.com/valyala/fasthttp v1.51.0/go.mod h1:oI2XroL+lI7vdXyYoQk03bXBThfFl2cVdIA3Xl7cH8g= +github.com/valyala/fasthttp v1.52.0 h1:wqBQpxH71XW0e2g+Og4dzQM8pk34aFYlA1Ga8db7gU0= +github.com/valyala/fasthttp v1.52.0/go.mod h1:hf5C4QnVMkNXMspnsUlfM3WitlgYflyhHYoKol/szxQ= github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8= github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= github.com/xrash/smetrics v0.0.0-20231213231151-1d8dd44e695e h1:+SOyEddqYF09QP7vr7CgJ1eti3pY9Fn3LHO1M1r/0sI= @@ -510,8 +511,8 @@ golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc= -golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= +golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -537,8 +538,6 @@ golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRu golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= @@ -595,8 +594,8 @@ golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= -golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= +golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -676,8 +675,8 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= -golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -697,8 +696,8 @@ golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=